Commit 75035ae4 authored by jhodgdon's avatar jhodgdon

Issue #1431658 by Albert Volkman, xjm, kid_icarus, ChinggizKhan, rgristroph,...

Issue #1431658 by Albert Volkman, xjm, kid_icarus, ChinggizKhan, rgristroph, connork: Massive API docs cleanup for system tests
parent 1c2b1b85
......@@ -30,8 +30,7 @@ public static function getInfo() {
}
/**
* Test the configuration of advanced actions through the administration
* interface.
* Tests configuration of advanced actions through administration interface.
*/
function testActionConfiguration() {
// Create a user with permission to view the actions administration pages.
......
......@@ -10,7 +10,7 @@
use Drupal\simpletest\WebTestBase;
/**
* Test actions executing in a potential loop, and make sure they abort properly.
* Tests aborting of actions executing in a potential loop.
*/
class LoopTest extends WebTestBase {
......@@ -32,7 +32,7 @@ public static function getInfo() {
}
/**
* Set up a loop with 3 - 12 recursions, and see if it aborts properly.
* Sets up a loop with 3 - 12 recursions, and sees if it aborts properly.
*/
function testActionLoop() {
$user = $this->drupalCreateUser(array('administer actions'));
......@@ -55,7 +55,9 @@ function testActionLoop() {
}
/**
* Create an infinite loop by causing a watchdog message to be set,
* Loops watchdog messages up to actions_max_stack times.
*
* Creates an infinite loop by causing a watchdog message to be set,
* which causes the actions to be triggered again, up to action_max_stack
* times.
*/
......
......@@ -22,7 +22,7 @@ abstract class AjaxTestBase extends WebTestBase {
public static $modules = array('ajax_test', 'ajax_forms_test');
/**
* Assert that a command with the required properties exists within the array of Ajax commands returned by the server.
* Asserts the array of Ajax commands contains the searched command.
*
* The Ajax framework, via the ajax_render() function, returns an array of
* commands. This array sometimes includes commands automatically provided by
......
......@@ -20,7 +20,7 @@ public static function getInfo() {
}
/**
* Test the various Ajax Commands.
* Tests the various Ajax Commands.
*/
function testAjaxCommands() {
$form_path = 'ajax_forms_test_ajax_commands_form';
......
......@@ -8,7 +8,7 @@
namespace Drupal\system\Tests\Ajax;
/**
* Miscellaneous Ajax tests using ajax_test module.
* Tests using ajax_test module.
*/
class ElementValidationTest extends AjaxTestBase {
public static function getInfo() {
......@@ -20,7 +20,7 @@ public static function getInfo() {
}
/**
* Try to post an Ajax change to a form that has a validated element.
* Tries to post an Ajax change to a form that has a validated element.
*
* The drivertext field is Ajax-enabled. An additional field is not, but
* is set to be a required field. In this test the required field is not
......
......@@ -8,7 +8,7 @@
namespace Drupal\system\Tests\Ajax;
/**
* Test that $form_state['values'] is properly delivered to $ajax['callback'].
* Tests that $form_state['values'] is properly delivered to $ajax['callback'].
*/
class FormValuesTest extends AjaxTestBase {
public static function getInfo() {
......@@ -27,7 +27,7 @@ function setUp() {
}
/**
* Create a simple form, then POST to system/ajax to change to it.
* Submits forms with select and checkbox elements via AJAX.
*/
function testSimpleAjaxFormValue() {
// Verify form values of a select element.
......
......@@ -20,7 +20,7 @@ public static function getInfo() {
}
/**
* Test that ajax_render() returns JavaScript settings generated during the page request.
* Ensures ajax_render() returns JavaScript settings from the page request.
*
* @todo Add tests to ensure that ajax_render() returns commands for new CSS
* and JavaScript files to be loaded by the page. See
......@@ -45,7 +45,7 @@ function testAJAXRender() {
}
/**
* Test behavior of ajax_render_error().
* Tests behavior of ajax_render_error().
*/
function testAJAXRenderError() {
// Verify default error message.
......@@ -69,7 +69,7 @@ function testAJAXRenderError() {
}
/**
* Test that new JavaScript and CSS files added during an AJAX request are returned.
* Tests that new JavaScript and CSS files are returned on an AJAX request.
*/
function testLazyLoad() {
$expected = array(
......
......@@ -53,7 +53,7 @@ function setUp() {
}
/**
* Test that a page with the 'page_node_form' included twice works correctly.
* Tests that pages with the 'page_node_form' included twice works correctly.
*/
function testMultiForm() {
// HTML IDs for elements within the field are potentially modified with
......
......@@ -81,7 +81,7 @@ function setUp() {
}
/**
* Test the _batch_api_percentage() function.
* Tests the _batch_api_percentage() function.
*/
function testBatchPercentages() {
foreach ($this->testCases as $expected_result => $arguments) {
......
......@@ -30,7 +30,7 @@ public static function getInfo() {
}
/**
* Test batches triggered outside of form submission.
* Tests batches triggered outside of form submission.
*/
function testBatchNoForm() {
// Displaying the page triggers batch 1.
......@@ -41,7 +41,7 @@ function testBatchNoForm() {
}
/**
* Test batches defined in a form submit handler.
* Tests batches defined in a form submit handler.
*/
function testBatchForm() {
// Batch 0: no operation.
......@@ -80,7 +80,7 @@ function testBatchForm() {
}
/**
* Test batches defined in a multistep form.
* Tests batches defined in a multistep form.
*/
function testBatchFormMultistep() {
$this->drupalGet('batch-test/multistep');
......@@ -100,7 +100,7 @@ function testBatchFormMultistep() {
}
/**
* Test batches defined in different submit handlers on the same form.
* Tests batches defined in different submit handlers on the same form.
*/
function testBatchFormMultipleBatches() {
// Batches 1, 2 and 3 are triggered in sequence by different submit
......@@ -117,7 +117,7 @@ function testBatchFormMultipleBatches() {
}
/**
* Test batches defined in a programmatically submitted form.
* Tests batches defined in a programmatically submitted form.
*
* Same as above, but the form is submitted through drupal_form_execute().
*/
......@@ -135,7 +135,7 @@ function testBatchFormProgrammatic() {
}
/**
* Test that drupal_form_submit() can run within a batch operation.
* Tests that drupal_form_submit() can run within a batch operation.
*/
function testDrupalFormSubmitInBatch() {
// Displaying the page triggers a batch that programmatically submits a
......@@ -146,8 +146,9 @@ function testDrupalFormSubmitInBatch() {
}
/**
* Test batches that return $context['finished'] > 1 do in fact complete.
* See http://drupal.org/node/600836
* Tests batches that return $context['finished'] > 1 do in fact complete.
*
* @see http://drupal.org/node/600836
*/
function testBatchLargePercentage() {
// Displaying the page triggers batch 5.
......@@ -159,7 +160,7 @@ function testBatchLargePercentage() {
/**
* Will trigger a pass if the texts were found in order in the raw content.
* Triggers a pass if the texts were found in order in the raw content.
*
* @param $texts
* Array of raw strings to look for .
......@@ -174,7 +175,7 @@ function assertBatchMessages($texts, $message) {
}
/**
* Helper function: return expected execution stacks for the test batches.
* Returns expected execution stacks for the test batches.
*/
function _resultStack($id, $value = 0) {
$stack = array();
......@@ -241,7 +242,7 @@ function _resultStack($id, $value = 0) {
}
/**
* Helper function: return expected result messages for the test batches.
* Returns expected result messages for the test batches.
*/
function _resultMessages($id) {
$messages = array();
......
......@@ -23,7 +23,7 @@ public static function getInfo() {
}
/**
* Test that drupal_get_filename() works correctly when the file is not found in the database.
* Tests that drupal_get_filename() works when the file is not in database.
*/
function testDrupalGetFilename() {
// Reset the static cache so we can test the "db is not active" code of
......
......@@ -30,7 +30,7 @@ public static function getInfo() {
}
/**
* Test calling of hook_boot() and hook_exit().
* Tests calling of hook_boot() and hook_exit().
*/
function testHookBootExit() {
// Test with cache disabled. Boot and exit should always fire.
......
......@@ -48,7 +48,7 @@ function tearDown() {
}
/**
* test IP Address and hostname
* Tests IP address and hostname.
*/
function testIPAddressHost() {
// Test the normal IP address.
......
......@@ -23,7 +23,7 @@ public static function getInfo() {
}
/**
* Test miscellaneous functions in bootstrap.inc.
* Tests miscellaneous functions in bootstrap.inc.
*/
function testMisc() {
// Test drupal_array_merge_deep().
......
......@@ -22,7 +22,7 @@ public static function getInfo() {
}
/**
* Test providing a direct URL to to drupal_override_server_variables().
* Tests providing a direct URL to to drupal_override_server_variables().
*/
function testDrupalOverrideServerVariablesProvidedURL() {
$tests = array(
......
......@@ -39,7 +39,7 @@ function setUp() {
}
/**
* Test support for requests containing If-Modified-Since and If-None-Match headers.
* Tests support of requests with If-Modified-Since and If-None-Match headers.
*/
function testConditionalRequests() {
$config = config('system.performance');
......@@ -83,7 +83,7 @@ function testConditionalRequests() {
}
/**
* Test cache headers.
* Tests cache headers.
*/
function testPageCache() {
$config = config('system.performance');
......@@ -125,7 +125,7 @@ function testPageCache() {
}
/**
* Test page compression.
* Tests page compression.
*
* The test should pass even if zlib.output_compression is enabled in php.ini,
* .htaccess or similar, or if compression is done outside PHP, e.g. by the
......
......@@ -23,7 +23,9 @@ public static function getInfo() {
}
/**
* Test that a variable reference returned by drupal_static() gets reset when
* Tests drupal_static() function.
*
* Tests that a variable reference returned by drupal_static() gets reset when
* drupal_static_reset() is called.
*/
function testDrupalStatic() {
......
......@@ -23,9 +23,7 @@ public static function getInfo() {
}
/**
* Test timer_read() to ensure it properly accumulates time when the timer
* started and stopped multiple times.
* @return
* Tests timer_read() time accumulation accuracy across multiple restarts.
*/
function testTimer() {
timer_start('test');
......
......@@ -30,7 +30,7 @@ public static function getInfo() {
}
/**
* testVariable
* Tests variables then deletes them.
*/
function testVariable() {
// Setting and retrieving values.
......
......@@ -19,7 +19,7 @@ abstract class CacheTestBase extends WebTestBase {
protected $default_value = 'CacheTest';
/**
* Check whether or not a cache entry exists.
* Checks whether or not a cache entry exists.
*
* @param $cid
* The cache id.
......@@ -89,7 +89,8 @@ function assertCacheRemoved($message, $cid = NULL, $bin = NULL) {
}
/**
* Perform the general wipe.
* Performs a general wipe of the bin.
*
* @param $bin
* The bin to perform the wipe on.
*/
......
......@@ -28,7 +28,7 @@ function setUp() {
}
/**
* Test drupal_flush_all_caches().
* Tests drupal_flush_all_caches().
*/
function testFlushAllCaches() {
// Create cache entries for each flushed cache bin.
......
......@@ -128,8 +128,7 @@ public function tearDown() {
}
/**
* Test Drupal\Core\Cache\CacheBackendInterface::get() and
* Drupal\Core\Cache\CacheBackendInterface::set().
* Tests the get and set methods of Drupal\Core\Cache\CacheBackendInterface.
*/
public function testSetGet() {
$backend = $this->getCacheBackend();
......@@ -150,7 +149,7 @@ public function testSetGet() {
}
/**
* Test Drupal\Core\Cache\CacheBackendInterface::delete().
* Tests Drupal\Core\Cache\CacheBackendInterface::delete().
*/
public function testDelete() {
$backend = $this->getCacheBackend();
......@@ -174,7 +173,7 @@ public function testDelete() {
}
/**
* Test data type perservation.
* Tests data type preservation.
*/
public function testValueTypeIsKept() {
$backend = $this->getCacheBackend();
......@@ -202,7 +201,7 @@ public function testValueTypeIsKept() {
}
/**
* Test Drupal\Core\Cache\CacheBackendInterface::getMultiple().
* Tests Drupal\Core\Cache\CacheBackendInterface::getMultiple().
*/
public function testGetMultiple() {
$backend = $this->getCacheBackend();
......@@ -281,7 +280,7 @@ public function testGetMultiple() {
}
/**
* Test Drupal\Core\Cache\CacheBackendInterface::isEmpty().
* Tests Drupal\Core\Cache\CacheBackendInterface::isEmpty().
*/
public function testIsEmpty() {
$backend = $this->getCacheBackend();
......@@ -296,7 +295,7 @@ public function testIsEmpty() {
}
/**
* Test Drupal\Core\Cache\CacheBackendInterface::deleteMultiple().
* Tests Drupal\Core\Cache\CacheBackendInterface::deleteMultiple().
*/
public function testDeleteMultiple() {
$backend = $this->getCacheBackend();
......@@ -354,7 +353,7 @@ public function testFlush() {
}
/**
* Check whether or not a cache entry exists.
* Checks whether or not a cache entry exists.
*
* @param $cid
* The cache id.
......@@ -370,7 +369,7 @@ protected function checkCacheExists($cid, $bin = null) {
}
/**
* Test Drupal\Core\Cache\CacheBackendInterface::invalidateTags().
* Tests Drupal\Core\Cache\CacheBackendInterface::invalidateTags().
*/
function testClearTags() {
$backend = $this->getCacheBackend();
......
......@@ -10,7 +10,7 @@
use Drupal\simpletest\WebTestBase;
/**
* Basic tests for drupal_add_feed().
* Tests drupal_add_feed().
*/
class AddFeedTest extends WebTestBase {
public static function getInfo() {
......@@ -22,7 +22,7 @@ public static function getInfo() {
}
/**
* Test drupal_add_feed() with paths, URLs, and titles.
* Tests drupal_add_feed() with paths, URLs, and titles.
*/
function testBasicFeedAddNoTitle() {
$path = $this->randomName(12);
......@@ -81,7 +81,7 @@ function testBasicFeedAddNoTitle() {
}
/**
* Create a pattern representing the RSS feed in the page.
* Creates a pattern representing the RSS feed in the page.
*/
function urlToRSSLinkPattern($url, $title = '') {
// Escape any regular expression characters in the URL ('?' is the worst).
......
......@@ -30,6 +30,9 @@ public static function getInfo() {
);
}
/**
* Tests if the theme has been altered.
*/
function testDrupalAlter() {
// This test depends on Bartik, so make sure that it is always the current
// active theme.
......
......@@ -29,7 +29,7 @@ public static function getInfo() {
}
/**
* Explode a series of tags.
* Explodes a series of tags.
*/
function testDrupalExplodeTags() {
$string = implode(', ', array_keys($this->validTags));
......@@ -38,7 +38,7 @@ function testDrupalExplodeTags() {
}
/**
* Implode a series of tags.
* Implodes a series of tags.
*/
function testDrupalImplodeTags() {
$tags = array_values($this->validTags);
......
......@@ -36,14 +36,14 @@ function setUp() {
}
/**
* Check default stylesheets as empty.
* Checks that default stylesheets are empty.
*/
function testDefault() {
$this->assertEqual(array(), drupal_add_css(), 'Default CSS is empty.');
}
/**
* Test that stylesheets in module .info files are loaded.
* Tests that stylesheets in module .info files are loaded.
*/
function testModuleInfo() {
$this->drupalGet('');
......@@ -172,7 +172,7 @@ function testRenderInlineFullPage() {
}
/**
* Test CSS ordering.
* Tests CSS ordering.
*/
function testRenderOrder() {
// A module CSS file.
......@@ -203,7 +203,7 @@ function testRenderOrder() {
}
/**
* Test CSS override.
* Tests CSS override.
*/
function testRenderOverride() {
$system = drupal_get_path('module', 'system');
......@@ -244,8 +244,7 @@ function testAlter() {
}
/**
* Tests that the query string remains intact when adding CSS files that have
* query string parameters.
* Tests that CSS query string remains intact when added to file.
*/
function testAddCssFileWithQueryString() {
$this->drupalGet('common-test/query-string');
......
......@@ -10,7 +10,7 @@
use Drupal\simpletest\UnitTestBase;
/**
* CSS Unit Tests.
* Tests CSS functions.
*/
class CascadingStylesheetsUnitTest extends UnitTestBase {
public static function getInfo() {
......@@ -22,8 +22,9 @@ public static function getInfo() {
}
/**
* Tests basic CSS loading with and without optimization via drupal_load_stylesheet().
* Tests CSS loading via drupal_load_stylesheet().
*
* This test loads CSS files with and without CSS optimization.
* Known tests:
* - Retain white-space in selectors. (http://drupal.org/node/472820)
* - Proper URLs in imported files. (http://drupal.org/node/265719)
......
......@@ -48,7 +48,7 @@ function setUp() {
}
/**
* Test admin-defined formats in format_date().
* Tests admin-defined formats in format_date().
*/
function testAdminDefinedFormatDate() {
// Create an admin user.
......
......@@ -30,7 +30,7 @@ public static function getInfo() {
}
/**
* Test drupal_goto().
* Tests drupal_goto().
*/
function testDrupalGoto() {
$this->drupalGet('common-test/drupal_goto/redirect');
......@@ -56,7 +56,7 @@ function testDrupalGoto() {
}
/**
* Test hook_drupal_goto_alter().
* Tests hook_drupal_goto_alter().
*/
function testDrupalGotoAlter() {
$this->drupalGet('common-test/drupal_goto/redirect_fail');
......@@ -66,7 +66,7 @@ function testDrupalGotoAlter() {
}
/**
* Test drupal_get_destination().
* Tests drupal_get_destination().
*/
function testDrupalGetDestination() {
$query = $this->randomName(10);
......
......@@ -30,6 +30,9 @@ public static function getInfo() {
);
}
/**
* Checks HTTP requests.
*/
function testDrupalHTTPRequest() {
global $is_https;
......@@ -73,6 +76,9 @@ function testDrupalHTTPRequest() {
}
}
/**
* Tests HTTP basic authorization.
*/
function testDrupalHTTPRequestBasicAuth() {
$username = $this->randomName();
$password = $this->randomName();
......@@ -86,6 +92,9 @@ function testDrupalHTTPRequestBasicAuth() {
$this->assertRaw($password, '$_SERVER["PHP_AUTH_PW"] is passed correctly.');
}
/**
* Tests HTTP redirect requests.
*/
function testDrupalHTTPRequestRedirect() {
$redirect_301 = drupal_http_request(url('system-test/redirect/301', array('absolute' => TRUE)), array('max_redirects' => 1));
$this->assertEqual($redirect_301->redirect_code, 301, 'drupal_http_request follows the 301 redirect.');
......
......@@ -22,7 +22,7 @@ class JavaScriptTest extends WebTestBase {
public static $modules = array('language', 'simpletest', 'common_test', 'path');
/**
* Store configured value for JavaScript preprocessing.
* Stores configured value for JavaScript preprocessing.
*/
protected $preprocess_js = NULL;
......@@ -57,14 +57,14 @@ function tearDown() {
}
/**
* Test default JavaScript is empty.
* Tests that default JavaScript is empty.
*/
function testDefault() {
$this->assertEqual(array(), drupal_add_js(), 'Default JavaScript is empty.');
}
/**
* Test adding a JavaScript file.
* Tests adding a JavaScript file.
*/
function testAddFile() {
$javascript = drupal_add_js('core/misc/collapse.js');
......@@ -72,7 +72,7 @@ function testAddFile() {
}
/**
* Test adding settings.
* Tests adding settings.
*/
function testAddSetting() {
// Add a file in order to test default settings.
......@@ -133,7 +133,7 @@ function testDeferAttribute() {
}
/**
* Test drupal_get_js() for JavaScript settings.
* Tests drupal_get_js() for JavaScript settings.
*/
function testHeaderSetting() {
drupal_add_library('system', 'drupalSettings');
......@@ -179,7 +179,7 @@ function testHeaderSetting() {
}
/**
* Test to see if resetting the JavaScript empties the cache.
* Tests to see if resetting the JavaScript empties the cache.
*/
function testReset() {
drupal_add_library('system', 'drupal');
......@@ -189,7 +189,7 @@ function testReset() {
}
/**
* Test adding inline scripts.
* Tests adding inline scripts.
*/
function testAddInline() {
drupal_add_library('system', 'drupal');
......@@ -201,7 +201,7 @@ function testAddInline() {
}
/**
* Test rendering an external JavaScript file.
* Tests rendering an external JavaScript file.
*/
function testRenderExternal() {
drupal_add_library('system', 'drupal');
......@@ -213,7 +213,7 @@ function testRenderExternal() {
}
/**
* Test drupal_get_js() with a footer scope.
* Tests drupal_get_js() with a footer scope. </