From 729390194fbfde9a3fbd940c40a25eb0e85bc4f5 Mon Sep 17 00:00:00 2001 From: Dave Long <dave@longwaveconsulting.com> Date: Fri, 8 Mar 2024 13:55:43 +0000 Subject: [PATCH] Issue #3420742 by quietone, sakthi_dev, BramDriesen: Fix words in test string by changing the string --- core/misc/cspell/dictionary.txt | 18 --------- .../src/Functional/DateRangeFieldTest.php | 40 +++++++++---------- .../src/Unit/EditorXssFilter/StandardTest.php | 2 +- .../src/Kernel/TextFormatElementFormTest.php | 6 +-- .../JsonApiFunctionalMultilingualTest.php | 8 ++-- .../Functional/JsonApiPatchRegressionTest.php | 4 +- .../tests/src/Unit/JsonApiSpecTest.php | 6 +-- .../tests/src/Kernel/RequestHandlerTest.php | 4 +- .../ResourceResponseSubscriberTest.php | 2 +- .../src/Kernel/Block/SystemMenuBlockTest.php | 6 +-- .../text/tests/src/Kernel/TextSummaryTest.php | 14 +++---- .../Kernel/Handler/FilterInOperatorTest.php | 2 +- .../src/Functional/UnsavedPreviewTest.php | 4 +- .../Routing/CaseInsensitivePathTest.php | 2 +- .../Core/Menu/MenuLinkTreeTest.php | 6 +-- .../Tests/Component/Utility/HtmlTest.php | 2 +- .../Tests/Core/Command/GenerateThemeTest.php | 4 +- .../Tests/Core/Entity/EntityLinkTest.php | 16 ++++---- .../DefaultMenuLinkTreeManipulatorsTest.php | 12 +++--- .../Core/Menu/MenuTreeParametersTest.php | 8 ++-- .../Core/Plugin/DefaultPluginManagerTest.php | 6 +-- .../Core/Render/RendererBubblingTest.php | 4 +- 22 files changed, 79 insertions(+), 97 deletions(-) diff --git a/core/misc/cspell/dictionary.txt b/core/misc/cspell/dictionary.txt index f367186c6144..1a46815d4ab4 100644 --- a/core/misc/cspell/dictionary.txt +++ b/core/misc/cspell/dictionary.txt @@ -51,11 +51,9 @@ backlinks bakeware barbar barchart -barqux basefield basepath basetheme -bazbaz beatle bebebe beforeclose @@ -99,7 +97,6 @@ buytaert bytea cachetag cachetags -cafr callables callout camelid @@ -150,7 +147,6 @@ contentblock contextuals controlgroup conv -corge createrole createuser crema @@ -275,8 +271,6 @@ fodg fodp fods fodt -foobarbaz -foofoo formattable fouc fourcol @@ -321,13 +315,11 @@ imagetextalternative indexname inited inno -instaclick instantiator interactable interruptible introspectable invalidators -invalididentifier invokable isam isinstallable @@ -372,7 +364,6 @@ longblob longerthan longtext loquesea -lowline lrdd lstitle ltitle @@ -557,12 +548,9 @@ questionmark quicklinks quickstart quinlan -quux -quxqux qvalue qvalues qwer -qwerqwer ralouphie rasterizable rasterizes @@ -586,7 +574,6 @@ replyto resave resaved resaving -restplugin restrictor restripe restriped @@ -646,7 +633,6 @@ srcset ssess starterkit statuscode -stdclass stddev stickied stitle @@ -730,14 +716,11 @@ testsuites textareas textboxes textfields -textformat -textwithsummary themename themer themers themey theseer -theseparator threecol tids timegate @@ -803,7 +786,6 @@ uploaders uploadprogress upscaling urandom -userid userinfo userref vampirize diff --git a/core/modules/datetime_range/tests/src/Functional/DateRangeFieldTest.php b/core/modules/datetime_range/tests/src/Functional/DateRangeFieldTest.php index efe74f344aa3..f5de3a28ba1b 100644 --- a/core/modules/datetime_range/tests/src/Functional/DateRangeFieldTest.php +++ b/core/modules/datetime_range/tests/src/Functional/DateRangeFieldTest.php @@ -126,7 +126,7 @@ public function testDateRangeField() { 'label' => 'hidden', 'settings' => [ 'format_type' => 'long', - 'separator' => 'THESEPARATOR', + 'separator' => 'THE_SEPARATOR', ] + $this->defaultSettings, ]; @@ -147,7 +147,7 @@ public function testDateRangeField() { $output = $this->renderTestEntity($id); $this->assertStringContainsString($start_expected_markup, $output, "Formatted date field using long format displayed as $start_expected with $start_expected_iso attribute in $timezone."); $this->assertStringContainsString($end_expected_markup, $output, "Formatted date field using long format displayed as $end_expected with $end_expected_iso attribute in $timezone."); - $this->assertStringContainsString(' THESEPARATOR ', $output, 'Found proper separator'); + $this->assertStringContainsString(' THE_SEPARATOR ', $output, 'Found proper separator'); // Verify that hook_entity_prepare_view can add attributes. // @see entity_test_entity_prepare_view() @@ -210,7 +210,7 @@ public function testDateRangeField() { 'label' => 'hidden', 'settings' => [ 'format_type' => 'long', - 'separator' => 'THESEPARATOR', + 'separator' => 'THE_SEPARATOR', ] + $this->defaultSettings, ]; @@ -223,7 +223,7 @@ public function testDateRangeField() { $start_expected_markup = '<time datetime="' . $start_expected_iso . '">' . $start_expected . '</time>'; $output = $this->renderTestEntity($id); $this->assertStringContainsString($start_expected_markup, $output, "Formatted date field using long format displayed as $start_expected with $start_expected_iso attribute in $timezone."); - $this->assertStringNotContainsString(' THESEPARATOR ', $output, 'Separator not found on page in ' . $timezone); + $this->assertStringNotContainsString(' THE_SEPARATOR ', $output, 'Separator not found on page in ' . $timezone); // Verify that hook_entity_prepare_view can add attributes. // @see entity_test_entity_prepare_view() @@ -239,7 +239,7 @@ public function testDateRangeField() { $expected = $start_date->format(DateTimeItemInterface::DATE_STORAGE_FORMAT); $output = $this->renderTestEntity($id); $this->assertStringContainsString($expected, $output, "Formatted date field using plain format displayed as $expected in $timezone."); - $this->assertStringNotContainsString(' THESEPARATOR ', $output, 'Separator not found on page'); + $this->assertStringNotContainsString(' THE_SEPARATOR ', $output, 'Separator not found on page'); $this->displayOptions['type'] = 'daterange_custom'; $this->displayOptions['settings'] = ['date_format' => 'm/d/Y'] + $this->defaultSettings; @@ -249,7 +249,7 @@ public function testDateRangeField() { $expected = $start_date->format($this->displayOptions['settings']['date_format']); $output = $this->renderTestEntity($id); $this->assertStringContainsString($expected, $output, "Formatted date field using daterange_custom format displayed as $expected in $timezone."); - $this->assertStringNotContainsString(' THESEPARATOR ', $output, 'Separator not found on page'); + $this->assertStringNotContainsString(' THE_SEPARATOR ', $output, 'Separator not found on page'); } } @@ -309,7 +309,7 @@ public function testDatetimeRangeField() { // Verify that the default formatter works. $this->displayOptions['settings'] = [ 'format_type' => 'long', - 'separator' => 'THESEPARATOR', + 'separator' => 'THE_SEPARATOR', ] + $this->defaultSettings; $display_repository->getViewDisplay($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full') ->setComponent($field_name, $this->displayOptions) @@ -324,7 +324,7 @@ public function testDatetimeRangeField() { $output = $this->renderTestEntity($id); $this->assertStringContainsString($start_expected_markup, $output, "Formatted date field using long format displayed as $start_expected with $start_expected_iso attribute."); $this->assertStringContainsString($end_expected_markup, $output, "Formatted date field using long format displayed as $end_expected with $end_expected_iso attribute."); - $this->assertStringContainsString(' THESEPARATOR ', $output, 'Found proper separator'); + $this->assertStringContainsString(' THE_SEPARATOR ', $output, 'Found proper separator'); // Verify that hook_entity_prepare_view can add attributes. // @see entity_test_entity_prepare_view() @@ -389,7 +389,7 @@ public function testDatetimeRangeField() { 'label' => 'hidden', 'settings' => [ 'format_type' => 'long', - 'separator' => 'THESEPARATOR', + 'separator' => 'THE_SEPARATOR', ] + $this->defaultSettings, ]; @@ -402,7 +402,7 @@ public function testDatetimeRangeField() { $start_expected_markup = '<time datetime="' . $start_expected_iso . '">' . $start_expected . '</time>'; $output = $this->renderTestEntity($id); $this->assertStringContainsString($start_expected_markup, $output, "Formatted date field using long format displayed as $start_expected with $start_expected_iso attribute."); - $this->assertStringNotContainsString(' THESEPARATOR ', $output, 'Separator not found on page'); + $this->assertStringNotContainsString(' THE_SEPARATOR ', $output, 'Separator not found on page'); // Verify that hook_entity_prepare_view can add attributes. // @see entity_test_entity_prepare_view() @@ -418,7 +418,7 @@ public function testDatetimeRangeField() { $expected = $start_date->format(DateTimeItemInterface::DATETIME_STORAGE_FORMAT); $output = $this->renderTestEntity($id); $this->assertStringContainsString($expected, $output, "Formatted date field using plain format displayed as $expected."); - $this->assertStringNotContainsString(' THESEPARATOR ', $output, 'Separator not found on page'); + $this->assertStringNotContainsString(' THE_SEPARATOR ', $output, 'Separator not found on page'); $this->displayOptions['type'] = 'daterange_custom'; $this->displayOptions['settings'] = ['date_format' => 'm/d/Y g:i:s A'] + $this->defaultSettings; @@ -428,7 +428,7 @@ public function testDatetimeRangeField() { $expected = $start_date->format($this->displayOptions['settings']['date_format']); $output = $this->renderTestEntity($id); $this->assertStringContainsString($expected, $output, "Formatted date field using daterange_custom format displayed as $expected."); - $this->assertStringNotContainsString(' THESEPARATOR ', $output, 'Separator not found on page'); + $this->assertStringNotContainsString(' THE_SEPARATOR ', $output, 'Separator not found on page'); } /** @@ -482,7 +482,7 @@ public function testAlldayRangeField() { // Verify that the default formatter works. $this->displayOptions['settings'] = [ 'format_type' => 'long', - 'separator' => 'THESEPARATOR', + 'separator' => 'THE_SEPARATOR', ] + $this->defaultSettings; $display_repository->getViewDisplay($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full') ->setComponent($field_name, $this->displayOptions) @@ -497,7 +497,7 @@ public function testAlldayRangeField() { $output = $this->renderTestEntity($id); $this->assertStringContainsString($start_expected_markup, $output, "Formatted date field using long format displayed as $start_expected with $start_expected_iso attribute."); $this->assertStringContainsString($end_expected_markup, $output, "Formatted date field using long format displayed as $end_expected with $end_expected_iso attribute."); - $this->assertStringContainsString(' THESEPARATOR ', $output, 'Found proper separator'); + $this->assertStringContainsString(' THE_SEPARATOR ', $output, 'Found proper separator'); // Verify that hook_entity_prepare_view can add attributes. // @see entity_test_entity_prepare_view() @@ -561,7 +561,7 @@ public function testAlldayRangeField() { 'label' => 'hidden', 'settings' => [ 'format_type' => 'long', - 'separator' => 'THESEPARATOR', + 'separator' => 'THE_SEPARATOR', ] + $this->defaultSettings, ]; @@ -578,7 +578,7 @@ public function testAlldayRangeField() { $output = $this->renderTestEntity($id); $this->assertStringContainsString($start_expected_markup, $output, "Formatted date field using long format displayed as $start_expected with $start_expected_iso attribute."); $this->assertStringContainsString($end_expected_markup, $output, "Formatted date field using long format displayed as $end_expected with $end_expected_iso attribute."); - $this->assertStringContainsString(' THESEPARATOR ', $output, 'Found proper separator'); + $this->assertStringContainsString(' THE_SEPARATOR ', $output, 'Found proper separator'); // Verify that hook_entity_prepare_view can add attributes. // @see entity_test_entity_prepare_view() @@ -590,20 +590,20 @@ public function testAlldayRangeField() { ->getViewDisplay($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full') ->setComponent($field_name, $this->displayOptions) ->save(); - $expected = $start_date->format(DateTimeItemInterface::DATETIME_STORAGE_FORMAT) . ' THESEPARATOR ' . $end_date->format(DateTimeItemInterface::DATETIME_STORAGE_FORMAT); + $expected = $start_date->format(DateTimeItemInterface::DATETIME_STORAGE_FORMAT) . ' THE_SEPARATOR ' . $end_date->format(DateTimeItemInterface::DATETIME_STORAGE_FORMAT); $output = $this->renderTestEntity($id); $this->assertStringContainsString($expected, $output, "Formatted date field using plain format displayed as $expected."); - $this->assertStringContainsString(' THESEPARATOR ', $output, 'Found proper separator'); + $this->assertStringContainsString(' THE_SEPARATOR ', $output, 'Found proper separator'); $this->displayOptions['type'] = 'daterange_custom'; $this->displayOptions['settings']['date_format'] = 'm/d/Y'; $display_repository->getViewDisplay($this->field->getTargetEntityTypeId(), $this->field->getTargetBundle(), 'full') ->setComponent($field_name, $this->displayOptions) ->save(); - $expected = $start_date->format($this->displayOptions['settings']['date_format']) . ' THESEPARATOR ' . $end_date->format($this->displayOptions['settings']['date_format']); + $expected = $start_date->format($this->displayOptions['settings']['date_format']) . ' THE_SEPARATOR ' . $end_date->format($this->displayOptions['settings']['date_format']); $output = $this->renderTestEntity($id); $this->assertStringContainsString($expected, $output, "Formatted date field using daterange_custom format displayed as $expected."); - $this->assertStringContainsString(' THESEPARATOR ', $output, 'Found proper separator'); + $this->assertStringContainsString(' THE_SEPARATOR ', $output, 'Found proper separator'); } diff --git a/core/modules/editor/tests/src/Unit/EditorXssFilter/StandardTest.php b/core/modules/editor/tests/src/Unit/EditorXssFilter/StandardTest.php index c0d1d0f403ea..60ad4d94a1bb 100644 --- a/core/modules/editor/tests/src/Unit/EditorXssFilter/StandardTest.php +++ b/core/modules/editor/tests/src/Unit/EditorXssFilter/StandardTest.php @@ -493,7 +493,7 @@ public static function providerTestFilterXss() { // Cookie manipulation. // @see https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet#Cookie_manipulation - $data[] = ['<META HTTP-EQUIV="Set-Cookie" Content="USERID=<SCRIPT>alert(\'XSS\')</SCRIPT>">', '<META http-equiv="Set-Cookie">alert(\'XSS\')">']; + $data[] = ['<META HTTP-EQUIV="Set-Cookie" Content="UserID=<SCRIPT>alert(\'XSS\')</SCRIPT>">', '<META http-equiv="Set-Cookie">alert(\'XSS\')">']; // UTF-7 encoding. // @see https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet#UTF-7_encoding diff --git a/core/modules/filter/tests/src/Kernel/TextFormatElementFormTest.php b/core/modules/filter/tests/src/Kernel/TextFormatElementFormTest.php index ec19466d2409..2cf4137cc71f 100644 --- a/core/modules/filter/tests/src/Kernel/TextFormatElementFormTest.php +++ b/core/modules/filter/tests/src/Kernel/TextFormatElementFormTest.php @@ -87,8 +87,8 @@ public function getFormId() { * {@inheritdoc} */ public function buildForm(array $form, FormStateInterface $form_state) { - // A textformat field. - $form['textformat'] = [ + // A text_format field. + $form['text_format'] = [ '#type' => 'text_format', '#required' => TRUE, '#title' => 'Text', @@ -124,7 +124,7 @@ public function testTextFormatElement() { $form = $form_builder->getForm($this); $output = $this->render($form); $this->setRawContent($output); - $this->assertFieldByName('textformat[value]'); + $this->assertFieldByName('text_format[value]'); $this->assertRaw('<h4>Full HTML</h4>'); $this->assertRaw('<h4>Filtered HTML</h4>'); $this->assertRaw('<h4>Test format</h4>'); diff --git a/core/modules/jsonapi/tests/src/Functional/JsonApiFunctionalMultilingualTest.php b/core/modules/jsonapi/tests/src/Functional/JsonApiFunctionalMultilingualTest.php index b98159370f27..e305a74803f5 100644 --- a/core/modules/jsonapi/tests/src/Functional/JsonApiFunctionalMultilingualTest.php +++ b/core/modules/jsonapi/tests/src/Functional/JsonApiFunctionalMultilingualTest.php @@ -207,13 +207,13 @@ public function testPatchTranslationFallback() { // has a different title. $document = Json::decode($this->drupalGet('/jsonapi/node/article/' . $uuid)); $document_ca = Json::decode($this->drupalGet('/ca/jsonapi/node/article/' . $uuid)); - $document_cafr = Json::decode($this->drupalGet('/ca-fr/jsonapi/node/article/' . $uuid)); + $document_ca_fr = Json::decode($this->drupalGet('/ca-fr/jsonapi/node/article/' . $uuid)); $this->assertSame('en', $document['data']['attributes']['langcode']); $this->assertSame('ca', $document_ca['data']['attributes']['langcode']); - $this->assertSame('ca', $document_cafr['data']['attributes']['langcode']); + $this->assertSame('ca', $document_ca_fr['data']['attributes']['langcode']); $this->assertSame($node->getTitle(), $document['data']['attributes']['title']); $this->assertSame($node->getTitle() . ' (ca)', $document_ca['data']['attributes']['title']); - $this->assertSame($node->getTitle() . ' (ca)', $document_cafr['data']['attributes']['title']); + $this->assertSame($node->getTitle() . ' (ca)', $document_ca_fr['data']['attributes']['title']); // PATCH the 'ca-fr' translation. $this->grantPermissions(Role::load(RoleInterface::ANONYMOUS_ID), [ @@ -226,7 +226,7 @@ public function testPatchTranslationFallback() { 'type' => 'node--article', 'id' => $uuid, 'attributes' => [ - 'title' => $document_cafr['data']['attributes']['title'] . ' UPDATED', + 'title' => $document_ca_fr['data']['attributes']['title'] . ' UPDATED', ], ], ]); diff --git a/core/modules/jsonapi/tests/src/Functional/JsonApiPatchRegressionTest.php b/core/modules/jsonapi/tests/src/Functional/JsonApiPatchRegressionTest.php index 36943a45b152..8b3aa4a3b538 100644 --- a/core/modules/jsonapi/tests/src/Functional/JsonApiPatchRegressionTest.php +++ b/core/modules/jsonapi/tests/src/Functional/JsonApiPatchRegressionTest.php @@ -441,7 +441,7 @@ public function testPatchInvalidFieldPropertyFromIssue3127883() { // cSpell:disable-next-line 'sumary' => 'Boring old "Hello World".', // And finally, one that is completely absurd. - 'foobarbaz' => '<script>alert("HI!");</script>', + 'foobar' => '<script>alert("HI!");</script>', ], ], ], @@ -454,7 +454,7 @@ public function testPatchInvalidFieldPropertyFromIssue3127883() { $this->assertSame(422, $response->getStatusCode()); $this->assertNotNull($data); // cSpell:disable-next-line - $this->assertSame("The properties 'form', 'sumary', 'foobarbaz' do not exist on the 'body' field of type 'text_with_summary'. Writable properties are: 'value', 'format', 'summary'.", $data['errors'][0]['detail']); + $this->assertSame("The properties 'form', 'sumary', 'foobar' do not exist on the 'body' field of type 'text_with_summary'. Writable properties are: 'value', 'format', 'summary'.", $data['errors'][0]['detail']); $request_options = [ RequestOptions::HEADERS => [ diff --git a/core/modules/jsonapi/tests/src/Unit/JsonApiSpecTest.php b/core/modules/jsonapi/tests/src/Unit/JsonApiSpecTest.php index 96b8a99f2a8c..a761b5fb989b 100644 --- a/core/modules/jsonapi/tests/src/Unit/JsonApiSpecTest.php +++ b/core/modules/jsonapi/tests/src/Unit/JsonApiSpecTest.php @@ -40,9 +40,9 @@ public static function providerTestIsValidMemberName() { $data['hyphen-start'] = ['-kittens', FALSE]; $data['hyphen-middle'] = ['kitt-ens', TRUE]; $data['hyphen-end'] = ['kittens-', FALSE]; - $data['lowline-start'] = ['_kittens', FALSE]; - $data['lowline-middle'] = ['kitt_ens', TRUE]; - $data['lowline-end'] = ['kittens_', FALSE]; + $data['low-line-start'] = ['_kittens', FALSE]; + $data['low-line-middle'] = ['kitt_ens', TRUE]; + $data['low-line-end'] = ['kittens_', FALSE]; $data['space-start'] = [' kittens', FALSE]; $data['space-middle'] = ['kitt ens', TRUE]; $data['space-end'] = ['kittens ', FALSE]; diff --git a/core/modules/rest/tests/src/Kernel/RequestHandlerTest.php b/core/modules/rest/tests/src/Kernel/RequestHandlerTest.php index 3da4471886b1..ac3421a1a323 100644 --- a/core/modules/rest/tests/src/Kernel/RequestHandlerTest.php +++ b/core/modules/rest/tests/src/Kernel/RequestHandlerTest.php @@ -54,7 +54,7 @@ protected function setUp(): void { */ public function testHandle() { $request = new Request([], [], [], [], [], ['CONTENT_TYPE' => 'application/json'], Json::encode(['this is an array'])); - $route_match = new RouteMatch('test', (new Route('/rest/test', ['_rest_resource_config' => 'restplugin', 'example' => ''], ['_format' => 'json']))->setMethods(['GET'])); + $route_match = new RouteMatch('test', (new Route('/rest/test', ['_rest_resource_config' => 'rest_plugin', 'example' => ''], ['_format' => 'json']))->setMethods(['GET'])); $resource = $this->prophesize(StubRequestHandlerResourcePlugin::class); $resource->get('', $request) @@ -83,7 +83,7 @@ public function testHandle() { $this->assertEquals($response, $handler_response); // We will call the patch method this time. - $route_match = new RouteMatch('test', (new Route('/rest/test', ['_rest_resource_config' => 'restplugin', 'example_original' => ''], ['_content_type_format' => 'json']))->setMethods(['PATCH'])); + $route_match = new RouteMatch('test', (new Route('/rest/test', ['_rest_resource_config' => 'rest_plugin', 'example_original' => ''], ['_content_type_format' => 'json']))->setMethods(['PATCH'])); $request->setMethod('PATCH'); $response = new ResourceResponse([]); $resource->patch(['this is an array'], $request) diff --git a/core/modules/rest/tests/src/Unit/EventSubscriber/ResourceResponseSubscriberTest.php b/core/modules/rest/tests/src/Unit/EventSubscriber/ResourceResponseSubscriberTest.php index f51ff6e4e9a6..8eafaddc3534 100644 --- a/core/modules/rest/tests/src/Unit/EventSubscriber/ResourceResponseSubscriberTest.php +++ b/core/modules/rest/tests/src/Unit/EventSubscriber/ResourceResponseSubscriberTest.php @@ -37,7 +37,7 @@ class ResourceResponseSubscriberTest extends UnitTestCase { */ public function testSerialization($data, $expected_response = FALSE) { $request = new Request(); - $route_match = new RouteMatch('test', new Route('/rest/test', ['_rest_resource_config' => 'restplugin'], ['_format' => 'json'])); + $route_match = new RouteMatch('test', new Route('/rest/test', ['_rest_resource_config' => 'rest_plugin'], ['_format' => 'json'])); $handler_response = new ResourceResponse($data); $resource_response_subscriber = $this->getFunctioningResourceResponseSubscriber($route_match); diff --git a/core/modules/system/tests/src/Kernel/Block/SystemMenuBlockTest.php b/core/modules/system/tests/src/Kernel/Block/SystemMenuBlockTest.php index ccbbb8bc0fcb..681b3e30383d 100644 --- a/core/modules/system/tests/src/Kernel/Block/SystemMenuBlockTest.php +++ b/core/modules/system/tests/src/Kernel/Block/SystemMenuBlockTest.php @@ -138,10 +138,10 @@ protected function setUp(): void { 2 => MenuLinkMock::create(['id' => 'test.example2', 'route_name' => 'example2', 'title' => 'bar', 'parent' => '', 'route_parameters' => ['foo' => 'bar'], 'weight' => 1]), 3 => MenuLinkMock::create(['id' => 'test.example3', 'route_name' => 'example3', 'title' => 'baz', 'parent' => 'test.example2', 'weight' => 2]), 4 => MenuLinkMock::create(['id' => 'test.example4', 'route_name' => 'example4', 'title' => 'qux', 'parent' => 'test.example3', 'weight' => 3]), - 5 => MenuLinkMock::create(['id' => 'test.example5', 'route_name' => 'example5', 'title' => 'foofoo', 'parent' => '', 'expanded' => TRUE, 'weight' => 4]), + 5 => MenuLinkMock::create(['id' => 'test.example5', 'route_name' => 'example5', 'title' => 'title5', 'parent' => '', 'expanded' => TRUE, 'weight' => 4]), 6 => MenuLinkMock::create(['id' => 'test.example6', 'route_name' => '', 'url' => 'https://www.drupal.org/', 'title' => 'barbar', 'parent' => '', 'weight' => 5]), - 7 => MenuLinkMock::create(['id' => 'test.example7', 'route_name' => 'example7', 'title' => 'bazbaz', 'parent' => 'test.example5', 'weight' => 6]), - 8 => MenuLinkMock::create(['id' => 'test.example8', 'route_name' => 'example8', 'title' => 'quxqux', 'parent' => '', 'weight' => 7]), + 7 => MenuLinkMock::create(['id' => 'test.example7', 'route_name' => 'example7', 'title' => 'title7', 'parent' => 'test.example5', 'weight' => 6]), + 8 => MenuLinkMock::create(['id' => 'test.example8', 'route_name' => 'example8', 'title' => 'title8', 'parent' => '', 'weight' => 7]), ]; foreach ($links as $instance) { $this->menuLinkManager->addDefinition($instance->getPluginId(), $instance->getPluginDefinition()); diff --git a/core/modules/text/tests/src/Kernel/TextSummaryTest.php b/core/modules/text/tests/src/Kernel/TextSummaryTest.php index 2a3cc32713b7..9a752603cf94 100644 --- a/core/modules/text/tests/src/Kernel/TextSummaryTest.php +++ b/core/modules/text/tests/src/Kernel/TextSummaryTest.php @@ -254,7 +254,7 @@ public function testRequiredSummary() { $this->installEntitySchema('entity_test'); $this->setUpCurrentUser(); $field_definition = FieldStorageConfig::create([ - 'field_name' => 'test_textwithsummary', + 'field_name' => 'test_text_with_summary', 'type' => 'text_with_summary', 'entity_type' => 'entity_test', 'cardinality' => 1, @@ -265,7 +265,7 @@ public function testRequiredSummary() { $field_definition->save(); $instance = FieldConfig::create([ - 'field_name' => 'test_textwithsummary', + 'field_name' => 'test_text_with_summary', 'label' => 'A text field', 'entity_type' => 'entity_test', 'bundle' => 'entity_test', @@ -282,7 +282,7 @@ public function testRequiredSummary() { 'bundle' => 'entity_test', 'mode' => 'default', 'status' => TRUE, - ])->setComponent('test_textwithsummary', [ + ])->setComponent('test_text_with_summary', [ 'type' => 'text_textarea_with_summary', 'settings' => [ 'summary_rows' => 2, @@ -295,17 +295,17 @@ public function testRequiredSummary() { $entity = EntityTest::create([ 'name' => $this->randomMachineName(), 'type' => 'entity_test', - 'test_textwithsummary' => ['value' => $this->randomMachineName()], + 'test_text_with_summary' => ['value' => $this->randomMachineName()], ]); $form = \Drupal::service('entity.form_builder')->getForm($entity); - $this->assertNotEmpty($form['test_textwithsummary']['widget'][0]['summary'], 'Summary field is shown'); - $this->assertNotEmpty($form['test_textwithsummary']['widget'][0]['summary']['#required'], 'Summary field is required'); + $this->assertNotEmpty($form['test_text_with_summary']['widget'][0]['summary'], 'Summary field is shown'); + $this->assertNotEmpty($form['test_text_with_summary']['widget'][0]['summary']['#required'], 'Summary field is required'); // Test validation. /** @var \Symfony\Component\Validator\ConstraintViolation[] $violations */ $violations = $entity->validate(); $this->assertCount(1, $violations); - $this->assertEquals('test_textwithsummary.0.summary', $violations[0]->getPropertyPath()); + $this->assertEquals('test_text_with_summary.0.summary', $violations[0]->getPropertyPath()); $this->assertEquals('The summary field is required for A text field', $violations[0]->getMessage()); } diff --git a/core/modules/views/tests/src/Kernel/Handler/FilterInOperatorTest.php b/core/modules/views/tests/src/Kernel/Handler/FilterInOperatorTest.php index fe30f125d015..b1feaa85b49a 100644 --- a/core/modules/views/tests/src/Kernel/Handler/FilterInOperatorTest.php +++ b/core/modules/views/tests/src/Kernel/Handler/FilterInOperatorTest.php @@ -252,7 +252,7 @@ public function testFilterOptionAsMarkup() { $input_options = [ 'foo' => 'bar', 'baz' => $this->t('qux'), - 'quux' => (object) ['option' => ['quux' => 'corge']], + 'foobar' => (object) ['option' => ['foobar' => 'dog']], ]; $reduced_values = $operator->reduceValueOptions($input_options); diff --git a/core/modules/views_ui/tests/src/Functional/UnsavedPreviewTest.php b/core/modules/views_ui/tests/src/Functional/UnsavedPreviewTest.php index d888e5bf20ea..f3d1e36846f0 100644 --- a/core/modules/views_ui/tests/src/Functional/UnsavedPreviewTest.php +++ b/core/modules/views_ui/tests/src/Functional/UnsavedPreviewTest.php @@ -63,7 +63,7 @@ public function testUnsavedPageDisplayPreview() { $this->drupalGet('admin/structure/views/nojs/display/content/page_2/path'); $this->assertSession()->statusCodeEquals(200); - $this->submitForm(['path' => 'foobarbaz'], 'Apply'); + $this->submitForm(['path' => 'foobar'], 'Apply'); $this->assertSession()->statusCodeEquals(200); $this->submitForm([], 'Update preview'); @@ -78,7 +78,7 @@ public function testUnsavedPageDisplayPreview() { $this->submitForm([], 'Update preview'); $this->assertSession()->statusCodeEquals(200); - $this->assertSession()->linkByHrefExists('foobarbaz'); + $this->assertSession()->linkByHrefExists('foobar'); } } diff --git a/core/tests/Drupal/FunctionalTests/Routing/CaseInsensitivePathTest.php b/core/tests/Drupal/FunctionalTests/Routing/CaseInsensitivePathTest.php index a77f8e4dc5d7..f4773b3c595f 100644 --- a/core/tests/Drupal/FunctionalTests/Routing/CaseInsensitivePathTest.php +++ b/core/tests/Drupal/FunctionalTests/Routing/CaseInsensitivePathTest.php @@ -6,7 +6,7 @@ use Drupal\Tests\BrowserTestBase; -// cspell:ignore È…chÈ meΦω +// cspell:ignore È…chÈ foobarbaz meΦω /** * Tests incoming path case insensitivity. diff --git a/core/tests/Drupal/KernelTests/Core/Menu/MenuLinkTreeTest.php b/core/tests/Drupal/KernelTests/Core/Menu/MenuLinkTreeTest.php index 43ad9d4784c4..b7f8bb82454f 100644 --- a/core/tests/Drupal/KernelTests/Core/Menu/MenuLinkTreeTest.php +++ b/core/tests/Drupal/KernelTests/Core/Menu/MenuLinkTreeTest.php @@ -106,10 +106,10 @@ public function testCreateLinksInMenu() { 2 => MenuLinkMock::create(['id' => 'test.example2', 'route_name' => 'example2', 'title' => 'bar', 'parent' => 'test.example1', 'route_parameters' => ['foo' => 'bar']]), 3 => MenuLinkMock::create(['id' => 'test.example3', 'route_name' => 'example3', 'title' => 'baz', 'parent' => 'test.example2', 'route_parameters' => ['baz' => 'qux']]), 4 => MenuLinkMock::create(['id' => 'test.example4', 'route_name' => 'example4', 'title' => 'qux', 'parent' => 'test.example3']), - 5 => MenuLinkMock::create(['id' => 'test.example5', 'route_name' => 'example5', 'title' => 'foofoo', 'parent' => '']), + 5 => MenuLinkMock::create(['id' => 'test.example5', 'route_name' => 'example5', 'title' => 'title5', 'parent' => '']), 6 => MenuLinkMock::create(['id' => 'test.example6', 'route_name' => '', 'url' => 'https://www.drupal.org/', 'title' => 'barbar', 'parent' => '']), - 7 => MenuLinkMock::create(['id' => 'test.example7', 'route_name' => 'example7', 'title' => 'bazbaz', 'parent' => '']), - 8 => MenuLinkMock::create(['id' => 'test.example8', 'route_name' => 'example8', 'title' => 'quxqux', 'parent' => '']), + 7 => MenuLinkMock::create(['id' => 'test.example7', 'route_name' => 'example7', 'title' => 'title7', 'parent' => '']), + 8 => MenuLinkMock::create(['id' => 'test.example8', 'route_name' => 'example8', 'title' => 'title8', 'parent' => '']), ]; foreach ($links as $instance) { $this->menuLinkManager->addDefinition($instance->getPluginId(), $instance->getPluginDefinition()); diff --git a/core/tests/Drupal/Tests/Component/Utility/HtmlTest.php b/core/tests/Drupal/Tests/Component/Utility/HtmlTest.php index 1f6cadd2bd3d..99affa11aaa8 100644 --- a/core/tests/Drupal/Tests/Component/Utility/HtmlTest.php +++ b/core/tests/Drupal/Tests/Component/Utility/HtmlTest.php @@ -77,7 +77,7 @@ public static function providerTestCleanCssIdentifier() { [$id3, $id3], // Verify that invalid characters (including non-breaking space) are // stripped from the identifier. - ['invalididentifier', 'invalid !"#$%&\'()*+,./:;<=>?@[\\]^`{|}~ identifier', []], + ['invalid_identifier', 'invalid_ !"#$%&\'()*+,./:;<=>?@[\\]^`{|}~ identifier', []], // Verify that an identifier starting with a digit is replaced. ['_css_identifier', '1css_identifier', []], // Verify that an identifier starting with a hyphen followed by a digit is diff --git a/core/tests/Drupal/Tests/Core/Command/GenerateThemeTest.php b/core/tests/Drupal/Tests/Core/Command/GenerateThemeTest.php index 5a401044e97d..6773a87accd3 100644 --- a/core/tests/Drupal/Tests/Core/Command/GenerateThemeTest.php +++ b/core/tests/Drupal/Tests/Core/Command/GenerateThemeTest.php @@ -316,12 +316,12 @@ public function testThemeDoesNotExist(): void { '--name="Test custom starterkit theme"', '--description="Custom theme generated from a starterkit theme"', '--starterkit', - 'foobarbaz', + 'foobar', ]; $process = new Process($install_command, NULL); $process->setTimeout(60); $result = $process->run(); - $this->assertStringContainsString('Theme source theme foobarbaz cannot be found.', trim($process->getErrorOutput())); + $this->assertStringContainsString('Theme source theme foobar cannot be found.', trim($process->getErrorOutput())); $this->assertSame(1, $result); } diff --git a/core/tests/Drupal/Tests/Core/Entity/EntityLinkTest.php b/core/tests/Drupal/Tests/Core/Entity/EntityLinkTest.php index ab3003c78e1d..745e78cc07ed 100644 --- a/core/tests/Drupal/Tests/Core/Entity/EntityLinkTest.php +++ b/core/tests/Drupal/Tests/Core/Entity/EntityLinkTest.php @@ -119,8 +119,8 @@ public static function providerTestLink() { $data = []; $data[] = [ 'some_entity_label', - 'qwerqwer', - 'qwerqwer', + 'link text', + 'link text', ]; $data[] = [ 'some_entity_label', @@ -134,20 +134,20 @@ public static function providerTestLink() { ]; $data[] = [ 'some_entity_label', - 'qwerqwer', - 'qwerqwer', + 'link text', + 'link text', 'edit-form', ]; $data[] = [ 'some_entity_label', - 'qwerqwer', - 'qwerqwer', + 'link text', + 'link text', 'edit-form', ]; $data[] = [ 'some_entity_label', - 'qwerqwer', - 'qwerqwer', + 'link text', + 'link text', 'edit-form', ['foo' => 'qwer'], ]; diff --git a/core/tests/Drupal/Tests/Core/Menu/DefaultMenuLinkTreeManipulatorsTest.php b/core/tests/Drupal/Tests/Core/Menu/DefaultMenuLinkTreeManipulatorsTest.php index d24e0b7eaf39..8a8aa10eeab4 100644 --- a/core/tests/Drupal/Tests/Core/Menu/DefaultMenuLinkTreeManipulatorsTest.php +++ b/core/tests/Drupal/Tests/Core/Menu/DefaultMenuLinkTreeManipulatorsTest.php @@ -124,10 +124,10 @@ protected function mockTree() { 2 => MenuLinkMock::create(['id' => 'test.example2', 'route_name' => 'example2', 'title' => 'bar', 'parent' => 'test.example1', 'route_parameters' => ['foo' => 'bar']]), 3 => MenuLinkMock::create(['id' => 'test.example3', 'route_name' => 'example3', 'title' => 'baz', 'parent' => 'test.example2', 'route_parameters' => ['baz' => 'qux']]), 4 => MenuLinkMock::create(['id' => 'test.example4', 'route_name' => 'example4', 'title' => 'qux', 'parent' => 'test.example3']), - 5 => MenuLinkMock::create(['id' => 'test.example5', 'route_name' => 'example5', 'title' => 'foofoo', 'parent' => '']), + 5 => MenuLinkMock::create(['id' => 'test.example5', 'route_name' => 'example5', 'title' => 'title5', 'parent' => '']), 6 => MenuLinkMock::create(['id' => 'test.example6', 'route_name' => '', 'url' => 'https://www.drupal.org/', 'title' => 'barbar', 'parent' => '']), - 7 => MenuLinkMock::create(['id' => 'test.example7', 'route_name' => 'example7', 'title' => 'bazbaz', 'parent' => '']), - 8 => MenuLinkMock::create(['id' => 'test.example8', 'route_name' => 'example8', 'title' => 'quxqux', 'parent' => '']), + 7 => MenuLinkMock::create(['id' => 'test.example7', 'route_name' => 'example7', 'title' => 'title7', 'parent' => '']), + 8 => MenuLinkMock::create(['id' => 'test.example8', 'route_name' => 'example8', 'title' => 'title8', 'parent' => '']), 9 => DynamicMenuLinkMock::create(['id' => 'test.example9', 'parent' => ''])->setCurrentUser($this->currentUser), ]; $this->originalTree = []; @@ -158,14 +158,14 @@ public function testGenerateIndexAndSort() { // Validate that parent elements #1, #2, #5 and #6 exist on the root level. $this->assertEquals($this->links[1]->getPluginId(), $tree['50000 foo test.example1']->link->getPluginId()); $this->assertEquals($this->links[2]->getPluginId(), $tree['50000 bar test.example2']->link->getPluginId()); - $this->assertEquals($this->links[5]->getPluginId(), $tree['50000 foofoo test.example5']->link->getPluginId()); + $this->assertEquals($this->links[5]->getPluginId(), $tree['50000 title5 test.example5']->link->getPluginId()); $this->assertEquals($this->links[6]->getPluginId(), $tree['50000 barbar test.example6']->link->getPluginId()); - $this->assertEquals($this->links[8]->getPluginId(), $tree['50000 quxqux test.example8']->link->getPluginId()); + $this->assertEquals($this->links[8]->getPluginId(), $tree['50000 title8 test.example8']->link->getPluginId()); // Verify that child element #4 is at the correct location in the hierarchy. $this->assertEquals($this->links[4]->getPluginId(), $tree['50000 bar test.example2']->subtree['50000 baz test.example3']->subtree['50000 qux test.example4']->link->getPluginId()); // Verify that child element #7 is at the correct location in the hierarchy. - $this->assertEquals($this->links[7]->getPluginId(), $tree['50000 foofoo test.example5']->subtree['50000 bazbaz test.example7']->link->getPluginId()); + $this->assertEquals($this->links[7]->getPluginId(), $tree['50000 title5 test.example5']->subtree['50000 title7 test.example7']->link->getPluginId()); } /** diff --git a/core/tests/Drupal/Tests/Core/Menu/MenuTreeParametersTest.php b/core/tests/Drupal/Tests/Core/Menu/MenuTreeParametersTest.php index df19630a04dd..bc63907c88ee 100644 --- a/core/tests/Drupal/Tests/Core/Menu/MenuTreeParametersTest.php +++ b/core/tests/Drupal/Tests/Core/Menu/MenuTreeParametersTest.php @@ -69,13 +69,13 @@ public function testAddExpanded() { // Add additional menu link plugin IDs; they should be merged, not replacing // the old ones. - $parameters->addExpandedParents(['qux', 'quux']); - $this->assertEquals(['foo', 'bar', 'baz', 'qux', 'quux'], $parameters->expandedParents); + $parameters->addExpandedParents(['qux', 'foobar']); + $this->assertEquals(['foo', 'bar', 'baz', 'qux', 'foobar'], $parameters->expandedParents); // Add pre-existing menu link plugin IDs; they should not be added again; // this is a set. - $parameters->addExpandedParents(['bar', 'quux']); - $this->assertEquals(['foo', 'bar', 'baz', 'qux', 'quux'], $parameters->expandedParents); + $parameters->addExpandedParents(['bar', 'foobar']); + $this->assertEquals(['foo', 'bar', 'baz', 'qux', 'foobar'], $parameters->expandedParents); } /** diff --git a/core/tests/Drupal/Tests/Core/Plugin/DefaultPluginManagerTest.php b/core/tests/Drupal/Tests/Core/Plugin/DefaultPluginManagerTest.php index 2f865f65a869..5a03eb56c9cd 100644 --- a/core/tests/Drupal/Tests/Core/Plugin/DefaultPluginManagerTest.php +++ b/core/tests/Drupal/Tests/Core/Plugin/DefaultPluginManagerTest.php @@ -384,14 +384,14 @@ public function testProviderExists() { $definitions = []; $definitions['array_based_found'] = ['provider' => 'module_found']; $definitions['array_based_missing'] = ['provider' => 'module_missing']; - $definitions['stdclass_based_found'] = (object) ['provider' => 'module_found']; - $definitions['stdclass_based_missing'] = (object) ['provider' => 'module_missing']; + $definitions['stdClass_based_found'] = (object) ['provider' => 'module_found']; + $definitions['stdClass_based_missing'] = (object) ['provider' => 'module_missing']; $definitions['classed_object_found'] = new ObjectDefinition(['provider' => 'module_found']); $definitions['classed_object_missing'] = new ObjectDefinition(['provider' => 'module_missing']); $expected = []; $expected['array_based_found'] = $definitions['array_based_found']; - $expected['stdclass_based_found'] = $definitions['stdclass_based_found']; + $expected['stdClass_based_found'] = $definitions['stdClass_based_found']; $expected['classed_object_found'] = $definitions['classed_object_found']; $module_handler = $this->prophesize(ModuleHandlerInterface::class); diff --git a/core/tests/Drupal/Tests/Core/Render/RendererBubblingTest.php b/core/tests/Drupal/Tests/Core/Render/RendererBubblingTest.php index d5362dc0daa8..fc307e762fbe 100644 --- a/core/tests/Drupal/Tests/Core/Render/RendererBubblingTest.php +++ b/core/tests/Drupal/Tests/Core/Render/RendererBubblingTest.php @@ -477,7 +477,7 @@ public function testBubblingWithPrerender($test_element) { $output = (string) $this->renderer->renderRoot($test_element); // First, assert the render array is of the expected form. - $this->assertEquals('Cache context!Cache tag!Asset!Placeholder!barquxNested!Cached nested!', trim($output), 'Expected HTML generated.'); + $this->assertEquals('Cache context!Cache tag!Asset!Placeholder!barstoolNested!Cached nested!', trim($output), 'Expected HTML generated.'); $this->assertEquals(['child.cache_context'], $test_element['#cache']['contexts'], 'Expected cache contexts found.'); $this->assertEquals(['child:cache_tag'], $test_element['#cache']['tags'], 'Expected cache tags found.'); $expected_attached = [ @@ -572,7 +572,7 @@ public static function bubblingPreRender($elements) { ], 'child_placeholder' => [ '#create_placeholder' => TRUE, - '#lazy_builder' => [__CLASS__ . '::bubblingPlaceholder', ['bar', 'qux']], + '#lazy_builder' => [__CLASS__ . '::bubblingPlaceholder', ['bar', 'stool']], ], 'child_nested_pre_render_uncached' => [ '#cache' => ['keys' => ['uncached_nested']], -- GitLab