diff --git a/modules/admin_menu/tests/admin_menu.test b/modules/admin_menu/tests/admin_menu.test deleted file mode 100644 index e780c06..0000000 --- a/modules/admin_menu/tests/admin_menu.test +++ /dev/null @@ -1,156 +0,0 @@ -assertPattern(), be sure to use the 's' modifier for - * the PCRE pattern, since admin menu's output spans over multiple lines. - */ - - -/** - * Test menu links depending on user permissions. - */ -class AdminMenuPermissionsTestCase extends DrupalWebTestCase { - public static function getInfo() { - return array( - 'name' => t('Menu link permissions'), - 'description' => t('Verify that menu is displayed according to user permissions.'), - 'group' => t('Administration menu'), - ); - } - - function setUp() { - parent::setUp('admin_menu'); - admin_menu_exit(); - } - - /** - * Test that the links are added to the page (no JS testing). - */ - function testPermissions() { - // Anonymous users should not see the menu. - $this->assertNoRaw('
drupalCreateUser(array('administer site configuration', 'access administration pages', 'administer nodes', 'access administration menu')); - $this->drupalLogin($admin_user); - - // Check that the user can see the admin links, but not the drupal links. - $this->assertRaw('
drupalGet('node'); - $this->assertPattern('@
assertNoPattern('@
assertNoPattern('@
drupalCreateUser(array('administer site configuration', 'access administration pages', 'administer nodes', 'access administration menu', 'display drupal links')); - $this->drupalLogin($admin_user2); - $this->drupalGet('node'); - $this->assertPattern('@
assertNoPattern('@
t('Module menu links'), - 'description' => t('Verify that menu contains links according to enabled modules.'), - 'group' => t('Administration menu'), - ); - } - - function setUp() { - parent::setUp('admin_menu', 'contact'); - admin_menu_exit(); - } - - /** - * Test that the links are added to the page (no JS testing). - */ - function testContactModuleLinks() { - // Create a new user without 'administer site-wide contact form' permission. - $admin_user = $this->drupalCreateUser(array('access administration pages', 'access administration menu')); - $this->drupalLogin($admin_user); - - // Verify that proper links are displayed. - $this->assertRaw('
drupalGet('node'); - $this->assertNoPattern('@
drupalCreateUser(array('access administration pages', 'access administration menu', 'administer site-wide contact form')); - $this->drupalLogin($admin_user); - - // Verify that proper links are displayed. - $this->drupalGet('node'); - $this->assertPattern('@
t('Menu links'), - 'description' => t('Verify that menu contains proper links.'), - 'group' => t('Administration menu'), - ); - } - - function setUp() { - parent::setUp('admin_menu'); - admin_menu_exit(); - // Create and log in a full-blown administrative user. - $permissions = module_invoke_all('perm'); - $admin_user = $this->drupalCreateUser($permissions); - $this->admin_user = $this->drupalLogin($admin_user); - } - - /** - * Test link contents. - */ - function testLinkContents() { - // Create a content-type with special characters. - $info = array( - 'type' => 'special', - 'name' => 'Cool & Special', - 'module' => 'node', - 'description' => '', - ); - $info = (object)_node_type_set_defaults($info); - node_type_save($info); - $this->drupalPost('admin/settings/performance', array(), t('Clear cached data')); - - // Fetch a page. - $this->drupalGet('node'); - $this->assertRaw('
strtr('Edit !content-type', array('!content-type' => t('Page'))), - url('admin/content/node-type/special') => strtr('Edit !content-type', array('!content-type' => t('Cool & Special'))), - ); - foreach ($links as $url => $title) { - $this->assertFieldByXPath('//div[@id="admin-menu"]//a[@href="' . $url . '"]', $title, t('!link-title content-type link found.', array('!link-title' => $title))); - } - $links = array( - url('node/add/page') => t('Page'), - url('node/add/special') => t('Cool & Special'), - ); - foreach ($links as $url => $title) { - $this->assertFieldByXPath('//div[@id="admin-menu"]//a[@href="' . $url . '"]', $title, t('Create content » !link-title link found.', array('!link-title' => $title))); - } - } -} - diff --git a/modules/better_formats/tests/better_formats_anonymous_user.test b/modules/better_formats/tests/better_formats_anonymous_user.test deleted file mode 100644 index ce9cdba..0000000 --- a/modules/better_formats/tests/better_formats_anonymous_user.test +++ /dev/null @@ -1,124 +0,0 @@ - t('Better formats tests'), - 'description' => t('Test some of the BetterFormats features.'), - 'group' => t('Better Formats'), - ); - } - - /** - * Implementation of setUp(). - */ - function setUp() { - parent::setUp('better_formats'); - - } - - /** - * Test various behaviors for anonymous users. - */ - function testBetterFormatsFunctionalTest() { - // Create a user with permission to view the actions administration pages. - $admin = $this->drupalCreateUser(array('administer permissions', 'administer filters')); - $this->drupalLogin($admin); - - // Hide the format tips link. - $this->setPermission('anonymous user', array('show more format tips link' => FALSE, 'access comments' => TRUE, 'access content' => TRUE, 'post comments' => TRUE, 'post comments without approval' => TRUE)); - $this->node = $this->drupalCreateNode(array('type' => 'story', 'promote' => 1, 'comment' => 2)); - $this->drupalLogout(); - $this->drupalGet('comment/reply/' . $this->node->nid); - $this->assertNoText('More information about formatting options.', 'Show more format tips link removed.'); - - // Default for comments, hiding format selection on comments. - $this->drupalLogin($admin); - // Let anon use full html - it's crazy, but it's just simpletest - $edit = array(); - $edit['roles[1]'] = TRUE; - $this->drupalPost('admin/settings/filters/2', $edit, t('Save configuration')); - - // Set full html as default for anon on comments - again, crazy, but... - $edit = array(); - $edit['comment-1[format]'] = 2; - $this->drupalPost('admin/settings/filters/defaults', $edit, t('Save defaults')); - - $this->setPermission('anonymous user', array('show format selection for comments' => FALSE, 'create page content' => TRUE)); - $this->drupalLogout(); - - // Now, do we see the signature for Full HTML on the comment page? - $this->drupalGet('comment/reply/' . $this->node->nid); - $this->assertNoText('Allowed HTML tags:', 'Filter tips removed on comments.'); - $this->assertText('Web page addresses and e-mail addresses turn into links automatically.', 'Filter tips removed on comments.'); - - // And do we see the Filtered HTML on a node page? - $this->drupalGet('node/add/page'); - $this->assertText('Allowed HTML tags:', 'Filter tips still on a page.'); - - // Collapsible format selection collapsed by default. - $this->drupalLogin($admin); - $this->setPermission('anonymous user', array('show format selection for comments' => TRUE)); - $this->drupalLogout(); - $this->drupalGet('comment/reply/' . $this->node->nid); - $this->assertText('Filtered HTML', 'Allow format selection on comments.'); - $this->assertRaw('