Commit adaa39ea authored by jhodgdon's avatar jhodgdon
Browse files

Issue #1313980 by Albert Volkman, Lars Toomre, jn2, xjm: Massive API docs cleanup for Node module

parent e13cf753
......@@ -2,7 +2,7 @@
/**
* @file
* Content type editing UI.
* Content type editing user interface.
*/
/**
......@@ -426,8 +426,7 @@ function node_node_type_update($info) {
}
/**
* Resets all of the relevant fields of a module-defined node type to their
* default values.
* Resets relevant fields of a module-defined node type to their default values.
*
* @param $type
* The node type to reset. The node type is passed back by reference with its
......@@ -456,6 +455,7 @@ function node_type_reset($type) {
* Form array for delete confirmation form.
*
* @see node_type_delete_confirm_submit()
* @ingroup forms
*/
function node_type_delete_confirm($form, &$form_state, $type) {
$form['type'] = array('#type' => 'value', '#value' => $type->type);
......
/**
* @file
* Javascript for the node content editing form.
*/
(function ($) {
"use strict";
......
......@@ -154,8 +154,8 @@ class Node extends Entity implements ContentEntityInterface {
/**
* The node promotion status.
*
* Promoted nodes should be displayed on the front page of the site. The
* value is either NODE_PROMOTED or NODE_NOT_PROMOTED.
* Promoted nodes should be displayed on the front page of the site. The value
* is either NODE_PROMOTED or NODE_NOT_PROMOTED.
*
* @var integer
*/
......@@ -184,7 +184,7 @@ class Node extends Entity implements ContentEntityInterface {
/**
* The node translation status.
*
* If the translation page needs to be updated the value is 1, otherwise 0.
* If the translation page needs to be updated, the value is 1; otherwise 0.
*
* @var integer
*/
......
......@@ -10,7 +10,7 @@
use Drupal\simpletest\WebTestBase;
/**
* Test multistep node forms basic options.
* Tests basic options of multi-step node forms.
*/
class MultiStepNodeFormBasicOptionsTest extends WebTestBase {
......@@ -37,7 +37,7 @@ function setUp() {
}
/**
* Change the default values of basic options to ensure they persist.
* Tests changing the default values of basic options to ensure they persist.
*/
function testMultiStepNodeFormBasicOptions() {
$edit = array(
......
......@@ -19,7 +19,13 @@ class NodeAccessBaseTableTest extends NodeTestBase {
*/
public static $modules = array('node_access_test');
// Requires tags taxonomy field.
/**
* The installation profile to use with this test.
*
* This test class requires the "tags" taxonomy field.
*
* @var string
*/
protected $profile = 'standard';
public static function getInfo() {
......@@ -30,9 +36,6 @@ public static function getInfo() {
);
}
/**
* Enable modules and create user with specific permissions.
*/
public function setUp() {
parent::setUp();
......@@ -41,7 +44,7 @@ public function setUp() {
}
/**
* Test the "private" node access.
* Tests the "private" node access functionality.
*
* - Create 2 users with "access content" and "create article" permissions.
* - Each user creates one private and one not private article.
......
......@@ -10,7 +10,7 @@
use Drupal\Core\Language\Language;
/**
* Test case to verify node_access functionality for multiple languages.
* Verifies node_access() functionality for multiple languages.
*/
class NodeAccessLanguageTest extends NodeTestBase {
......
......@@ -8,7 +8,7 @@
namespace Drupal\node\Tests;
/**
* Rebuild the node_access table.
* Verifies the rebuild functionality for the node_access table.
*/
class NodeAccessRebuildTest extends NodeTestBase {
public static function getInfo() {
......@@ -27,6 +27,9 @@ function setUp() {
$this->web_user = $web_user;
}
/**
* Tests rebuilding the node access permissions table.
*/
function testNodeAccessRebuild() {
$this->drupalGet('admin/reports/status');
$this->clickLink(t('Rebuild permissions'));
......
......@@ -8,7 +8,7 @@
namespace Drupal\node\Tests;
/**
* Test case to verify hook_node_access_records functionality.
* Tests hook_node_access_records() functionality.
*/
class NodeAccessRecordsTest extends NodeTestBase {
......@@ -28,7 +28,7 @@ public static function getInfo() {
}
/**
* Create a node and test the creation of node access rules.
* Creates a node and tests the creation of node access rules.
*/
function testNodeAccessRecords() {
// Create an article node.
......
......@@ -8,9 +8,11 @@
namespace Drupal\node\Tests;
/**
* Test case to verify basic node_access functionality.
* Tests basic node_access functionality.
*
* Note that hook_node_access_records() is covered in another test class.
*
* @todo Cover hook_node_access in a separate test class.
* hook_node_access_records is covered in another test class.
*/
class NodeAccessTest extends NodeTestBase {
public static function getInfo() {
......@@ -22,7 +24,7 @@ public static function getInfo() {
}
/**
* Asserts node_access correctly grants or denies access.
* Asserts node_access() correctly grants or denies access.
*/
function assertNodeAccess($ops, $node, $account) {
foreach ($ops as $op => $result) {
......
......@@ -8,9 +8,10 @@
namespace Drupal\node\Tests;
/**
* Test node administration page functionality.
* Tests node administration page functionality.
*/
class NodeAdminTest extends NodeTestBase {
public static function getInfo() {
return array(
'name' => 'Node administration',
......@@ -76,6 +77,7 @@ function testContentAdminSort() {
* Tests content overview with different user permissions.
*
* Taxonomy filters are tested separately.
*
* @see TaxonomyNodeFilterTestCase
*/
function testContentAdminPages() {
......
......@@ -36,7 +36,7 @@ function setUp() {
}
/**
* Test the recent comments block.
* Tests the recent comments block.
*/
function testRecentNodeBlock() {
$this->drupalLogin($this->admin_user);
......
......@@ -7,6 +7,9 @@
namespace Drupal\node\Tests;
/**
* Tests the availability of the syndicate block.
*/
class NodeBlockTest extends NodeTestBase {
/**
......
......@@ -21,7 +21,7 @@ public static function getInfo() {
}
/**
* Test to ensure that a node's content array is rebuilt on every call to node_build_content().
* Ensures that content array is rebuilt on every call to node_build_content().
*/
function testNodeRebuildContent() {
$node = $this->drupalCreateNode();
......
......@@ -10,6 +10,9 @@
use Drupal\Core\Database\Database;
use Exception;
/**
* Tests creating and saving a node.
*/
class NodeCreationTest extends NodeTestBase {
/**
......@@ -37,7 +40,7 @@ function setUp() {
}
/**
* Create a "Basic page" node and verify its consistency in the database.
* Creates a "Basic page" node and verifies its consistency in the database.
*/
function testNodeCreation() {
// Create a node.
......@@ -56,7 +59,7 @@ function testNodeCreation() {
}
/**
* Create a page node and verify that a transaction rolls back the failed creation
* Verifies that a transaction rolls back the failed creation.
*/
function testFailedPageCreation() {
// Create a node.
......@@ -97,7 +100,7 @@ function testFailedPageCreation() {
}
/**
* Create an unpublished node and confirm correct redirect behavior.
* Creates an unpublished node and confirms correct redirect behavior.
*/
function testUnpublishedNodeCreation() {
// Set the front page to the test page.
......
......@@ -22,7 +22,7 @@ public static function getInfo() {
}
/**
* Ensure that node_feed accepts and prints extra channel elements.
* Ensures that node_feed() accepts and prints extra channel elements.
*/
function testNodeFeedExtraChannelElements() {
$response = node_feed(array(), array('copyright' => 'Drupal is a registered trademark of Dries Buytaert.'));
......
......@@ -65,7 +65,7 @@ function setUp() {
}
/**
* Test if field languages are correctly set through the node form.
* Tests whether field languages are correctly set through the node form.
*/
function testMultilingualNodeForm() {
// Create "Basic page" content.
......@@ -113,7 +113,7 @@ function testMultilingualNodeForm() {
}
/*
* Test multilingual field display settings.
* Tests multilingual field display settings.
*/
function testMultilingualDisplaySettings() {
// Create "Basic page" content.
......
......@@ -8,9 +8,10 @@
namespace Drupal\node\Tests;
/**
* Check that the post information displays when enabled for a content type.
* Checks that the post information displays when enabled for a content type.
*/
class NodePostSettingsTest extends NodeTestBase {
public static function getInfo() {
return array(
'name' => 'Node post information display',
......@@ -27,7 +28,7 @@ function setUp() {
}
/**
* Set "Basic page" content type to display post information and confirm its presence on a new node.
* Confirms "Basic page" content type and post information is on a new node.
*/
function testPagePostInfo() {
......@@ -50,7 +51,7 @@ function testPagePostInfo() {
}
/**
* Set "Basic page" content type to not display post information and confirm its absence on a new node.
* Confirms absence of post information on a new node.
*/
function testPageNotPostInfo() {
......
......@@ -83,10 +83,10 @@ function testNodeQueryAlterWithUI() {
}
/**
* Lower-level test of 'node_access' query alter, for user with access.
* Tests 'node_access' query alter, for user with access.
*
* Verifies that a non-standard table alias can be used, and that a
* user with node access can view the nodes.
* Verifies that a non-standard table alias can be used, and that a user with
* node access can view the nodes.
*/
function testNodeQueryAlterLowLevelWithAccess() {
// User with access should be able to view 4 nodes.
......@@ -106,10 +106,10 @@ function testNodeQueryAlterLowLevelWithAccess() {
}
/**
* Lower-level test of 'node_access' query alter, for user without access.
* 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.
* Verifies 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.
......@@ -129,10 +129,10 @@ function testNodeQueryAlterLowLevelNoAccess() {
}
/**
* Lower-level test of 'node_access' query alter, for edit access.
* Tests 'node_access' query alter, for edit access.
*
* Verifies that a non-standard table alias can be used, and that a
* user with view-only node access cannot edit the nodes.
* Verifies that a non-standard table alias can be used, and that a user with
* view-only node access cannot edit the nodes.
*/
function testNodeQueryAlterLowLevelEditAccess() {
// User with view-only access should not be able to edit nodes.
......@@ -154,13 +154,13 @@ function testNodeQueryAlterLowLevelEditAccess() {
}
/**
* Lower-level test of 'node_access' query alter override.
* Tests 'node_access' query alter override.
*
* Verifies that node_access_view_all_nodes() is called from
* node_query_node_access_alter(). We do this by checking that
* a user which 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 hook_node_grants().
* 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
* hook_node_grants().
*/
function testNodeQueryAlterOverride() {
$record = array(
......
......@@ -8,7 +8,7 @@
namespace Drupal\node\Tests;
/**
* Ensure that data added to nodes by other modules appears in RSS feeds.
* Ensures that 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
......@@ -42,8 +42,7 @@ function setUp() {
}
/**
* Create a new node and ensure that it includes the custom data when added
* to an RSS feed.
* Ensures that a new node includes the custom data when added to an RSS feed.
*/
function testNodeRSSContent() {
// Create a node.
......
......@@ -7,6 +7,9 @@
namespace Drupal\node\Tests;
/**
* Tests the node revision functionality.
*/
class NodeRevisionsTest extends NodeTestBase {
protected $nodes;
protected $logs;
......@@ -58,7 +61,7 @@ function setUp() {
}
/**
* Check node revision related operations.
* Checks node revision related operations.
*/
function testRevisions() {
$nodes = $this->nodes;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment