diff --git a/tests/node_admin_ui.test b/tests/node_admin_ui.test index f49b469..0846433 100644 --- a/tests/node_admin_ui.test +++ b/tests/node_admin_ui.test @@ -2,7 +2,7 @@ /** * @file - * Contains NodeAdminUITest + * Contains NodeAdminUITest. */ /** @@ -18,7 +18,7 @@ class NodeAdminUITest extends DrupalWebTestCase { /** * @var object - * cotentn admin user object. + * content admin user object. */ protected $content_admin; @@ -32,10 +32,9 @@ class NodeAdminUITest extends DrupalWebTestCase { } /** - * Set up some required modules + * Set up some required modules. */ function setUp() { - // We can only test the plugins that don't require other modules parent::setUp('node', 'views', 'views_bulk_operations', 'node_admin'); $this->page_admin = $this->drupalCreateUser(array('administer page nodes', 'create page content', 'delete any page content', 'edit any page content')); $this->content_admin = $this->drupalCreateUser(array('administer nodes', 'administer page nodes', 'administer story nodes', 'delete any page content', 'delete any story content')); @@ -43,23 +42,25 @@ class NodeAdminUITest extends DrupalWebTestCase { /** - * Test page content type specific functionality. + * Test page content type administer functionality. */ function testPageAdminPages() { - // Make sure page admin has access. + // Login as content type specific node admin. $this->drupalLogin($this->page_admin); + + // Make sure page admin has access. $this->drupalGet('admin/content/node/page'); $this->assertResponse(200); - // No access to other content type admin page + // No access to other content type admin page. $this->drupalGet('admin/content/node/story'); $this->assertResponse(403); - // or invalid content type. + // Check 403 for invalid content type. $this->drupalGet('admin/content/node/foo'); $this->assertResponse(403); - // Create a new page node + // Create a new page node. $node = $this->drupalCreateNode(array('type' => 'page')); $this->drupalGet('admin/content/node/page'); @@ -71,17 +72,18 @@ class NodeAdminUITest extends DrupalWebTestCase { * Test content admin user functionality. */ function testContentAdminPages() { - // Make sure content admin has access to all admin pages. + // Login as global node admin. $this->drupalLogin($this->content_admin); + + // Make sure content admin has access to all admin pages. $this->drupalGet('admin/content/node'); $this->assertResponse(200); - $this->drupalGet('admin/content/node/page'); $this->assertResponse(200); $this->drupalGet('admin/content/node/story'); $this->assertResponse(200); - // Create a page node and a story + // Create a page node and a story. $page = $this->drupalCreateNode(array('type' => 'page')); $story = $this->drupalCreateNode(array('type' => 'story')); $this->drupalGet('admin/content/node'); @@ -89,11 +91,10 @@ class NodeAdminUITest extends DrupalWebTestCase { $this->assertNodeItem($page, TRUE); $this->assertNodeItem($story, TRUE); - // Only specific content type in it's own admin page. + // Only specific content type nodes in its own admin page. $this->drupalGet('admin/content/node/page'); $this->assertNodeItem($page); $this->assertNoNodeItem($story); - $this->drupalGet('admin/content/node/story'); $this->assertNodeItem($story); $this->assertNoNodeItem($page); @@ -103,7 +104,7 @@ class NodeAdminUITest extends DrupalWebTestCase { * Asserts node item in node admin list. * * @param object $node - * Node object to asset. + * Node object to assert. * @param bool $is_admin_page * Flag to specify core node admin page or not. * @@ -124,13 +125,13 @@ class NodeAdminUITest extends DrupalWebTestCase { * Asserts no node item in node admin list. * * @param object $node - * Node object to asset. + * Node object to assert. * @param bool $is_admin_page * Flag to specify core node admin page or not. * */ protected function assertNoNodeItem($node, $is_admin_page = FALSE) { - // Make sure node present with link. + // Make sure node title is present as link. $this->assertNoLink($node->title); $this->assertNoLinkByHref('node/' . $node->nid); // Check for no edit/delete link of this node.