diff --git a/modules/node/node.test b/modules/node/node.test index 0256fec..9b8b5b4 100644 --- a/modules/node/node.test +++ b/modules/node/node.test @@ -6,7 +6,7 @@ */ /** - * Defines a base class for testing the Node module. + * Creates Basic page and Article node types. */ class NodeWebTestCase extends DrupalWebTestCase { function setUp() { @@ -26,7 +26,7 @@ class NodeWebTestCase extends DrupalWebTestCase { } /** - * Test the node_load_multiple() function. + * Tests the loading of multiple nodes. */ class NodeLoadMultipleTestCase extends DrupalWebTestCase { @@ -45,7 +45,7 @@ class NodeLoadMultipleTestCase extends DrupalWebTestCase { } /** - * Create four nodes and ensure they're loaded correctly. + * Tests whether nodes are loaded correctly. */ function testNodeMultipleLoad() { $node1 = $this->drupalCreateNode(array('type' => 'article', 'promote' => 1)); @@ -106,7 +106,7 @@ class NodeLoadMultipleTestCase extends DrupalWebTestCase { } /** - * Tests for the hooks invoked during node_load(). + * Tests the hooks invoked when a node is being loaded. */ class NodeLoadHooksTestCase extends DrupalWebTestCase { public static function getInfo() { @@ -122,7 +122,7 @@ class NodeLoadHooksTestCase extends DrupalWebTestCase { } /** - * Test that hook_node_load() is invoked correctly. + * Tests whether hook_node_load() is invoked correctly. */ function testHookNodeLoad() { // Create some sample articles and pages. @@ -150,7 +150,7 @@ class NodeLoadHooksTestCase extends DrupalWebTestCase { } /** - * Tests the node revision functionality. + * Tests node revision functionality. */ class NodeRevisionsTestCase extends DrupalWebTestCase { protected $nodes; @@ -201,7 +201,7 @@ class NodeRevisionsTestCase extends DrupalWebTestCase { } /** - * Checks node revision related operations. + * Tests whether the correct revision text appears on the view revisions page. */ function testRevisions() { $nodes = $this->nodes; @@ -237,7 +237,7 @@ class NodeRevisionsTestCase extends DrupalWebTestCase { } /** - * Checks that revisions are correctly saved without log messages. + * Tests whether revisions are correctly saved without log messages. */ function testNodeRevisionWithoutLogMessage() { // Create a node with an initial log message. @@ -286,7 +286,7 @@ class NodeRevisionsTestCase extends DrupalWebTestCase { } /** - * Tests the node edit functionality. + * Tests node edit functionality. */ class PageEditTestCase extends DrupalWebTestCase { protected $web_user; @@ -308,7 +308,7 @@ class PageEditTestCase extends DrupalWebTestCase { } /** - * Checks node edit functionality. + * Tests node edit functionality. */ function testPageEdit() { $this->drupalLogin($this->web_user); @@ -375,7 +375,7 @@ class PageEditTestCase extends DrupalWebTestCase { } /** - * Tests changing a node's "authored by" field. + * Tests whether a node is authored by the currently logged in user. */ function testPageAuthoredBy() { $this->drupalLogin($this->admin_user); @@ -421,7 +421,7 @@ class PageEditTestCase extends DrupalWebTestCase { } /** - * Tests the node entity preview functionality. + * Tests node preview functionality. */ class PagePreviewTestCase extends DrupalWebTestCase { public static function getInfo() { @@ -440,7 +440,7 @@ class PagePreviewTestCase extends DrupalWebTestCase { } /** - * Checks the node preview functionality. + * Tests node preview functionality. */ function testPagePreview() { $langcode = LANGUAGE_NONE; @@ -464,7 +464,7 @@ class PagePreviewTestCase extends DrupalWebTestCase { } /** - * Checks the node preview functionality, when using revisions. + * Tests node preview functionality, when using revisions. */ function testPagePreviewWithRevisions() { $langcode = LANGUAGE_NONE; @@ -515,7 +515,7 @@ class NodeCreationTestCase extends DrupalWebTestCase { } /** - * Creates a "Basic page" node and verifies its consistency in the database. + * Tests whether a Basic page node exists in the database. */ function testNodeCreation() { // Create a node. @@ -534,7 +534,7 @@ class NodeCreationTestCase extends DrupalWebTestCase { } /** - * Verifies that a transaction rolls back the failed creation. + * Tests whether a Rollback explanatory error is logged to watchdog. */ function testFailedPageCreation() { // Create a node. @@ -575,7 +575,7 @@ class NodeCreationTestCase extends DrupalWebTestCase { } /** - * Create an unpublished node and confirm correct redirect behavior. + * Tests the redirection behavior of an unpublished node. */ function testUnpublishedNodeCreation() { // Set "Basic page" content type to be unpublished by default. @@ -595,7 +595,7 @@ class NodeCreationTestCase extends DrupalWebTestCase { } /** - * Tests the functionality of node entity edit permissions. + * Tests the functionality of node edit permissions. */ class PageViewTestCase extends DrupalWebTestCase { public static function getInfo() { @@ -607,7 +607,7 @@ class PageViewTestCase extends DrupalWebTestCase { } /** - * Tests an anonymous and unpermissioned user attempting to edit the node. + * Tests anonymous and unpermissioned users editing nodes. */ function testPageView() { // Create a node to view. @@ -740,7 +740,9 @@ class NodeBlockTestCase extends DrupalWebTestCase { $admin_user = $this->drupalCreateUser(array('administer blocks')); $this->drupalLogin($admin_user); } - +/** + * Tests whether the syndicate block is available. + */ function testSyndicateBlock() { // Set block title to confirm that the interface is available. $this->drupalPost('admin/structure/block/manage/node/syndicate/configure', array('title' => $this->randomName(8)), t('Save block')); @@ -755,7 +757,7 @@ class NodeBlockTestCase extends DrupalWebTestCase { } /** - * Checks that the post information displays when enabled for a content type. + * Tests whether post information is displayed when enabled for a content type. */ class NodePostSettingsTestCase extends DrupalWebTestCase { public static function getInfo() { @@ -774,7 +776,7 @@ class NodePostSettingsTestCase extends DrupalWebTestCase { } /** - * Confirms "Basic page" content type and post information is on a new node. + * Tests whether post information is displayed for a new node. */ function testPagePostInfo() { @@ -797,7 +799,7 @@ class NodePostSettingsTestCase extends DrupalWebTestCase { } /** - * Confirms absence of post information on a new node. + * Tests whether post information is not displayed for a new node. */ function testPageNotPostInfo() { @@ -820,7 +822,7 @@ class NodePostSettingsTestCase extends DrupalWebTestCase { } /** - * Ensures that data added to nodes by other modules appears in RSS feeds. + * Tests whether data added to nodes by other modules appears in RSS feeds. * * Create a node, enable the node_test module to ensure that extra data is * added to the node->content array, then verify that the data appears on the @@ -847,7 +849,7 @@ class NodeRSSContentTestCase extends DrupalWebTestCase { } /** - * Ensures that a new node includes the custom data when added to an RSS feed. + * Test whether a new node includes the custom data when added to an RSS feed. */ function testNodeRSSContent() { // Create a node. @@ -877,7 +879,7 @@ class NodeRSSContentTestCase extends DrupalWebTestCase { // viewing node. $this->drupalGet("node/$node->nid"); $this->assertNoText($rss_only_content, t('Node content designed for RSS doesn\'t appear when viewing node.')); - + // Check that the node feed page does not try to interpret additional path // components as arguments for node_feed() and returns default content. $this->drupalGet('rss.xml/' . $this->randomName() . '/' . $this->randomName()); @@ -902,7 +904,7 @@ class NodeAccessTestCase extends DrupalWebTestCase { } /** - * Asserts node_access() correctly grants or denies access. + * Tests whether node_access() is granted or denied. */ function assertNodeAccess($ops, $node, $account) { foreach ($ops as $op => $result) { @@ -920,7 +922,7 @@ class NodeAccessTestCase extends DrupalWebTestCase { } /** - * Runs basic tests for node_access function. + * Tests basic node_access functionality. */ function testNodeAccess() { // Ensures user without 'access content' permission can do nothing. @@ -976,7 +978,7 @@ class NodeAccessRecordsTestCase extends DrupalWebTestCase { } /** - * Creates a node and tests the creation of node access rules. + * Tests node access rules. */ function testNodeAccessRecords() { // Create an article node. @@ -1040,7 +1042,7 @@ class NodeAccessRecordsTestCase extends DrupalWebTestCase { } /** - * Tests for Node Access with a non-node base table. + * Tests the node access subsystem when the base table is not a node. */ class NodeAccessBaseTableTestCase extends DrupalWebTestCase { @@ -1157,7 +1159,7 @@ class NodeAccessBaseTableTestCase extends DrupalWebTestCase { } /** - * Checks taxonomy/term listings to ensure only accessible nodes are listed. + * Tests taxonomy/term listings to ensure only accessible nodes are listed. * * @param $is_admin * A boolean indicating whether the current user is an administrator. If @@ -1217,7 +1219,7 @@ class NodeSaveTestCase extends DrupalWebTestCase { } /** - * Checks whether custom node IDs are saved properly during an import operation. + * Tests whether custom node IDs are saved properly during an import operation. * * Workflow: * - first create a piece of content @@ -1252,7 +1254,7 @@ class NodeSaveTestCase extends DrupalWebTestCase { } /** - * Verifies accuracy of the "created" and "changed" timestamp functionality. + * Tests the "created" and "changed" timestamp functionality. */ function testTimestamps() { // Use the default timestamps. @@ -1308,8 +1310,7 @@ class NodeSaveTestCase extends DrupalWebTestCase { } /** - * Tests determing changes in hook_node_presave() and verifies the static node - * load cache is cleared upon save. + * Tests changes in hook_node_presave(). */ function testDeterminingChanges() { // Initial creation. @@ -1351,9 +1352,9 @@ class NodeTypeTestCase extends DrupalWebTestCase { } /** - * Ensures that node type functions (node_type_get_*) work correctly. + * Tests node type functions. * - * Load available node types and validate the returned data. + * Loads available node types and validates the returned data. */ function testNodeTypeGetFunctions() { $node_types = node_type_get_types(); @@ -1370,7 +1371,7 @@ class NodeTypeTestCase extends DrupalWebTestCase { } /** - * Tests creating a content type programmatically and via a form. + * Tests creating content type programmatically and via a form. */ function testNodeTypeCreation() { // Create a content type programmaticaly. @@ -1502,7 +1503,7 @@ class NodeTypeTestCase extends DrupalWebTestCase { } /** - * Test node type customizations persistence. + * Tests node type customizations persistence. */ class NodeTypePersistenceTestCase extends DrupalWebTestCase { public static function getInfo() { @@ -1578,7 +1579,7 @@ class NodeTypePersistenceTestCase extends DrupalWebTestCase { } /** - * Verifies the rebuild functionality for the node_access table. + * Tests the rebuild functionality of the node_access table. */ class NodeAccessRebuildTestCase extends DrupalWebTestCase { public static function getInfo() { @@ -1795,7 +1796,7 @@ class NodeTitleTestCase extends DrupalWebTestCase { } /** - * Creates one node and tests if the node title has the correct value. + * Tests whether the node title has the correct value. */ function testNodeTitle() { // Create "Basic page" content with title. @@ -1826,7 +1827,7 @@ class NodeTitleTestCase extends DrupalWebTestCase { } /** - * Test the node_feed() functionality. + * Tests node_feed() functionality. */ class NodeFeedTestCase extends DrupalWebTestCase { public static function getInfo() { @@ -1838,7 +1839,7 @@ class NodeFeedTestCase extends DrupalWebTestCase { } /** - * Ensures that node_feed() accepts and prints extra channel elements. + * Tests whether node_feed() accepts and prints extra channel elements. */ function testNodeFeedExtraChannelElements() { ob_start(); @@ -1850,7 +1851,7 @@ class NodeFeedTestCase extends DrupalWebTestCase { } /** - * Functional tests for the node module blocks. + * Tests the functionality of the node module blocks. */ class NodeBlockFunctionalTest extends DrupalWebTestCase { public static function getInfo() { @@ -1983,7 +1984,7 @@ class NodeBlockFunctionalTest extends DrupalWebTestCase { } } /** - * Tests basic options of multi-step node forms. + * Tests the basic options of multi-step node forms. */ class MultiStepNodeFormBasicOptionsTest extends DrupalWebTestCase { public static function getInfo() { @@ -2020,7 +2021,7 @@ class MultiStepNodeFormBasicOptionsTest extends DrupalWebTestCase { } /** - * Test to ensure that a node's content is always rebuilt. + * Tests whether a node's content is always rebuilt. */ class NodeBuildContent extends DrupalWebTestCase { @@ -2033,7 +2034,7 @@ class NodeBuildContent extends DrupalWebTestCase { } /** - * Ensures that content array is rebuilt on every call to node_build_content(). + * Tests whether the content array is rebuilt. */ function testNodeRebuildContent() { $node = $this->drupalCreateNode(); @@ -2048,7 +2049,7 @@ class NodeBuildContent extends DrupalWebTestCase { } /** - * Tests node_query_node_access_alter(). + * Test whether node access queries are properly altered by the node module. */ class NodeQueryAlter extends DrupalWebTestCase { @@ -2115,7 +2116,7 @@ class NodeQueryAlter extends DrupalWebTestCase { /** * Tests 'node_access' query alter, for user with access. * - * Verifies that a non-standard table alias can be used, and that a user with + * Tests that a non-standard table alias can be used, and that a user with * node access can view the nodes. */ function testNodeQueryAlterLowLevelWithAccess() { @@ -2138,8 +2139,8 @@ class NodeQueryAlter extends DrupalWebTestCase { /** * Tests 'node_access' query alter, for user without access. * - * Verifies that a non-standard table alias can be used, and that a user - * without node access cannot view the nodes. + * Tests that a non-standard table alias can be used, and that a user without + * node access cannot view the nodes. */ function testNodeQueryAlterLowLevelNoAccess() { // User without access should be able to view 0 nodes. @@ -2161,7 +2162,7 @@ class NodeQueryAlter extends DrupalWebTestCase { /** * Tests 'node_access' query alter, for edit access. * - * Verifies that a non-standard table alias can be used, and that a user with + * Tests that a non-standard table alias can be used, and that a user with * view-only node access cannot edit the nodes. */ function testNodeQueryAlterLowLevelEditAccess() { @@ -2186,7 +2187,7 @@ class NodeQueryAlter extends DrupalWebTestCase { /** * Tests 'node_access' query alter override. * - * Verifies that node_access_view_all_nodes() is called from + * Tests that node_access_view_all_nodes() is called from * node_query_node_access_alter(). We do this by checking that a user who * normally would not have view privileges is able to view the nodes when we * add a record to {node_access} paired with a corresponding privilege in @@ -2247,7 +2248,7 @@ class NodeQueryAlter extends DrupalWebTestCase { /** - * Tests node_query_entity_field_access_alter(). + * Tests node access entity queries. */ class NodeEntityFieldQueryAlter extends DrupalWebTestCase { @@ -2323,7 +2324,7 @@ class NodeTokenReplaceTestCase extends DrupalWebTestCase { } /** - * Creates a node, then tests the tokens generated from it. + * Tests the tokens generated when a node is created. */ function testNodeTokenReplacement() { global $language; @@ -2668,7 +2669,7 @@ class NodeEntityViewModeAlterTest extends NodeWebTestCase { } /** - * Create a "Basic page" node and verify its consistency in the database. + * Tests whether a Basic page node exists in the database. */ function testNodeViewModeChange() { $web_user = $this->drupalCreateUser(array('create page content', 'edit own page content'));