Skip to content

Commit 8d85cff

Browse files
committed
Issue #3268833 by quietone, xjm, jungle, ravi.shankar, smustgrave, daffie, Spokje, DanielVeza: Fix method comments in tests for Drupal.Commenting.DocComment.ShortSingleLine
1 parent 1ad6990 commit 8d85cff

File tree

93 files changed

+234
-221
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+234
-221
lines changed

modules/block/tests/src/Unit/Plugin/migrate/process/BlockRegionTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ protected function transform(array $value, Row $row = NULL) {
4848
}
4949

5050
/**
51+
* Tests transforming a block with the same theme and an existing region.
52+
*
5153
* If the source and destination themes are identical, the region should only
5254
* be passed through if it actually exists in the destination theme.
5355
*
@@ -58,6 +60,8 @@ public function testTransformSameThemeRegionExists() {
5860
}
5961

6062
/**
63+
* Tests transforming a block with the same theme and a non-existent region.
64+
*
6165
* If the source and destination themes are identical, the region should be
6266
* changed to 'content' if it doesn't exist in the destination theme.
6367
*

modules/config_translation/tests/src/Functional/ConfigTranslationUiTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -648,8 +648,7 @@ public function testViewsTranslationUI() {
648648
}
649649

650650
/**
651-
* Tests the number of source elements for plural strings in config
652-
* translation forms.
651+
* Tests plural source elements in configuration translation forms.
653652
*/
654653
public function testPluralConfigStringsSourceElements() {
655654
$this->drupalLogin($this->adminUser);

modules/content_moderation/tests/src/Kernel/ContentModerationStateTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -548,8 +548,7 @@ public function testNonTranslatableEntityTypeModeration() {
548548
}
549549

550550
/**
551-
* Tests that a non-translatable entity type without a langcode can be
552-
* moderated.
551+
* Tests moderation of a non-translatable entity type with no langcode.
553552
*/
554553
public function testNonLangcodeEntityTypeModeration() {
555554
// Unset the langcode entity key for 'entity_test_rev'.

modules/dblog/tests/src/Functional/DbLogTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -407,8 +407,7 @@ public function verifySort($sort = 'asc', $order = 'Date') {
407407
}
408408

409409
/**
410-
* Tests the escaping of links in the operation row of a database log detail
411-
* page.
410+
* Tests link escaping in the operation row of a database log detail page.
412411
*/
413412
private function verifyLinkEscaping() {
414413
$link = Link::fromTextAndUrl('View', Url::fromRoute('entity.node.canonical', ['node' => 1]))->toString();

modules/field/tests/src/Functional/EntityReference/EntityReferenceAdminTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,8 +299,10 @@ public function testAvailableFormatters() {
299299
}
300300

301301
/**
302-
* Tests field settings for an entity reference field when the field has
303-
* multiple target bundles and is set to auto-create the target entity.
302+
* Tests field settings for an entity reference field.
303+
*
304+
* The tested entity reference field has multiple target bundles and is set
305+
* to auto-create the target entity.
304306
*/
305307
public function testMultipleTargetBundles() {
306308
/** @var \Drupal\taxonomy\Entity\Vocabulary[] $vocabularies */

modules/field/tests/src/Functional/EntityReference/EntityReferenceAutoCreateTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,7 @@ protected function setUp(): void {
103103
}
104104

105105
/**
106-
* Tests that the autocomplete input element appears and the creation of a new
107-
* entity.
106+
* Tests the autocomplete input element and entity auto-creation.
108107
*/
109108
public function testAutoCreate() {
110109
$this->drupalGet('node/add/' . $this->referencingType);
@@ -154,6 +153,8 @@ public function testAutoCreate() {
154153
}
155154

156155
/**
156+
* Tests multiple target bundles.
157+
*
157158
* Tests if an entity reference field having multiple target bundles is
158159
* storing the auto-created entity in the right destination.
159160
*/

modules/field/tests/src/Functional/TranslationWebTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,8 @@ public function testFieldFormTranslationRevisions() {
132132
}
133133

134134
/**
135+
* Tests translation revisions.
136+
*
135137
* Check if the field translation attached to the entity revision identified
136138
* by the passed arguments were correctly stored.
137139
*/

modules/field/tests/src/Kernel/BulkDeleteTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,8 @@ protected function setUp(): void {
155155
}
156156

157157
/**
158+
* Tests deleting fields.
159+
*
158160
* Verify that deleting a field leaves the field data items in the database
159161
* and that the appropriate Field API functions can operate on the deleted
160162
* data and field definition.
@@ -314,6 +316,8 @@ public function testPurgeWithDeletedAndActiveField() {
314316
}
315317

316318
/**
319+
* Tests purging fields.
320+
*
317321
* Verify that field data items and fields are purged when a field storage is
318322
* deleted.
319323
*/
@@ -373,6 +377,8 @@ public function testPurgeField() {
373377
}
374378

375379
/**
380+
* Tests purging field storages.
381+
*
376382
* Verify that field storages are preserved and purged correctly as multiple
377383
* fields are deleted and purged.
378384
*/

modules/field/tests/src/Kernel/EntityReference/EntityReferenceFormatterTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,9 @@ public function testLabelFormatter() {
409409
}
410410

411411
/**
412-
* Sets field values and returns a render array as built by
412+
* Sets field values and returns a render array.
413+
*
414+
* The render array structure is as built by
413415
* \Drupal\Core\Field\FieldItemListInterface::view().
414416
*
415417
* @param \Drupal\Core\Entity\EntityInterface[] $referenced_entities

modules/field/tests/src/Kernel/FieldImportDeleteUninstallTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,7 @@ public function testImportDeleteUninstall() {
109109
}
110110

111111
/**
112-
* Tests purging already deleted field storages and fields during a config
113-
* import.
112+
* Tests purging previously deleted fields and storages in config import.
114113
*/
115114
public function testImportAlreadyDeletedUninstall() {
116115
// Create a telephone field for validation.

modules/file/tests/src/Functional/FileManagedTestBase.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ protected function setUp() {
2929
}
3030

3131
/**
32-
* Assert that all of the specified hook_file_* hooks were called once, other
33-
* values result in failure.
32+
* Asserts that the specified file hooks were called only once.
3433
*
3534
* @param string[] $expected
3635
* An array of strings containing with the hook name; for example, 'load',
@@ -133,8 +132,7 @@ public function assertSameFile(FileInterface $file1, FileInterface $file2) {
133132
}
134133

135134
/**
136-
* Create a file and save it to the files table and assert that it occurs
137-
* correctly.
135+
* Creates and saves a file, asserting that it was saved.
138136
*
139137
* @param string $filepath
140138
* Optional string specifying the file path. If none is provided then a

modules/file/tests/src/Kernel/FileManagedUnitTestBase.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@ protected function setUp() {
4242
}
4343

4444
/**
45-
* Assert that all of the specified hook_file_* hooks were called once, other
46-
* values result in failure.
45+
* Asserts that the specified file hooks were called only once.
4746
*
4847
* @param array $expected
4948
* Array with string containing with the hook name, e.g. 'load', 'save',
@@ -146,8 +145,7 @@ public function assertSameFile(FileInterface $file1, FileInterface $file2) {
146145
}
147146

148147
/**
149-
* Create a file and save it to the files table and assert that it occurs
150-
* correctly.
148+
* Creates and saves a file, asserting that it was saved.
151149
*
152150
* @param string $filepath
153151
* Optional string specifying the file path. If none is provided then a

modules/filter/tests/src/Kernel/FilterAPITest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,10 @@ public function testCheckMarkupFilterSubset() {
8383
}
8484

8585
/**
86-
* Tests the following functions for a variety of formats:
87-
* - \Drupal\filter\Entity\FilterFormatInterface::getHtmlRestrictions()
88-
* - \Drupal\filter\Entity\FilterFormatInterface::getFilterTypes()
86+
* Tests that HTML restrictions and filter types are correct.
87+
*
88+
* @covers \Drupal\filter\Entity\FilterFormat::getHtmlRestrictions
89+
* @covers \Drupal\filter\Entity\FilterFormat::getFilterTypes
8990
*/
9091
public function testFilterFormatAPI() {
9192
// Test on filtered_html.

modules/jsonapi/tests/src/Kernel/Normalizer/JsonApiDocumentTopLevelNormalizerTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -420,8 +420,7 @@ public function testNormalizeException() {
420420
}
421421

422422
/**
423-
* Test the message and exceptions thrown when we are requesting additional
424-
* field values for Label only resource.
423+
* Tests the message and exceptions when requesting a Label only resource.
425424
*/
426425
public function testAliasFieldRouteException() {
427426
$this->assertSame('uid', $this->resourceTypeRepository->getByTypeName('node--article')->getPublicName('uid'));

modules/jsonapi/tests/src/Kernel/ResourceType/ResourceTypeRepositoryTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,7 @@ public function testCaching() {
114114
}
115115

116116
/**
117-
* Ensures that a naming conflict in the mapping causes an exception to be
118-
* thrown.
117+
* Ensures that a naming conflict in mapping causes an exception to be thrown.
119118
*
120119
* @covers ::getFields
121120
* @dataProvider getFieldsProvider

modules/language/tests/src/Functional/LanguageBrowserDetectionTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ class LanguageBrowserDetectionTest extends BrowserTestBase {
2020
protected $defaultTheme = 'stark';
2121

2222
/**
23-
* Tests for adding, editing and deleting mappings between browser language
24-
* codes and Drupal language codes.
23+
* Tests mappings between browser language codes and Drupal language codes.
2524
*/
2625
public function testUIBrowserLanguageMappings() {
2726
// User to manage languages.

modules/link/tests/src/Unit/Plugin/Validation/Constraint/LinkAccessConstraintValidatorTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616
class LinkAccessConstraintValidatorTest extends UnitTestCase {
1717

1818
/**
19-
* Tests the \Drupal\link\Plugin\Validation\Constraint\LinkAccessConstraintValidator::validate()
20-
* method.
19+
* Tests the access validation constraint for links.
2120
*
2221
* @param \Drupal\link\LinkItemInterface $value
2322
* The link item.

modules/locale/tests/src/Functional/LocaleExportTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,7 @@ public function getPoFile() {
157157
}
158158

159159
/**
160-
* Helper function that returns a .po file which strings will be marked
161-
* as customized.
160+
* Returns a .po file that will be marked as customized.
162161
*/
163162
public function getCustomPoFile() {
164163
return <<< EOF

modules/locale/tests/src/Functional/LocaleImportFunctionalTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -505,8 +505,7 @@ public function getOverwritePoFile() {
505505
}
506506

507507
/**
508-
* Helper function that returns a .po file which strings will be marked
509-
* as customized.
508+
* Returns a .po file that will be marked as customized.
510509
*/
511510
public function getCustomPoFile() {
512511
return <<< EOF

modules/locale/tests/src/Functional/LocalePluralFormatTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,7 @@ protected function setUp(): void {
4848
}
4949

5050
/**
51-
* Tests locale_get_plural() and \Drupal::translation()->formatPlural()
52-
* functionality.
51+
* Tests locale_get_plural() and \Drupal::translation()->formatPlural().
5352
*/
5453
public function testGetPluralFormat() {
5554
// Import some .po files with formulas to set up the environment.

modules/locale/tests/src/Functional/LocaleTranslationUiTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,7 @@ public function testStringTranslation() {
244244
}
245245

246246
/**
247-
* Adds a language and checks that the JavaScript translation files are
248-
* properly created and rebuilt on deletion.
247+
* Tests the rebuilding of JavaScript translation files on deletion.
249248
*/
250249
public function testJavaScriptTranslation() {
251250
$user = $this->drupalCreateUser([

modules/locale/tests/src/Functional/LocaleUpdateBase.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,7 @@ protected function setTranslationFiles() {
209209
}
210210

211211
/**
212-
* Setup existing translations in the database and set up the status of
213-
* existing translations.
212+
* Sets up existing translations and their statuses in the database.
214213
*/
215214
protected function setCurrentTranslations() {
216215
// Add non customized translations to the database.

modules/media/tests/src/Functional/Rest/MediaResourceTestBase.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,8 +328,12 @@ public function testPost() {
328328
}
329329

330330
/**
331-
* This duplicates some of the 'file_upload' REST resource plugin test
332-
* coverage, to be able to test it on a concrete use case.
331+
* Tests the 'file_upload' REST resource plugin.
332+
*
333+
* This test duplicates some of the 'file_upload' REST resource plugin test
334+
* coverage.
335+
*
336+
* @see \Drupal\Tests\rest\Functional\FileUploadResourceTestBase
333337
*/
334338
protected function uploadFile() {
335339
// Enable the 'file_upload' REST resource for the current format + auth.

modules/media/tests/src/Functional/UrlResolverTest.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,7 @@ public function providerEndpointMatching() {
5858
}
5959

6060
/**
61-
* Tests resource URL resolution when the asset URL can be matched to a
62-
* provider endpoint.
61+
* Tests resource URL resolution with a matched provider endpoint.
6362
*
6463
* @covers ::getProviderByUrl
6564
* @covers ::getResourceUrl
@@ -118,8 +117,7 @@ public function providerUrlDiscovery() {
118117
}
119118

120119
/**
121-
* Tests URL resolution when the resource URL must be actively discovered by
122-
* scanning the asset.
120+
* Tests URL resolution when the URL is discovered by scanning the asset.
123121
*
124122
* @param string $url
125123
* The asset URL to resolve.

modules/media/tests/src/FunctionalJavascript/MediaEmbedFilterConfigurationUiTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,7 @@ public function testValidationWhenEditing($filter_html_status, $filter_align_sta
144144
}
145145

146146
/**
147-
* Data provider for testValidationWhenAdding() and
148-
* testValidationWhenEditing().
147+
* Data provider for testing validation when adding and editing media embeds.
149148
*/
150149
public function providerTestValidations() {
151150
return [

modules/media/tests/src/Traits/OEmbedTestTrait.php

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,11 @@ protected function useFixtureProviders() {
3939
}
4040

4141
/**
42-
* Configures the http_client service so that all requests are carried out
43-
* relative to the URL of the fixtures directory. For example, after calling
44-
* this method, a request for foobar.html will actually request
45-
* http://test-site/path/to/fuxtures/foobar.html.
42+
* Configures the HTTP client to always use the fixtures directory.
43+
*
44+
* All requests are carried out relative to the URL of the fixtures directory.
45+
* For example, after calling this method, a request for foobar.html will
46+
* actually request http://test-site/path/to/fixtures/foobar.html.
4647
*/
4748
protected function lockHttpClientToFixtures() {
4849
$this->writeSettings([
@@ -62,9 +63,10 @@ protected function lockHttpClientToFixtures() {
6263
}
6364

6465
/**
65-
* Ensures that all oEmbed provider endpoints defined in the fixture
66-
* providers.json will use the media_test_oembed.resource.get route as their
67-
* URL.
66+
* Ensures that oEmbed provider endpoints use the test resource route.
67+
*
68+
* All oEmbed provider endpoints defined in the fixture providers.json will
69+
* use the media_test_oembed.resource.get route as their URL.
6870
*
6971
* This requires the media_test_oembed module in order to work.
7072
*/

modules/migrate/tests/src/Unit/MigrateSourceTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -421,8 +421,7 @@ public function testPrepareRowPrepareException() {
421421
}
422422

423423
/**
424-
* Tests that cacheCounts, skipCount, trackChanges preserve their default
425-
* values.
424+
* Tests that default values are preserved for several source methods.
426425
*/
427426
public function testDefaultPropertiesValues() {
428427
$this->migrationConfiguration['id'] = 'test_migration';

modules/migrate/tests/src/Unit/process/ExplodeTest.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,7 @@ public function providerExplodeWithNonStrictAndEmptySource() {
8989
}
9090

9191
/**
92-
* Tests that explode raises an exception when the value cannot be casted to
93-
* string.
92+
* Tests Explode exception handling when string-cast fails.
9493
*/
9594
public function testExplodeWithNonStrictAndNonCastable() {
9695
$plugin = new Explode(['delimiter' => '|', 'strict' => FALSE], 'map', []);
@@ -101,8 +100,7 @@ public function testExplodeWithNonStrictAndNonCastable() {
101100
}
102101

103102
/**
104-
* Tests that explode with an empty string and strict check returns a
105-
* non-empty array.
103+
* Tests Explode return values with an empty string and strict check.
106104
*/
107105
public function testExplodeWithStrictAndEmptyString() {
108106
$plugin = new Explode(['delimiter' => '|'], 'map', []);

modules/migrate/tests/src/Unit/process/GetTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,9 @@ public function integerValuesDataProvider() {
113113
}
114114

115115
/**
116-
* Tests the Get plugin for syntax errors, e.g. "Invalid tag_line detected" by
117-
* creating a prophecy of the class.
116+
* Tests the Get plugin for syntax errors by creating a prophecy of the class.
117+
*
118+
* An example of a syntax error is "Invalid tag_line detected".
118119
*/
119120
public function testPluginSyntax() {
120121
$this->assertNotNull($this->prophesize(Get::class));

0 commit comments

Comments
 (0)