Commit adaa39ea authored by jhodgdon's avatar jhodgdon

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;
......
......@@ -8,7 +8,7 @@
namespace Drupal\node\Tests;
/**
* Test case to check node save related functionality, including import-save
* Tests node save related functionality, including import-save.
*/
class NodeSaveTest extends NodeTestBase {
......@@ -37,7 +37,8 @@ function setUp() {
}
/**
* Import test, to check if custom node ids are saved properly.
* Checks whether custom node IDs are saved properly during an import operation.
*
* Workflow:
* - first create a piece of content
* - save the content
......@@ -71,8 +72,7 @@ function testImport() {
}
/**
* Check that the "created" and "changed" timestamps are set correctly when
* saving a new node or updating an existing node.
* Verifies accuracy of the "created" and "changed" timestamp functionality.
*/
function testTimestamps() {
// Use the default timestamps.
......
......@@ -9,6 +9,9 @@
use Drupal\simpletest\WebTestBase;
/**
* Sets up page and article content types.
*/
abstract class NodeTestBase extends WebTestBase {
/**
......
......@@ -8,7 +8,7 @@
namespace Drupal\node\Tests;
/**
* Test node title.
* Tests node title functionality.
*/
class NodeTitleTest extends NodeTestBase {
......@@ -37,7 +37,7 @@ function setUp() {
}
/**
* Create one node and test if the node title has the correct value.
* Creates one node and tests if the node title has the correct value.
*/
function testNodeTitle() {
// Create "Basic page" content with title.
......
......@@ -7,6 +7,9 @@
namespace Drupal\node\Tests;
/**
* Tests XSS functionality with a node entity.
*/
class NodeTitleXSSTest extends NodeTestBase {
public static function getInfo() {
return array(
......@@ -16,6 +19,9 @@ public static function getInfo() {
);
}
/**
* Tests XSS functionality with a node entity.
*/
function testNodeTitleXSS() {
// Prepare a user to do the stuff.
$web_user = $this->drupalCreateUser(array('create page content', 'edit any page content'));
......
......@@ -35,7 +35,7 @@ function setUp() {
}
/**
* Tests the node type initial language defaults, and modify them.
* Tests the node type initial language defaults, and modifies them.
*
* The default initial language must be the site's default, and the language
* locked option must be on.
......@@ -95,7 +95,7 @@ function testNodeTypeInitialLanguageDefaults() {
}
/**
* Tests Language field visibility features.
* Tests language field visibility features.
*/
function testLanguageFieldVisibility() {
$langcode = LANGUAGE_NOT_SPECIFIED;
......
......@@ -20,7 +20,7 @@ public static function getInfo() {
}
/**
* Test node type customizations persist through disable and uninstall.
* Tests that node type customizations persist through disable and uninstall.
*/
function testNodeTypeCustomizationPersistence() {
$web_user = $this->drupalCreateUser(array('bypass node access', 'administer content types', 'administer modules'));
......
......@@ -28,7 +28,7 @@ public static function getInfo() {
}
/**
* Ensure that node type functions (node_type_get_*) work correctly.
* Ensures that node type functions (node_type_get_*) work correctly.
*
* Load available node types and validate the returned data.
*/
......@@ -47,7 +47,7 @@ function testNodeTypeGetFunctions() {
}
/**
* Test creating a content type programmatically and via a form.
* Tests creating a content type programmatically and via a form.
*/
function testNodeTypeCreation() {
// Create a content type programmaticaly.
......@@ -77,7 +77,7 @@ function testNodeTypeCreation() {
}
/**
* Test editing a node type using the UI.
* Tests editing a node type using the UI.
*/
function testNodeTypeEditing() {
$web_user = $this->drupalCreateUser(array('bypass node access', 'administer content types'));
......@@ -130,7 +130,7 @@ function testNodeTypeEditing() {
}
/**
* Test that node_types_rebuild() correctly handles the 'disabled' flag.
* Tests that node_types_rebuild() correctly handles the 'disabled' flag.
*/
function testNodeTypeStatus() {
// Enable all core node modules, and all types should be active.
......
......@@ -7,6 +7,9 @@
namespace Drupal\node\Tests;
/**
* Tests the node edit functionality.
*/
class PageEditTest extends NodeTestBase {
protected $web_user;
protected $admin_user;
......@@ -27,7 +30,7 @@ function setUp() {
}
/**
* Check node edit functionality.
* Checks node edit functionality.
*/
function testPageEdit() {
$this->drupalLogin($this->web_user);
......@@ -94,7 +97,7 @@ function testPageEdit() {
}
/**
* Check changing node authored by fields.
* Tests changing a node's "authored by" field.
*/
function testPageAuthoredBy() {
$this->drupalLogin($this->admin_user);
......
......@@ -7,6 +7,9 @@
namespace Drupal\node\Tests;
/**
* Tests the node entity preview functionality.
*/
class PagePreviewTest extends NodeTestBase {
public static function getInfo() {
return array(
......@@ -24,7 +27,7 @@ function setUp() {
}
/**
* Check the node preview functionality.
* Checks the node preview functionality.
*/
function testPagePreview() {
$langcode = LANGUAGE_NOT_SPECIFIED;
......@@ -48,7 +51,7 @@ function testPagePreview() {
}
/**
* Check the node preview functionality, when using revisions.
* Checks the node preview functionality, when using revisions.
*/
function testPagePreviewWithRevisions() {
$langcode = LANGUAGE_NOT_SPECIFIED;
......
......@@ -7,6 +7,9 @@
namespace Drupal\node\Tests;
/**
* Tests the functionality of node entity edit permissions.
*/
class PageViewTest extends NodeTestBase {
public static function getInfo() {
return array(
......@@ -17,7 +20,7 @@ public static function getInfo() {
}
/**
* Creates a node and then an anonymous and unpermissioned user attempt to edit the node.
* Tests an anonymous and unpermissioned user attempting to edit the node.
*/
function testPageView() {
// Create a node to view.
......
......@@ -7,6 +7,9 @@
namespace Drupal\node\Tests;
/**
* Tests the summary length functionality.
*/
class SummaryLengthTest extends NodeTestBase {
public static function getInfo() {
return array(
......@@ -17,7 +20,7 @@ public static function getInfo() {
}
/**
* Creates a node and then an anonymous and unpermissioned user attempt to edit the node.
* Tests the node summary length functionality.
*/
function testSummaryLength() {
// Create a node to view.
......
<?php
use Drupal\Core\Database\Query\SelectInterface;
/**
* @file
* Content administration and module settings UI.
* Content administration and module settings user interface.
*/
use Drupal\Core\Database\Query\SelectInterface;
/**
* Page callback: Form constructor for the permission rebuild confirmation form.
*
......@@ -15,6 +15,7 @@
*
* @see node_configure_rebuild_confirm_submit()
* @see node_menu()
* @ingroup forms
*/
function node_configure_rebuild_confirm() {
return confirm_form(array(), t('Are you sure you want to rebuild the permissions on site content?'),
......@@ -266,17 +267,15 @@ function node_filter_form_submit($form, &$form_state) {
/**
* Updates all nodes in the passed-in array with the passed-in field values.
*
* IMPORTANT NOTE: This function is intended to work when called
* from a form submission handler. Calling it outside of the form submission
* process may not work correctly.
* IMPORTANT NOTE: This function is intended to work when called from a form
* submission handler. Calling it outside of the form submission process may not
* work correctly.
*
* @param array $nodes
* Array of node nids to update.
* @param array $updates
* Array of key/value pairs with node field names and the value to update
* that field to.
*
* @ingroup batch
* Array of key/value pairs with node field names and the value to update that
* field to.
*/
function node_mass_update($nodes, $updates) {
// We use batch processing to prevent timeout when updating a large number
......@@ -402,6 +401,7 @@ function _node_mass_update_batch_finished($success, $results, $operations) {
* @see node_menu()
* @see node_multiple_delete_confirm()
* @see node_multiple_delete_confirm_submit()
* @ingroup forms
*/
function node_admin_content($form, $form_state) {
if (isset($form_state['values']['operation']) && $form_state['values']['operation'] == 'delete') {
......@@ -612,8 +612,8 @@ function node_admin_nodes() {
/**
* Form validation handler for node_admin_nodes().
*
* Checks if any nodes have been selected to perform the chosen
* 'Update option' on.
* Checks whether any nodes have been selected to perform the chosen 'Update
* option' on.
*
* @see node_admin_nodes()
* @see node_admin_nodes_submit()
......@@ -674,6 +674,7 @@ function node_admin_nodes_submit($form, &$form_state) {
* @see node_filter_form()
* @see node_filter_form_submit()
* @see node_multiple_delete_confirm_submit()
* @ingroup forms
*/
function node_multiple_delete_confirm($form, &$form_state, $nodes) {
$form['nodes'] = array('#prefix' => '<ul>', '#suffix' => '</ul>', '#tree' => TRUE);
......
This diff is collapsed.