Issue #3268833 by quietone, xjm, jungle, ravi.shankar, smustgrave, daffie, Spokje, DanielVeza: Fix method comments in tests for Drupal.Commenting.DocComment.ShortSingleLine

merge-requests/3711/head
Dave Long 2023-05-01 10:24:52 +01:00
parent f678235ac1
commit 2a518a8064
No known key found for this signature in database
GPG Key ID: ED52AE211E142771
93 changed files with 234 additions and 221 deletions

View File

@ -48,6 +48,8 @@ class BlockRegionTest extends UnitTestCase {
}
/**
* Tests transforming a block with the same theme and an existing region.
*
* If the source and destination themes are identical, the region should only
* be passed through if it actually exists in the destination theme.
*
@ -58,6 +60,8 @@ class BlockRegionTest extends UnitTestCase {
}
/**
* Tests transforming a block with the same theme and a non-existent region.
*
* If the source and destination themes are identical, the region should be
* changed to 'content' if it doesn't exist in the destination theme.
*

View File

@ -648,8 +648,7 @@ class ConfigTranslationUiTest extends BrowserTestBase {
}
/**
* Tests the number of source elements for plural strings in config
* translation forms.
* Tests plural source elements in configuration translation forms.
*/
public function testPluralConfigStringsSourceElements() {
$this->drupalLogin($this->adminUser);

View File

@ -548,8 +548,7 @@ class ContentModerationStateTest extends KernelTestBase {
}
/**
* Tests that a non-translatable entity type without a langcode can be
* moderated.
* Tests moderation of a non-translatable entity type with no langcode.
*/
public function testNonLangcodeEntityTypeModeration() {
// Unset the langcode entity key for 'entity_test_rev'.

View File

@ -407,8 +407,7 @@ class DbLogTest extends BrowserTestBase {
}
/**
* Tests the escaping of links in the operation row of a database log detail
* page.
* Tests link escaping in the operation row of a database log detail page.
*/
private function verifyLinkEscaping() {
$link = Link::fromTextAndUrl('View', Url::fromRoute('entity.node.canonical', ['node' => 1]))->toString();

View File

@ -299,8 +299,10 @@ class EntityReferenceAdminTest extends BrowserTestBase {
}
/**
* Tests field settings for an entity reference field when the field has
* multiple target bundles and is set to auto-create the target entity.
* Tests field settings for an entity reference field.
*
* The tested entity reference field has multiple target bundles and is set
* to auto-create the target entity.
*/
public function testMultipleTargetBundles() {
/** @var \Drupal\taxonomy\Entity\Vocabulary[] $vocabularies */

View File

@ -103,8 +103,7 @@ class EntityReferenceAutoCreateTest extends BrowserTestBase {
}
/**
* Tests that the autocomplete input element appears and the creation of a new
* entity.
* Tests the autocomplete input element and entity auto-creation.
*/
public function testAutoCreate() {
$this->drupalGet('node/add/' . $this->referencingType);
@ -154,6 +153,8 @@ class EntityReferenceAutoCreateTest extends BrowserTestBase {
}
/**
* Tests multiple target bundles.
*
* Tests if an entity reference field having multiple target bundles is
* storing the auto-created entity in the right destination.
*/

View File

@ -132,6 +132,8 @@ class TranslationWebTest extends FieldTestBase {
}
/**
* Tests translation revisions.
*
* Check if the field translation attached to the entity revision identified
* by the passed arguments were correctly stored.
*/

View File

@ -155,6 +155,8 @@ class BulkDeleteTest extends FieldKernelTestBase {
}
/**
* Tests deleting fields.
*
* Verify that deleting a field leaves the field data items in the database
* and that the appropriate Field API functions can operate on the deleted
* data and field definition.
@ -314,6 +316,8 @@ class BulkDeleteTest extends FieldKernelTestBase {
}
/**
* Tests purging fields.
*
* Verify that field data items and fields are purged when a field storage is
* deleted.
*/
@ -373,6 +377,8 @@ class BulkDeleteTest extends FieldKernelTestBase {
}
/**
* Tests purging field storages.
*
* Verify that field storages are preserved and purged correctly as multiple
* fields are deleted and purged.
*/

View File

@ -409,7 +409,9 @@ class EntityReferenceFormatterTest extends EntityKernelTestBase {
}
/**
* Sets field values and returns a render array as built by
* Sets field values and returns a render array.
*
* The render array structure is as built by
* \Drupal\Core\Field\FieldItemListInterface::view().
*
* @param \Drupal\Core\Entity\EntityInterface[] $referenced_entities

View File

@ -109,8 +109,7 @@ class FieldImportDeleteUninstallTest extends FieldKernelTestBase {
}
/**
* Tests purging already deleted field storages and fields during a config
* import.
* Tests purging previously deleted fields and storages in config import.
*/
public function testImportAlreadyDeletedUninstall() {
// Create a telephone field for validation.

View File

@ -29,8 +29,7 @@ abstract class FileManagedTestBase extends BrowserTestBase {
}
/**
* Assert that all of the specified hook_file_* hooks were called once, other
* values result in failure.
* Asserts that the specified file hooks were called only once.
*
* @param string[] $expected
* An array of strings containing with the hook name; for example, 'load',
@ -133,8 +132,7 @@ abstract class FileManagedTestBase extends BrowserTestBase {
}
/**
* Create a file and save it to the files table and assert that it occurs
* correctly.
* Creates and saves a file, asserting that it was saved.
*
* @param string $filepath
* Optional string specifying the file path. If none is provided then a

View File

@ -42,8 +42,7 @@ abstract class FileManagedUnitTestBase extends KernelTestBase {
}
/**
* Assert that all of the specified hook_file_* hooks were called once, other
* values result in failure.
* Asserts that the specified file hooks were called only once.
*
* @param array $expected
* Array with string containing with the hook name, e.g. 'load', 'save',
@ -146,8 +145,7 @@ abstract class FileManagedUnitTestBase extends KernelTestBase {
}
/**
* Create a file and save it to the files table and assert that it occurs
* correctly.
* Creates and saves a file, asserting that it was saved.
*
* @param string $filepath
* Optional string specifying the file path. If none is provided then a

View File

@ -83,9 +83,10 @@ class FilterAPITest extends EntityKernelTestBase {
}
/**
* Tests the following functions for a variety of formats:
* - \Drupal\filter\Entity\FilterFormatInterface::getHtmlRestrictions()
* - \Drupal\filter\Entity\FilterFormatInterface::getFilterTypes()
* Tests that HTML restrictions and filter types are correct.
*
* @covers \Drupal\filter\Entity\FilterFormat::getHtmlRestrictions
* @covers \Drupal\filter\Entity\FilterFormat::getFilterTypes
*/
public function testFilterFormatAPI() {
// Test on filtered_html.

View File

@ -420,8 +420,7 @@ class JsonApiDocumentTopLevelNormalizerTest extends JsonapiKernelTestBase {
}
/**
* Test the message and exceptions thrown when we are requesting additional
* field values for Label only resource.
* Tests the message and exceptions when requesting a Label only resource.
*/
public function testAliasFieldRouteException() {
$this->assertSame('uid', $this->resourceTypeRepository->getByTypeName('node--article')->getPublicName('uid'));

View File

@ -114,8 +114,7 @@ class ResourceTypeRepositoryTest extends JsonapiKernelTestBase {
}
/**
* Ensures that a naming conflict in the mapping causes an exception to be
* thrown.
* Ensures that a naming conflict in mapping causes an exception to be thrown.
*
* @covers ::getFields
* @dataProvider getFieldsProvider

View File

@ -20,8 +20,7 @@ class LanguageBrowserDetectionTest extends BrowserTestBase {
protected $defaultTheme = 'stark';
/**
* Tests for adding, editing and deleting mappings between browser language
* codes and Drupal language codes.
* Tests mappings between browser language codes and Drupal language codes.
*/
public function testUIBrowserLanguageMappings() {
// User to manage languages.

View File

@ -16,8 +16,7 @@ use Symfony\Component\Validator\Context\ExecutionContextInterface;
class LinkAccessConstraintValidatorTest extends UnitTestCase {
/**
* Tests the \Drupal\link\Plugin\Validation\Constraint\LinkAccessConstraintValidator::validate()
* method.
* Tests the access validation constraint for links.
*
* @param \Drupal\link\LinkItemInterface $value
* The link item.

View File

@ -157,8 +157,7 @@ EOF;
}
/**
* Helper function that returns a .po file which strings will be marked
* as customized.
* Returns a .po file that will be marked as customized.
*/
public function getCustomPoFile() {
return <<< EOF

View File

@ -505,8 +505,7 @@ EOF;
}
/**
* Helper function that returns a .po file which strings will be marked
* as customized.
* Returns a .po file that will be marked as customized.
*/
public function getCustomPoFile() {
return <<< EOF

View File

@ -48,8 +48,7 @@ class LocalePluralFormatTest extends BrowserTestBase {
}
/**
* Tests locale_get_plural() and \Drupal::translation()->formatPlural()
* functionality.
* Tests locale_get_plural() and \Drupal::translation()->formatPlural().
*/
public function testGetPluralFormat() {
// Import some .po files with formulas to set up the environment.

View File

@ -244,8 +244,7 @@ class LocaleTranslationUiTest extends BrowserTestBase {
}
/**
* Adds a language and checks that the JavaScript translation files are
* properly created and rebuilt on deletion.
* Tests the rebuilding of JavaScript translation files on deletion.
*/
public function testJavaScriptTranslation() {
$user = $this->drupalCreateUser([

View File

@ -209,8 +209,7 @@ EOF;
}
/**
* Setup existing translations in the database and set up the status of
* existing translations.
* Sets up existing translations and their statuses in the database.
*/
protected function setCurrentTranslations() {
// Add non customized translations to the database.

View File

@ -328,8 +328,12 @@ abstract class MediaResourceTestBase extends EntityResourceTestBase {
}
/**
* This duplicates some of the 'file_upload' REST resource plugin test
* coverage, to be able to test it on a concrete use case.
* Tests the 'file_upload' REST resource plugin.
*
* This test duplicates some of the 'file_upload' REST resource plugin test
* coverage.
*
* @see \Drupal\Tests\rest\Functional\FileUploadResourceTestBase
*/
protected function uploadFile() {
// Enable the 'file_upload' REST resource for the current format + auth.

View File

@ -58,8 +58,7 @@ class UrlResolverTest extends MediaFunctionalTestBase {
}
/**
* Tests resource URL resolution when the asset URL can be matched to a
* provider endpoint.
* Tests resource URL resolution with a matched provider endpoint.
*
* @covers ::getProviderByUrl
* @covers ::getResourceUrl
@ -118,8 +117,7 @@ class UrlResolverTest extends MediaFunctionalTestBase {
}
/**
* Tests URL resolution when the resource URL must be actively discovered by
* scanning the asset.
* Tests URL resolution when the URL is discovered by scanning the asset.
*
* @param string $url
* The asset URL to resolve.

View File

@ -144,8 +144,7 @@ class MediaEmbedFilterConfigurationUiTest extends MediaJavascriptTestBase {
}
/**
* Data provider for testValidationWhenAdding() and
* testValidationWhenEditing().
* Data provider for testing validation when adding and editing media embeds.
*/
public function providerTestValidations() {
return [

View File

@ -39,10 +39,11 @@ trait OEmbedTestTrait {
}
/**
* Configures the http_client service so that all requests are carried out
* relative to the URL of the fixtures directory. For example, after calling
* this method, a request for foobar.html will actually request
* http://test-site/path/to/fuxtures/foobar.html.
* Configures the HTTP client to always use the fixtures directory.
*
* All requests are carried out relative to the URL of the fixtures directory.
* For example, after calling this method, a request for foobar.html will
* actually request http://test-site/path/to/fixtures/foobar.html.
*/
protected function lockHttpClientToFixtures() {
$this->writeSettings([
@ -62,9 +63,10 @@ trait OEmbedTestTrait {
}
/**
* Ensures that all oEmbed provider endpoints defined in the fixture
* providers.json will use the media_test_oembed.resource.get route as their
* URL.
* Ensures that oEmbed provider endpoints use the test resource route.
*
* All oEmbed provider endpoints defined in the fixture providers.json will
* use the media_test_oembed.resource.get route as their URL.
*
* This requires the media_test_oembed module in order to work.
*/

View File

@ -421,8 +421,7 @@ class MigrateSourceTest extends MigrateTestCase {
}
/**
* Tests that cacheCounts, skipCount, trackChanges preserve their default
* values.
* Tests that default values are preserved for several source methods.
*/
public function testDefaultPropertiesValues() {
$this->migrationConfiguration['id'] = 'test_migration';

View File

@ -89,8 +89,7 @@ class ExplodeTest extends MigrateProcessTestCase {
}
/**
* Tests that explode raises an exception when the value cannot be casted to
* string.
* Tests Explode exception handling when string-cast fails.
*/
public function testExplodeWithNonStrictAndNonCastable() {
$plugin = new Explode(['delimiter' => '|', 'strict' => FALSE], 'map', []);
@ -101,8 +100,7 @@ class ExplodeTest extends MigrateProcessTestCase {
}
/**
* Tests that explode with an empty string and strict check returns a
* non-empty array.
* Tests Explode return values with an empty string and strict check.
*/
public function testExplodeWithStrictAndEmptyString() {
$plugin = new Explode(['delimiter' => '|'], 'map', []);

View File

@ -113,8 +113,9 @@ class GetTest extends MigrateProcessTestCase {
}
/**
* Tests the Get plugin for syntax errors, e.g. "Invalid tag_line detected" by
* creating a prophecy of the class.
* Tests the Get plugin for syntax errors by creating a prophecy of the class.
*
* An example of a syntax error is "Invalid tag_line detected".
*/
public function testPluginSyntax() {
$this->assertNotNull($this->prophesize(Get::class));

View File

@ -10,7 +10,7 @@ use Drupal\migrate\Row;
trait StubTestTrait {
/**
* Tests that a stub of the given entity type results in a valid entity.
* Tests that creating a stub of an entity type results in a valid entity.
*
* @param string $entity_type_id
* The entity type we are stubbing.

View File

@ -57,8 +57,9 @@ class EntityContentBaseTest extends MigrateDrupal6TestBase {
}
/**
* Tests overwriting all mapped properties in the destination entity (default
* behavior).
* Tests overwriting all mapped properties in the destination entity.
*
* This is the default behavior.
*/
public function testOverwriteAllMappedProperties() {
$this->executeMigration('d6_user');
@ -70,8 +71,9 @@ class EntityContentBaseTest extends MigrateDrupal6TestBase {
}
/**
* Tests overwriting selected properties in the destination entity, specified
* in the destination configuration.
* Tests overwriting selected properties in the destination entity.
*
* The selected properties are specified in the destination configuration.
*/
public function testOverwriteProperties() {
// Execute the migration in migrate_overwrite_test, which documents how

View File

@ -117,8 +117,9 @@ class PageCacheTest extends BrowserTestBase {
}
/**
* Tests support for different cache items with different request formats
* specified via a query parameter.
* Tests support for different cache items with different request formats.
*
* The request formats are specified via a query parameter.
*/
public function testQueryParameterFormatRequests() {
$config = $this->config('system.performance');

View File

@ -87,8 +87,6 @@ abstract class EntityResourceTestBase extends ResourceTestBase {
protected static $patchProtectedFieldNames;
/**
* The unique field names.
*
* The fields that need a different (random) value for each new entity created
* by a POST request.
*
@ -97,8 +95,6 @@ abstract class EntityResourceTestBase extends ResourceTestBase {
protected static $uniqueFieldNames = [];
/**
* The field name for the label.
*
* Optionally specify which field is the 'label' field. Some entities do not
* specify a 'label' entity key. For example: User.
*

View File

@ -190,8 +190,9 @@ class EntitySerializationTest extends NormalizerTestBase {
}
/**
* Tests user normalization, using the entity_serialization_test module to
* override some default access controls.
* Tests user normalization with some default access controls overridden.
*
* @see entity_serialization_test.module
*/
public function testUserNormalize() {
// Test password isn't available.

View File

@ -403,8 +403,7 @@ class ShortcutLinksTest extends ShortcutTestBase {
}
/**
* Tests that the 'access shortcuts' permission is required for shortcut set
* administration page access.
* Tests the 'access shortcuts' permission for shortcut set administration.
*/
private function verifyAccessShortcutsPermissionForEditPages() {
// Create a user with customize links and switch sets permissions but
@ -427,8 +426,7 @@ class ShortcutLinksTest extends ShortcutTestBase {
}
/**
* Tests that the 'access shortcuts' permission is required to access the
* shortcut block.
* Tests the 'access shortcuts' permission with the shortcut block.
*/
public function testShortcutBlockAccess() {
// Creates a block instance and place in a region through api.

View File

@ -89,8 +89,7 @@ class SessionTestController extends ControllerBase {
}
/**
* Turns off session saving and then tries to save a value
* anyway.
* Turns off session saving and then tries to save a value anyway.
*
* @param string $test_value
* A session value.

View File

@ -11,11 +11,11 @@
function update_test_description_update_8001() {
}
// @codingStandardsIgnoreStart
// phpcs:disable Drupal.Commenting.DocComment.ShortSingleLine
/**
* Update test with multiline description, the quick brown fox jumped over the
* lazy dog.
*/
// phpcs:enable
function update_test_description_update_8002() {
}
// @codingStandardsIgnoreEnd

View File

@ -200,8 +200,7 @@ trait EntityDefinitionTestTrait {
}
/**
* Updates the 'entity_test_update' entity type to revisionable and
* translatable.
* Updates the test entity type to be revisionable and translatable.
*
* @param bool $perform_update
* (optional) Whether the change should be performed by the entity

View File

@ -25,8 +25,13 @@ class ElementsLabelsTest extends BrowserTestBase {
protected $defaultTheme = 'stark';
/**
* Tests form elements, labels, title attributes and required marks output
* correctly and have the correct label option class if needed.
* Tests form element rendering.
*
* This method provides test coverage for:
* - Form label rendering with different form elements.
* - Rendering of the "Required" field marker.
* - Prefix and suffix render element placement.
* - Form element title attributes.
*/
public function testFormLabels() {
$this->drupalGet('form_test/form-labels');

View File

@ -150,8 +150,7 @@ class ElementsTableSelectTest extends BrowserTestBase {
}
/**
* Tests the whether the option checker gives an error on invalid
* tableselect values for checkboxes.
* Tests error handling for invalid tableselect values with checkboxes.
*/
public function testMultipleTrueOptionchecker() {
@ -174,8 +173,7 @@ class ElementsTableSelectTest extends BrowserTestBase {
}
/**
* Tests the whether the option checker gives an error on invalid
* tableselect values for radios.
* Tests error handling for invalid tableselect values with radio buttons.
*/
public function testMultipleFalseOptionchecker() {

View File

@ -146,8 +146,7 @@ class StorageTest extends BrowserTestBase {
}
/**
* Verifies that form build-id is regenerated when loading an immutable form
* from the cache.
* Tests form build ID regeneration when loading a cached immutable form.
*/
public function testImmutableForm() {
// Request the form with 'cache' query parameter to enable form caching.

View File

@ -207,8 +207,7 @@ class HtmlToTextTest extends BrowserTestBase {
}
/**
* Tests that text separated by block-level tags in HTML get separated by
* (at least) a newline in the plaintext version.
* Tests the conversion of block-level HTML tags to plaintext with newlines.
*/
public function testDrupalHtmlToTextBlockTagToNewline() {
$input = <<<'EOT'
@ -298,8 +297,7 @@ EOT;
}
/**
* Tests that combinations of paragraph breaks, line breaks, linefeeds,
* and spaces are properly handled.
* Tests the plaintext conversion of different whitespace combinations.
*/
public function testDrupalHtmlToTextParagraphs() {
$tests = [];

View File

@ -224,8 +224,10 @@ class MenuRouterTest extends BrowserTestBase {
}
/**
* Tests that an authenticated user hitting 'user/login' gets redirected to
* 'user' and 'user/register' gets redirected to the user edit page.
* Tests authenticated user login redirects.
*
* An authenticated user hitting 'user/login' should be redirected to 'user',
* and 'user/register' should be redirected to the user edit page.
*/
public function testAuthUserUserLogin() {
$web_user = $this->drupalCreateUser([]);
@ -267,8 +269,7 @@ class MenuRouterTest extends BrowserTestBase {
}
/**
* Tests the theme negotiation when it is set to use an administrative
* theme.
* Tests theme negotiation for an administrative theme.
*/
protected function doTestThemeCallbackAdministrative() {
$this->drupalGet('menu-test/theme-callback/use-admin-theme');

View File

@ -73,8 +73,7 @@ class DependencyTest extends ModuleTestBase {
}
/**
* Tests enabling a module that depends on an incompatible version of a
* module.
* Tests enabling a module with an incompatible dependency version.
*/
public function testIncompatibleModuleVersionDependency() {
// Test that the system_incompatible_module_version_dependencies_test is

View File

@ -82,8 +82,7 @@ class PagerTest extends BrowserTestBase {
}
/**
* Tests proper functioning of the query parameters and the pager cache
* context.
* Tests pager query parameters and cache context.
*/
public function testPagerQueryParametersAndCacheContext() {
// First page.

View File

@ -25,8 +25,11 @@ class SessionTest extends BrowserTestBase {
protected $defaultTheme = 'stark';
/**
* Tests for \Drupal\Core\Session\WriteSafeSessionHandler::setSessionWritable()
* ::isSessionWritable and \Drupal\Core\Session\SessionManager::regenerate().
* Tests session writing and regeneration.
*
* @covers \Drupal\Core\Session\WriteSafeSessionHandler::setSessionWritable
* @covers \Drupal\Core\Session\WriteSafeSessionHandler::isSessionWritable
* @covers \Drupal\Core\Session\SessionManager::regenerate
*/
public function testSessionSaveRegenerate() {
$session_handler = $this->container->get('session_handler.write_safe');

View File

@ -19,8 +19,9 @@ class FormElementsRenderTest extends KernelTestBase {
protected static $modules = ['common_test', 'system'];
/**
* Tests rendering form elements without passing through
* \Drupal::formBuilder()->doBuildForm().
* Tests rendering form elements without using doBuildForm().
*
* @see \Drupal\Core\Form\FormBuilderInterface::doBuildForm()
*/
public function testDrupalRenderFormElements() {
// Define a series of form elements.

View File

@ -89,8 +89,9 @@ class EntityReferenceSelectionReferenceableTest extends KernelTestBase {
}
/**
* Tests values returned by SelectionInterface::getReferenceableEntities()
* when the target entity type has no 'label' key.
* Tests referenceable entities with no target entity type 'label' key.
*
* @see \Drupal\Core\Entity\EntityReferenceSelection\SelectionInterface::getReferenceableEntities()
*
* @param mixed $match
* The input text to be checked.

View File

@ -57,8 +57,7 @@ class ProgrammaticTest extends KernelTestBase {
}
/**
* Helper function used to programmatically submit the form defined in
* form_test.module with the given values.
* Programmatically submits the form_test.module form with the given values.
*
* @param $values
* An array of field values to be submitted.

View File

@ -49,8 +49,7 @@ class MigrateTermNodeTest extends MigrateDrupal6TestBase {
}
/**
* Tests that term associations are ignored when they belong to nodes which
* were not migrated.
* Tests that term relationships are ignored for un-migrated nodes.
*/
public function testSkipNonExistentNode() {
// Node 2 is migrated by d6_node__story, but we need to pretend that it

View File

@ -40,9 +40,7 @@ class TextSummaryTest extends KernelTestBase {
}
/**
* Tests an edge case where the first sentence is a question and
* subsequent sentences are not. This edge case is documented at
* https://www.drupal.org/node/180425.
* Tests text summaries for a question followed by a sentence.
*/
public function testFirstSentenceQuestion() {
$text = 'A question? A sentence. Another sentence.';
@ -231,8 +229,9 @@ class TextSummaryTest extends KernelTestBase {
}
/**
* Tests text_summary() returns an empty string without any error when
* called with an invalid format.
* Tests text summaries with an invalid filter format.
*
* @see text_summary()
*/
public function testInvalidFilterFormat() {

View File

@ -114,8 +114,10 @@ class ToolbarAdminMenuTest extends BrowserTestBase {
}
/**
* Tests the toolbar_modules_installed() and toolbar_modules_uninstalled() hook
* implementations.
* Tests Toolbar's responses to installing and uninstalling modules.
*
* @see toolbar_modules_installed()
* @see toolbar_modules_uninstalled()
*/
public function testModuleStatusChangeSubtreesHashCacheClear() {
// Use an admin role to ensure the user has all available permissions. This
@ -174,8 +176,10 @@ class ToolbarAdminMenuTest extends BrowserTestBase {
}
/**
* Exercises the toolbar_user_role_update() and toolbar_user_update() hook
* implementations.
* Tests Toolbar's responses to user data updates.
*
* @see toolbar_user_role_update()
* @see toolbar_user_update()
*/
public function testUserRoleUpdateSubtreesHashCacheClear() {
// Find the new role ID.
@ -240,8 +244,7 @@ class ToolbarAdminMenuTest extends BrowserTestBase {
}
/**
* Tests that changes to a user account by another user clears the changed
* account's toolbar cached, not the user's who took the action.
* Tests cache invalidation when one user modifies another user.
*/
public function testNonCurrentUserAccountUpdates() {
$admin_user_id = $this->adminUser->id();
@ -454,8 +457,10 @@ class ToolbarAdminMenuTest extends BrowserTestBase {
}
/**
* Asserts the subtrees hash on a fresh page GET is different from the hash
* from the previous page GET.
* Checks the subtree hash of the current page with that of the previous page.
*
* Asserts that the subtrees hash on a fresh page GET is different from the
* subtree hash from the previous page GET.
*
* @internal
*/

View File

@ -11,8 +11,7 @@ use Drupal\Tests\BrowserTestBase;
abstract class TourTestBase extends BrowserTestBase {
/**
* Assert function to determine if tips rendered to the page
* have a corresponding page element.
* Asserts the presence of page elements for tour tips.
*
* @code
* // Basic example.

View File

@ -31,8 +31,7 @@ class UserCreateTest extends BrowserTestBase {
protected $defaultTheme = 'stark';
/**
* Create a user through the administration interface and ensure that it
* displays in the user list.
* Tests user creation and display from the administration interface.
*/
public function testUserAdd() {
$user = $this->drupalCreateUser(['administer users']);

View File

@ -29,8 +29,7 @@ class UserRolesAssignmentTest extends BrowserTestBase {
protected $defaultTheme = 'stark';
/**
* Tests that a user can be assigned a role and that the role can be removed
* again.
* Test that user can be assigned role and that the role can be removed again.
*/
public function testAssignAndRemoveRole() {
$rid = $this->drupalCreateRole(['administer users']);
@ -52,8 +51,7 @@ class UserRolesAssignmentTest extends BrowserTestBase {
}
/**
* Tests that when creating a user the role can be assigned. And that it can
* be removed again.
* Tests assigning a role at user creation and removing the role.
*/
public function testCreateUserWithRole() {
$rid = $this->drupalCreateRole(['administer users']);

View File

@ -55,7 +55,9 @@ class UserFieldsAccessChangeTest extends UserTestBase {
}
/**
* Tests the user name formatter shows a link to the user when there is
* Test user name link.
*
* Tests that the user name formatter shows a link to the user when there is
* access but not otherwise.
*/
public function testUserNameLink() {

View File

@ -46,8 +46,7 @@ class MigrateUserRoleTest extends MigrateDrupal6TestBase {
}
/**
* Helper function to test the migration of the user roles. The user roles
* will be re-imported and the tests here will be repeated.
* Helper to assert the user roles.
*
* @param \Drupal\migrate\Plugin\MigrateIdMapInterface $id_map
* The map table plugin.

View File

@ -153,8 +153,7 @@ class FilterTest extends ViewTestBase {
}
/**
* Tests no error message is displayed when all options are selected in an
* exposed filter.
* Tests an exposed filter when all options are selected.
*/
public function testInOperatorSelectAllOptions() {
$row['row[type]'] = 'fields';

View File

@ -73,8 +73,7 @@ class ViewElementTest extends ViewTestBase {
}
/**
* Tests the rendered output and form output of a view element, using the
* embed display plugin.
* Tests the rendered output and form output of the "embed" display plugin.
*/
public function testViewElementEmbed() {
$view = Views::getView('test_view_embed');

View File

@ -45,8 +45,7 @@ class ViewsThemeIntegrationTest extends ViewTestBase {
}
/**
* Tests for exceptions and successful execution of hook_views_pre_render()
* and hook_views_post_render() in theme and subtheme.
* Tests pre_render and post_render hooks in a theme and sub-theme.
*/
public function testThemedViewPage() {

View File

@ -245,8 +245,7 @@ class FilterCombineTest extends ViewsKernelTestBase {
}
/**
* Tests that the combine field filter is not valid on displays that don't use
* fields.
* Tests that the "combine" filter is only valid on displays that use fields.
*/
public function testNonFieldsRow() {
$view = Views::getView('entity_test_fields');

View File

@ -275,8 +275,9 @@ class FilterNumericTest extends ViewsKernelTestBase {
}
/**
* Tests the numeric filter handler with the 'regular_expression' operator
* to grouped exposed filters.
* Tests the "numeric" filter with grouped exposed filters.
*
* The tests are performed with the 'regular_expression' operator.
*/
public function testFilterNumericExposedGroupedRegularExpression() {
$filters = $this->getGroupedExposedFilters();

View File

@ -70,8 +70,7 @@ class ViewElementTest extends ViewsKernelTestBase {
}
/**
* Tests the rendered output and form output of a view element, using the
* embed display plugin.
* Tests the rendered output and form output of the "embed" display plugin.
*/
public function testViewElementEmbed() {
/** @var \Drupal\Core\Render\RendererInterface $renderer */

View File

@ -278,6 +278,8 @@ class PagerPluginBaseTest extends UnitTestCase {
}
/**
* Creates StatementInterface for testing.
*
* As StatementInterface extends \Traversable, which though always needs
* an additional interface. The Statement class itself can't be mocked because
* of its __wakeup function.

View File

@ -45,8 +45,7 @@ class ArgumentValidatorTest extends UITestBase {
}
/**
* Saves the test_argument view with changes made to the argument handler
* both with and without specify_validation turned on.
* Saves the test_argument view with changes made to the argument handler.
*
* @param bool $specify_validation
* The form validation.

View File

@ -91,8 +91,7 @@ class DemoUmamiProfileTest extends BrowserTestBase {
}
/**
* Tests that the users can log in with the admin password selected at
* install.
* Tests that the users can log in with the admin password entered at install.
*/
public function testUser() {
$password = $this->rootUser->pass_raw;

View File

@ -159,8 +159,7 @@ JS;
}
/**
* Waits for a button (input[type=submit|image|button|reset], button) with
* specified locator and returns it.
* Waits for the button specified by the locator and returns it.
*
* @param string $locator
* The button ID, value or alt string.

View File

@ -15,8 +15,7 @@ class InstallerExistingInstallationTest extends InstallerTestBase {
protected $defaultTheme = 'stark';
/**
* Verifies that Drupal can't be reinstalled while an existing installation is
* available.
* Tests that Drupal fails to install when there is an existing installation.
*/
public function testInstaller() {
// Verify that Drupal can't be immediately reinstalled.

View File

@ -488,8 +488,7 @@ trait AssertContentTrait {
}
/**
* Passes if the raw text IS NOT found escaped on the loaded page, fail
* otherwise.
* Passes if raw text IS NOT found escaped on loaded page, fail otherwise.
*
* Raw text refers to the raw HTML that the page generated.
*

View File

@ -439,8 +439,18 @@ abstract class GenericCacheBackendUnitTestBase extends KernelTestBase {
}
/**
* Tests Drupal\Core\Cache\CacheBackendInterface::delete() and
* Drupal\Core\Cache\CacheBackendInterface::deleteMultiple().
* @covers \Drupal\Core\Cache\ApcuBackend::deleteMultiple
* @covers \Drupal\Core\Cache\BackendChain::deleteMultiple
* @covers \Drupal\Core\Cache\ChainedFastBackend::deleteMultiple
* @covers \Drupal\Core\Cache\DatabaseBackend::deleteMultiple
* @covers \Drupal\Core\Cache\MemoryBackend::deleteMultiple
* @covers \Drupal\Core\Cache\PhpBackend::deleteMultiple
* @covers \Drupal\Core\Cache\ApcuBackend::deleteMultiple
* @covers \Drupal\Core\Cache\BackendChain::deleteMultiple
* @covers \Drupal\Core\Cache\ChainedFastBackend::deleteMultiple
* @covers \Drupal\Core\Cache\DatabaseBackend::deleteMultiple
* @covers \Drupal\Core\Cache\MemoryBackend::deleteMultiple
* @covers \Drupal\Core\Cache\PhpBackend::deleteMultiple
*/
public function testDeleteMultiple() {
$backend = $this->getCacheBackend();
@ -506,8 +516,18 @@ abstract class GenericCacheBackendUnitTestBase extends KernelTestBase {
}
/**
* Tests Drupal\Core\Cache\CacheBackendInterface::invalidate() and
* Drupal\Core\Cache\CacheBackendInterface::invalidateMultiple().
* @covers \Drupal\Core\Cache\ApcuBackend::getMultiple
* @covers \Drupal\Core\Cache\BackendChain::getMultiple
* @covers \Drupal\Core\Cache\ChainedFastBackend::getMultiple
* @covers \Drupal\Core\Cache\DatabaseBackend::getMultiple
* @covers \Drupal\Core\Cache\MemoryBackend::getMultiple
* @covers \Drupal\Core\Cache\PhpBackend::getMultiple
* @covers \Drupal\Core\Cache\ApcuBackend::invalidateMultiple
* @covers \Drupal\Core\Cache\BackendChain::invalidateMultiple
* @covers \Drupal\Core\Cache\ChainedFastBackend::invalidateMultiple
* @covers \Drupal\Core\Cache\DatabaseBackend::invalidateMultiple
* @covers \Drupal\Core\Cache\MemoryBackend::invalidateMultiple
* @covers \Drupal\Core\Cache\PhpBackend::invalidateMultiple
*/
public function testInvalidate() {
$backend = $this->getCacheBackend();

View File

@ -57,8 +57,7 @@ class ConfigImporterTest extends KernelTestBase {
}
/**
* Tests that trying to import from an empty sync configuration directory
* fails.
* Tests that trying to import from empty sync configuration directory fails.
*/
public function testEmptyImportFails() {
$this->expectException(ConfigImporterException::class);

View File

@ -227,8 +227,7 @@ class ConfigInstallTest extends KernelTestBase {
}
/**
* Tests imported configuration entities with and without language
* information.
* Tests imported configuration entities with/without language information.
*/
public function testLanguage() {
$this->installModules(['config_test_language']);

View File

@ -97,8 +97,7 @@ class SelectSubqueryTest extends DatabaseTestBase {
}
/**
* Tests that we can use a subquery with a relational operator in a WHERE
* clause.
* Tests we can use a subquery with a relational operator in a WHERE clause.
*/
public function testConditionSubquerySelect2() {
// Create a subquery, which is just a normal query object.
@ -119,8 +118,7 @@ class SelectSubqueryTest extends DatabaseTestBase {
}
/**
* Tests that we can use 2 subqueries with a relational operator in a WHERE
* clause.
* Tests we can use 2 subqueries with a relational operator in a WHERE clause.
*/
public function testConditionSubquerySelect3() {
// Create subquery 1, which is just a normal query object.

View File

@ -376,8 +376,7 @@ class EntityAutocompleteElementFormTest extends EntityKernelTestBase implements
}
/**
* Returns an entity label in the format needed by the EntityAutocomplete
* element.
* Returns an entity label in format needed by the EntityAutocomplete element.
*
* @param \Drupal\Core\Entity\EntityInterface $entity
* A Drupal entity.

View File

@ -593,8 +593,7 @@ class EntityFieldTest extends EntityKernelTestBase {
}
/**
* Recursive helper for getting all contained strings,
* i.e. properties of type string.
* Gets all contained strings recursively.
*/
public function getContainedStrings(TypedDataInterface $wrapper, $depth, array &$strings) {

View File

@ -1213,8 +1213,9 @@ class EntityQueryTest extends EntityKernelTestBase {
}
/**
* Tests against SQL inject of condition field. This covers a
* database driver's EntityQuery\Condition class.
* Tests SQL inject of condition field.
*
* This covers a database driver's EntityQuery\Condition class.
*/
public function testInjectionInCondition() {
$this->expectException(\Exception::class);

View File

@ -827,8 +827,7 @@ class EntityTranslationTest extends EntityLanguageTestBase {
}
/**
* Tests if entity translation statuses are correct after removing two
* translation.
* Tests that translation statuses are correct after removing translations.
*/
public function testDeleteEntityTranslation() {
$entity_type = 'entity_test_mul';

View File

@ -64,8 +64,7 @@ class ModuleImplementsAlterTest extends KernelTestBase {
}
/**
* Tests what happens if hook_module_implements_alter() adds a non-existing
* function to the implementations.
* Tests adding a non-existing function to hook_module_implements_alter().
*
* @see \Drupal\Core\Extension\ModuleHandler::buildImplementationInfo()
* @see module_test_module_implements_alter()

View File

@ -113,8 +113,7 @@ class DirectoryTest extends FileTestBase {
}
/**
* This will take a directory and path, and find a valid filepath that is not
* taken by another file.
* Tests the file paths of newly created files.
*/
public function testFileCreateNewFilepath() {
// First we test against an imaginary file that does not exist in a
@ -138,6 +137,8 @@ class DirectoryTest extends FileTestBase {
}
/**
* Tests the destination file path.
*
* This will test the filepath for a destination based on passed flags and
* whether or not the file exists.
*

View File

@ -153,8 +153,7 @@ class ScanDirectoryTest extends FileTestBase {
}
/**
* Check that the min_depth options lets us ignore files in the starting
* directory.
* Tests the min_depth option of scanDirectory().
*
* @covers ::scanDirectory
*/

View File

@ -63,8 +63,10 @@ class TableTest extends KernelTestBase {
}
/**
* Tests that the table header is printed correctly even if there are no rows,
* and that the empty text is displayed correctly.
* Tests the display of the table header.
*
* Tests are performed when the there are no rows and that the empty text is
* displayed correctly.
*/
public function testThemeTableWithEmptyMessage() {
$header = [

View File

@ -320,9 +320,11 @@ abstract class BrowserTestBase extends TestCase {
}
/**
* Get the Mink driver args from an environment variable, if it is set. Can
* be overridden in a derived class so it is possible to use a different
* value for a subset of tests, e.g. the JavaScript tests.
* Gets the Mink driver args from an environment variable.
*
* The environment variable can be overridden in a derived class so it is
* possible to use a different value for a subset of tests, e.g. the
* JavaScript tests.
*
* @return string|false
* The JSON-encoded argument string. False if it is not set.

View File

@ -182,8 +182,7 @@ class DateTimePlusTest extends TestCase {
}
/**
* Assertion helper for testTimestamp and testDateTimestamp since they need
* different dataProviders.
* Asserts a DateTimePlus value.
*
* @param \Drupal\Component\Datetime\DateTimePlus $date
* DateTimePlus to test.
@ -291,7 +290,9 @@ class DateTimePlusTest extends TestCase {
}
/**
* Tests DrupalDateTime with a datetime object.
* Tests that DrupalDateTime can detect the correct timezone to use.
*
* But only when the DrupalDateTime is constructed from a datetime object.
*/
public function testDateTimezoneWithDateTimeObject() {
// Create a date object with another date object.

View File

@ -89,8 +89,7 @@ class ContainerTest extends TestCase {
}
/**
* Tests that Container::getParameter() works properly for non-existing
* parameters.
* Tests that Container::getParameter() works for non-existing parameters.
*
* @covers ::getParameter
* @covers ::getParameterAlternatives

View File

@ -725,6 +725,8 @@ namespace Drupal\Tests\Component\DependencyInjection\Dumper {
}
/**
* Defines a dummy ExpressionLanguage component.
*
* As Drupal Core does not ship with ExpressionLanguage component we need to
* define a dummy, else it cannot be tested.
*/

View File

@ -195,8 +195,7 @@ class BackendChainImplementationUnitTest extends UnitTestCase {
}
/**
* Tests that the delete all operation is propagated to all backends in the
* chain.
* Tests that the delete all operation is propagated to all chained backends.
*/
public function testDeleteAllPropagation() {
// Set both expiring and permanent keys.
@ -213,8 +212,7 @@ class BackendChainImplementationUnitTest extends UnitTestCase {
}
/**
* Tests that the delete tags operation is propagated to all backends
* in the chain.
* Tests that the delete tags operation is propagated to all chained backends.
*/
public function testDeleteTagsPropagation() {
// Create two cache entries with the same tag and tag value.

View File

@ -49,6 +49,8 @@ class ConfigEntityTypeTest extends UnitTestCase {
}
/**
* Tests when the prefix length exceeds the maximum defined prefix length.
*
* Tests that we get an exception when the length of the config prefix that is
* returned by getConfigPrefix() exceeds the maximum defined prefix length.
*
@ -68,6 +70,8 @@ class ConfigEntityTypeTest extends UnitTestCase {
}
/**
* Tests when the prefix length is valid.
*
* Tests that a valid config prefix returned by getConfigPrefix()
* does not throw an exception and is formatted as expected.
*

View File

@ -419,11 +419,11 @@ class DateTest extends UnitTestCase {
}
/**
* Creates a UNIX timestamp given a date and time string in the format
* year-month-day hour:minute:seconds (e.g. 2013-12-11 10:09:08).
* Creates a UNIX timestamp given a date and time string.
*
* @param string $dateTimeString
* The formatted date and time string.
* The formatted date and time string. The format is year-month-day
* hour:minute:seconds (e.g. 2013-12-11 10:09:08).
*
* @return int
* The UNIX timestamp.

View File

@ -401,8 +401,7 @@ class TaggedHandlersPassTest extends UnitTestCase {
}
/**
* Tests consumer method with priority and extra parameters in different
* order.
* Tests consumer method with varying order of priority and extra parameters.
*
* @covers ::process
*/

View File

@ -1460,8 +1460,7 @@ class SqlContentEntityStorageTest extends UnitTestCase {
}
/**
* Provides an entity with dummy implementations of static methods, because
* those cannot be mocked.
* Provides an entity with dummy implementations of static methods.
*/
abstract class SqlContentEntityStorageTestEntityInterface implements EntityInterface {

View File

@ -38,9 +38,10 @@ class PlaceholderGeneratorTest extends RendererTestBase {
}
/**
* Create an element with #lazy_builder callback. Between two renders, cache
* contexts nor tags sort change. Placeholder should generate same hash to not
* be rendered twice.
* Tests the creation of an element with a #lazy_builder callback.
*
* Between two renders neither the cache contexts nor tags sort should change.
* A placeholder should generate the same hash, so it is not rendered twice.
*
* @covers ::createPlaceholder
*/

View File

@ -978,9 +978,10 @@ class RendererPlaceholdersTest extends RendererTestBase {
}
/**
* Create an element with a child and subchild. Each element has the same
* #lazy_builder callback, but with different contexts. They don't modify
* markup, only attach additional drupalSettings.
* Tests the creation of an element with a child and a sub-child.
*
* Each element has the same #lazy_builder callback, but with different
* contexts. They don't modify markup, only attach additional drupalSettings.
*
* @covers ::render
* @covers ::doRender

View File

@ -175,8 +175,7 @@ class UrlGeneratorTest extends UnitTestCase {
}
/**
* Return value callback for the getAliasByPath() method on the mock alias
* manager.
* Return value callback for getAliasByPath() on the mock alias manager.
*
* Ensures that by default the call to getAliasByPath() will return the first
* argument that was passed in. We special-case the paths for which we wish it
@ -452,8 +451,7 @@ class UrlGeneratorTest extends UnitTestCase {
}
/**
* Tests that the 'scheme' route requirement is respected during URL
* generation.
* Tests the 'scheme' route requirement during URL generation.
*/
public function testUrlGenerationWithHttpsRequirement() {
$url = $this->generator->generate('test_4', [], TRUE);