diff --git a/core/modules/comment/tests/src/Unit/CommentStatisticsUnitTest.php b/core/modules/comment/tests/src/Unit/CommentStatisticsUnitTest.php index 068d77bb415..f24f456ced1 100644 --- a/core/modules/comment/tests/src/Unit/CommentStatisticsUnitTest.php +++ b/core/modules/comment/tests/src/Unit/CommentStatisticsUnitTest.php @@ -97,7 +97,7 @@ class CommentStatisticsUnitTest extends UnitTestCase { public function testRead() { $this->calls_to_fetch = 0; $results = $this->commentStatistics->read(['1' => 'boo', '2' => 'foo'], 'snafus'); - $this->assertEquals($results, ['something', 'something-else']); + $this->assertEquals(['something', 'something-else'], $results); } /** diff --git a/core/modules/dblog/tests/src/Functional/DbLogTest.php b/core/modules/dblog/tests/src/Functional/DbLogTest.php index 33550b37f8d..9853314eeb7 100644 --- a/core/modules/dblog/tests/src/Functional/DbLogTest.php +++ b/core/modules/dblog/tests/src/Functional/DbLogTest.php @@ -876,9 +876,9 @@ class DbLogTest extends BrowserTestBase { $this->drupalGet('admin/reports/dblog'); $entries = $this->getLogEntries(); - $this->assertEquals($entries[0]['message'], 'Third Entry #0'); - $this->assertEquals($entries[1]['message'], 'Second Entry #0'); - $this->assertEquals($entries[2]['message'], 'First Entry #0'); + $this->assertEquals('Third Entry #0', $entries[0]['message']); + $this->assertEquals('Second Entry #0', $entries[1]['message']); + $this->assertEquals('First Entry #0', $entries[2]['message']); } /** diff --git a/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldTest.php b/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldTest.php index 0ab9010c76a..1ad4c722cff 100644 --- a/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldTest.php +++ b/core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldTest.php @@ -182,10 +182,10 @@ class MigrateFieldTest extends MigrateDrupal7TestBase { }, iterator_to_array($migration->getIdMap()->getMessages())); sort($errors); $this->assertCount(4, $errors); - $this->assertEquals($errors[0], 'Can\'t migrate source field field_text_long_plain_filtered configured with both plain text and filtered text processing. See https://www.drupal.org/docs/8/upgrade/known-issues-when-upgrading-from-drupal-6-or-7-to-drupal-8#plain-text'); - $this->assertEquals($errors[1], 'Can\'t migrate source field field_text_plain_filtered configured with both plain text and filtered text processing. See https://www.drupal.org/docs/8/upgrade/known-issues-when-upgrading-from-drupal-6-or-7-to-drupal-8#plain-text'); - $this->assertEquals($errors[2], 'Can\'t migrate source field field_text_sum_plain of type text_with_summary configured with plain text processing. See https://www.drupal.org/docs/8/upgrade/known-issues-when-upgrading-from-drupal-6-or-7-to-drupal-8#plain-text'); - $this->assertEquals($errors[3], 'Can\'t migrate source field field_text_sum_plain_filtered of type text_with_summary configured with plain text processing. See https://www.drupal.org/docs/8/upgrade/known-issues-when-upgrading-from-drupal-6-or-7-to-drupal-8#plain-text'); + $this->assertEquals('Can\'t migrate source field field_text_long_plain_filtered configured with both plain text and filtered text processing. See https://www.drupal.org/docs/8/upgrade/known-issues-when-upgrading-from-drupal-6-or-7-to-drupal-8#plain-text', $errors[0]); + $this->assertEquals('Can\'t migrate source field field_text_plain_filtered configured with both plain text and filtered text processing. See https://www.drupal.org/docs/8/upgrade/known-issues-when-upgrading-from-drupal-6-or-7-to-drupal-8#plain-text', $errors[1]); + $this->assertEquals('Can\'t migrate source field field_text_sum_plain of type text_with_summary configured with plain text processing. See https://www.drupal.org/docs/8/upgrade/known-issues-when-upgrading-from-drupal-6-or-7-to-drupal-8#plain-text', $errors[2]); + $this->assertEquals('Can\'t migrate source field field_text_sum_plain_filtered of type text_with_summary configured with plain text processing. See https://www.drupal.org/docs/8/upgrade/known-issues-when-upgrading-from-drupal-6-or-7-to-drupal-8#plain-text', $errors[3]); } } diff --git a/core/modules/field_ui/tests/src/FunctionalJavascript/ManageDisplayTest.php b/core/modules/field_ui/tests/src/FunctionalJavascript/ManageDisplayTest.php index 17cc3e45072..4c84a7a12a6 100644 --- a/core/modules/field_ui/tests/src/FunctionalJavascript/ManageDisplayTest.php +++ b/core/modules/field_ui/tests/src/FunctionalJavascript/ManageDisplayTest.php @@ -182,7 +182,7 @@ class ManageDisplayTest extends WebDriverTestBase { $id = 'node.' . $this->type . '.default'; /** @var \Drupal\Core\Entity\Display\EntityViewDisplayInterface $display */ $display = $display_storage->loadUnchanged($id); - $this->assertEquals($display->getRenderer('field_test')->getThirdPartySetting('field_third_party_test', 'field_test_field_formatter_third_party_settings_form'), 'foo'); + $this->assertEquals('foo', $display->getRenderer('field_test')->getThirdPartySetting('field_third_party_test', 'field_test_field_formatter_third_party_settings_form')); $this->assertContains('field_third_party_test', $display->calculateDependencies()->getDependencies()['module'], 'The display has a dependency on field_third_party_test module.'); // Change the formatter to an empty setting and validate it's initialized @@ -329,7 +329,7 @@ class ManageDisplayTest extends WebDriverTestBase { /** @var \Drupal\Core\Entity\Display\EntityFormDisplayInterface $display */ $display = $form_storage->loadUnchanged('node.' . $this->type . '.default'); - $this->assertEquals($display->getRenderer('field_test')->getThirdPartySetting('field_third_party_test', 'field_test_widget_third_party_settings_form'), 'foo'); + $this->assertEquals('foo', $display->getRenderer('field_test')->getThirdPartySetting('field_third_party_test', 'field_test_widget_third_party_settings_form')); $this->assertContains('field_third_party_test', $display->calculateDependencies()->getDependencies()['module'], 'Form display does not have a dependency on field_third_party_test module.'); // Creates a new field that can not be used with the multiple formatter. diff --git a/core/modules/filter/tests/src/Kernel/FilterKernelTest.php b/core/modules/filter/tests/src/Kernel/FilterKernelTest.php index d471600a777..f26a1b4286f 100644 --- a/core/modules/filter/tests/src/Kernel/FilterKernelTest.php +++ b/core/modules/filter/tests/src/Kernel/FilterKernelTest.php @@ -937,116 +937,116 @@ www.example.com with a newline in comments --> public function testHtmlCorrectorFilter() { // Tag closing. $f = Html::normalize('
text'); - $this->assertEquals($f, '
text
', 'HTML corrector -- tag closing at the end of input.'); + $this->assertEquals('text
', $f, 'HTML corrector -- tag closing at the end of input.'); $f = Html::normalize('text
text'); - $this->assertEquals($f, '
text
text
', 'HTML corrector -- tag closing.'); + $this->assertEquals('text
text
', $f, 'HTML corrector -- tag closing.'); $f = Html::normalize("test
'); - $this->assertEquals($f, 'test
', 'HTML corrector -- Convert uppercased tags to proper lowercased ones.'); + $this->assertEquals('test
', $f, 'HTML corrector -- Convert uppercased tags to proper lowercased ones.'); $f = Html::normalize('test
'); - $this->assertEquals($f, 'test
', 'HTML corrector -- Convert uppercased tags to proper lowercased ones.'); + $this->assertEquals('test
', $f, 'HTML corrector -- Convert uppercased tags to proper lowercased ones.'); $f = Html::normalize('testline1
line1
line1
line1
line1
line1
test
test
\n'); - $this->assertEquals($f, 'test
test
\n', 'HTML corrector -- Auto-close improperly nested tags.'); + $this->assertEquals('test
test
\n', $f, 'HTML corrector -- Auto-close improperly nested tags.'); $f = Html::normalize('Line1 Line1 Line1
bold stuff');
- $this->assertEquals($f, '
bold stuff
bold stuff
test\n
\n'); - $this->assertEquals($f, 'test\n
\n', 'HTML corrector -- New-lines are accepted and kept as-is.'); + $this->assertEquals('test\n
\n', $f, 'HTML corrector -- New-lines are accepted and kept as-is.'); // cSpell:disable $f = Html::normalize('دروبال'); - $this->assertEquals($f, '
دروبال
', 'HTML corrector -- Encoding is correctly kept.'); + $this->assertEquals('دروبال
', $f, 'HTML corrector -- Encoding is correctly kept.'); // cSpell:enable $f = Html::normalize(''); - $this->assertEquals($f, '', 'HTML corrector -- CDATA added to script element'); +', $f, 'HTML corrector -- CDATA added to script element'); $f = Html::normalize(''); - $this->assertEquals($f, '', 'HTML corrector -- CDATA added to a nested script element'); +', $f, 'HTML corrector -- CDATA added to a nested script element'); $f = Html::normalize(''); - $this->assertEquals($f, '', 'HTML corrector -- CDATA added to a style element.'); +', $f, 'HTML corrector -- CDATA added to a style element.'); $filtered_data = Html::normalize(''); - $this->assertEquals($filtered_data, '', +', $filtered_data, new FormattableMarkup('HTML corrector -- Existing cdata section @pattern_name properly escaped', ['@pattern_name' => '/**/ '); - $this->assertEquals($filtered_data, '', +', $filtered_data, new FormattableMarkup('HTML corrector -- Existing cdata section @pattern_name properly escaped', ['@pattern_name' => ' '); - $this->assertEquals($filtered_data, '', +', $filtered_data, new FormattableMarkup('HTML corrector -- Existing cdata section @pattern_name properly escaped', ['@pattern_name' => ' -', +', $filtered_data, new FormattableMarkup('HTML corrector -- Existing cdata section @pattern_name properly escaped', ['@pattern_name' => '// setAccessible(TRUE); $config = $reflected_config->getValue($filterFormatPermissionMigration); - $this->assertEquals($config['migration'], 'custom_filter_format'); + $this->assertEquals('custom_filter_format', $config['migration']); } } diff --git a/core/modules/hal/tests/src/Kernel/DenormalizeTest.php b/core/modules/hal/tests/src/Kernel/DenormalizeTest.php index 9cc51dffdec..7cfd17d0aab 100644 --- a/core/modules/hal/tests/src/Kernel/DenormalizeTest.php +++ b/core/modules/hal/tests/src/Kernel/DenormalizeTest.php @@ -157,7 +157,7 @@ class DenormalizeTest extends NormalizerTestBase { public function testDenormalizeInvalidCustomSerializedField() { $entity = EntitySerializedField::create(['serialized_long' => serialize(['Hello world!'])]); $normalized = $this->serializer->normalize($entity); - $this->assertEquals($normalized['serialized_long'][0]['value'], ['Hello world!']); + $this->assertEquals(['Hello world!'], $normalized['serialized_long'][0]['value']); $normalized['serialized_long'][0]['value'] = 'boo'; $this->expectException(\LogicException::class); diff --git a/core/modules/help_topics/tests/src/Unit/HelpTopicTwigTest.php b/core/modules/help_topics/tests/src/Unit/HelpTopicTwigTest.php index 80cac2caf21..13e360ccf32 100644 --- a/core/modules/help_topics/tests/src/Unit/HelpTopicTwigTest.php +++ b/core/modules/help_topics/tests/src/Unit/HelpTopicTwigTest.php @@ -80,9 +80,9 @@ class HelpTopicTwigTest extends UnitTestCase { * @covers ::getCacheMaxAge */ public function testCacheInfo() { - $this->assertEquals($this->helpTopic->getCacheContexts(), []); - $this->assertEquals($this->helpTopic->getCacheTags(), ['core.extension']); - $this->assertEquals($this->helpTopic->getCacheMaxAge(), Cache::PERMANENT); + $this->assertEquals([], $this->helpTopic->getCacheContexts()); + $this->assertEquals(['core.extension'], $this->helpTopic->getCacheTags()); + $this->assertEquals(Cache::PERMANENT, $this->helpTopic->getCacheMaxAge()); } /** diff --git a/core/modules/image/tests/src/Kernel/ImageItemTest.php b/core/modules/image/tests/src/Kernel/ImageItemTest.php index 339b2025906..28847472133 100644 --- a/core/modules/image/tests/src/Kernel/ImageItemTest.php +++ b/core/modules/image/tests/src/Kernel/ImageItemTest.php @@ -155,7 +155,7 @@ class ImageItemTest extends FieldKernelTestBase { } catch (EntityStorageException $exception) { $this->assertInstanceOf(Warning::class, $exception->getPrevious()); - $this->assertEquals($exception->getMessage(), 'Missing file with ID 9999.'); + $this->assertEquals('Missing file with ID 9999.', $exception->getMessage()); $this->assertEmpty($entity->image_test->width); $this->assertEmpty($entity->image_test->height); } diff --git a/core/modules/image/tests/src/Unit/ImageStyleTest.php b/core/modules/image/tests/src/Unit/ImageStyleTest.php index e38d9152c13..a0fb5fd28d1 100644 --- a/core/modules/image/tests/src/Unit/ImageStyleTest.php +++ b/core/modules/image/tests/src/Unit/ImageStyleTest.php @@ -113,7 +113,7 @@ class ImageStyleTest extends UnitTestCase { $extensions = ['jpeg', 'gif', 'png']; foreach ($extensions as $extension) { $extensionReturned = $image_style->getDerivativeExtension($extension); - $this->assertEquals($extensionReturned, 'png'); + $this->assertEquals('png', $extensionReturned); } } diff --git a/core/modules/jsonapi/tests/src/Kernel/Normalizer/JsonApiDocumentTopLevelNormalizerTest.php b/core/modules/jsonapi/tests/src/Kernel/Normalizer/JsonApiDocumentTopLevelNormalizerTest.php index 5e20e4b14a9..f5be2140a2a 100644 --- a/core/modules/jsonapi/tests/src/Kernel/Normalizer/JsonApiDocumentTopLevelNormalizerTest.php +++ b/core/modules/jsonapi/tests/src/Kernel/Normalizer/JsonApiDocumentTopLevelNormalizerTest.php @@ -253,8 +253,8 @@ class JsonApiDocumentTopLevelNormalizerTest extends JsonapiKernelTestBase { $normalized = $jsonapi_doc_object->getNormalization(); // @see http://jsonapi.org/format/#document-jsonapi-object - $this->assertEquals($normalized['jsonapi']['version'], '1.0'); - $this->assertEquals($normalized['jsonapi']['meta']['links']['self']['href'], 'http://jsonapi.org/format/1.0/'); + $this->assertEquals('1.0', $normalized['jsonapi']['version']); + $this->assertEquals('http://jsonapi.org/format/1.0/', $normalized['jsonapi']['meta']['links']['self']['href']); $this->assertSame($normalized['data']['attributes']['title'], 'dummy_title'); $this->assertEquals($normalized['data']['id'], $this->node->uuid()); @@ -338,7 +338,7 @@ class JsonApiDocumentTopLevelNormalizerTest extends JsonapiKernelTestBase { $normalized = $jsonapi_doc_object->getNormalization(); $this->assertSame($normalized['data']['attributes']['name'], 'user1'); $this->assertEquals($normalized['data']['id'], User::load(1)->uuid()); - $this->assertEquals($normalized['data']['type'], 'user--user'); + $this->assertEquals('user--user', $normalized['data']['type']); // Make sure that the cache tags for the includes and the requested entities // are bubbling as expected. $this->assertSame(['user:1'], $jsonapi_doc_object->getCacheTags()); diff --git a/core/modules/jsonapi/tests/src/Kernel/Query/FilterTest.php b/core/modules/jsonapi/tests/src/Kernel/Query/FilterTest.php index 2cc221c0db5..dda2195030b 100644 --- a/core/modules/jsonapi/tests/src/Kernel/Query/FilterTest.php +++ b/core/modules/jsonapi/tests/src/Kernel/Query/FilterTest.php @@ -383,29 +383,29 @@ class FilterTest extends JsonapiKernelTestBase { $root = $filter->root(); // Make sure the implicit root group was added. - $this->assertEquals($root->conjunction(), 'AND'); + $this->assertEquals('AND', $root->conjunction()); // Ensure the or-group and the and-group were added correctly. $members = $root->members(); // Ensure the OR group was added. $or_group = $members[0]; - $this->assertEquals($or_group->conjunction(), 'OR'); + $this->assertEquals('OR', $or_group->conjunction()); $or_group_members = $or_group->members(); // Make sure the nested OR group was added with the right conditions. $nested_or_group = $or_group_members[0]; - $this->assertEquals($nested_or_group->conjunction(), 'OR'); + $this->assertEquals('OR', $nested_or_group->conjunction()); $nested_or_group_members = $nested_or_group->members(); - $this->assertEquals($nested_or_group_members[0]->field(), 'field0'); - $this->assertEquals($nested_or_group_members[1]->field(), 'field1'); + $this->assertEquals('field0', $nested_or_group_members[0]->field()); + $this->assertEquals('field1', $nested_or_group_members[1]->field()); // Make sure the nested AND group was added with the right conditions. $nested_and_group = $or_group_members[1]; - $this->assertEquals($nested_and_group->conjunction(), 'AND'); + $this->assertEquals('AND', $nested_and_group->conjunction()); $nested_and_group_members = $nested_and_group->members(); - $this->assertEquals($nested_and_group_members[0]->field(), 'field2'); - $this->assertEquals($nested_and_group_members[1]->field(), 'field3'); + $this->assertEquals('field2', $nested_and_group_members[0]->field()); + $this->assertEquals('field3', $nested_and_group_members[1]->field()); } /** diff --git a/core/modules/language/tests/src/Unit/ConfigurableLanguageUnitTest.php b/core/modules/language/tests/src/Unit/ConfigurableLanguageUnitTest.php index 58670f0255a..ef02b319d9f 100644 --- a/core/modules/language/tests/src/Unit/ConfigurableLanguageUnitTest.php +++ b/core/modules/language/tests/src/Unit/ConfigurableLanguageUnitTest.php @@ -37,8 +37,8 @@ class ConfigurableLanguageUnitTest extends UnitTestCase { // The weight, an integer. Used to order languages with larger positive // weights sinking items toward the bottom of lists. $configurableLanguage = new ConfigurableLanguage(['weight' => -5], 'configurable_language'); - $this->assertEquals($configurableLanguage->getWeight(), -5); - $this->assertEquals($configurableLanguage->setWeight(13)->getWeight(), 13); + $this->assertEquals(-5, $configurableLanguage->getWeight()); + $this->assertEquals(13, $configurableLanguage->setWeight(13)->getWeight()); } } diff --git a/core/modules/layout_builder/tests/src/FunctionalJavascript/InlineBlockTest.php b/core/modules/layout_builder/tests/src/FunctionalJavascript/InlineBlockTest.php index 7e5ee49503c..bbcd3cf5127 100644 --- a/core/modules/layout_builder/tests/src/FunctionalJavascript/InlineBlockTest.php +++ b/core/modules/layout_builder/tests/src/FunctionalJavascript/InlineBlockTest.php @@ -164,7 +164,7 @@ class InlineBlockTest extends InlineBlockTestBase { $this->assertCount(1, $blocks); $block = array_pop($blocks); $this->assertEquals($block->getRevisionId(), $revision_id); - $this->assertEquals($block->get('body')->getValue()[0]['value'], 'The block body'); + $this->assertEquals('The block body', $block->get('body')->getValue()[0]['value']); } else { // The block should not be visible. diff --git a/core/modules/layout_builder/tests/src/Kernel/LayoutBuilderEntityViewDisplayTest.php b/core/modules/layout_builder/tests/src/Kernel/LayoutBuilderEntityViewDisplayTest.php index 5b3fece0b55..e806c0a5815 100644 --- a/core/modules/layout_builder/tests/src/Kernel/LayoutBuilderEntityViewDisplayTest.php +++ b/core/modules/layout_builder/tests/src/Kernel/LayoutBuilderEntityViewDisplayTest.php @@ -83,11 +83,11 @@ class LayoutBuilderEntityViewDisplayTest extends SectionStorageTestBase { // Set Overridable to TRUE and ensure Layout Builder is enabled. $this->sectionStorage->setOverridable(); - $this->assertEquals($this->sectionStorage->isLayoutBuilderEnabled(), TRUE); + $this->assertTrue($this->sectionStorage->isLayoutBuilderEnabled()); // Ensure Layout Builder is still enabled after setting Overridable to FALSE. $this->sectionStorage->setOverridable(FALSE); - $this->assertEquals($this->sectionStorage->isLayoutBuilderEnabled(), TRUE); + $this->assertTrue($this->sectionStorage->isLayoutBuilderEnabled()); } } diff --git a/core/modules/locale/tests/src/Functional/LocaleImportFunctionalTest.php b/core/modules/locale/tests/src/Functional/LocaleImportFunctionalTest.php index 4a19ffc7a40..902e080cea2 100644 --- a/core/modules/locale/tests/src/Functional/LocaleImportFunctionalTest.php +++ b/core/modules/locale/tests/src/Functional/LocaleImportFunctionalTest.php @@ -209,7 +209,7 @@ class LocaleImportFunctionalTest extends BrowserTestBase { ->countQuery() ->execute() ->fetchField(); - $this->assertEquals($count, 6, 'Customized translations successfully imported.'); + $this->assertEquals(6, $count, 'Customized translations successfully imported.'); // Try importing a .po file with overriding strings, and ensure existing // customized strings are kept. diff --git a/core/modules/menu_link_content/tests/src/Kernel/Migrate/d7/MigrateMenuLinkTest.php b/core/modules/menu_link_content/tests/src/Kernel/Migrate/d7/MigrateMenuLinkTest.php index a2df4a7ab53..dd3cac07dfc 100644 --- a/core/modules/menu_link_content/tests/src/Kernel/Migrate/d7/MigrateMenuLinkTest.php +++ b/core/modules/menu_link_content/tests/src/Kernel/Migrate/d7/MigrateMenuLinkTest.php @@ -81,7 +81,7 @@ class MigrateMenuLinkTest extends MigrateDrupal7TestBase { foreach ($tree as $menu_link_tree_element) { $children += $menu_link_tree_element->hasChildren; if ($menu_link_tree_element->link->getUrlObject()->toString() == 'http://bing.com') { - $this->assertEquals(reset($menu_link_tree_element->subtree)->link->getUrlObject()->toString(), 'http://google.com'); + $this->assertEquals('http://google.com', reset($menu_link_tree_element->subtree)->link->getUrlObject()->toString()); $google_found = TRUE; } } diff --git a/core/modules/migrate/tests/src/Functional/process/DownloadFunctionalTest.php b/core/modules/migrate/tests/src/Functional/process/DownloadFunctionalTest.php index 9ca3d992c13..9464450f7f6 100644 --- a/core/modules/migrate/tests/src/Functional/process/DownloadFunctionalTest.php +++ b/core/modules/migrate/tests/src/Functional/process/DownloadFunctionalTest.php @@ -59,7 +59,7 @@ class DownloadFunctionalTest extends BrowserTestBase { $result = $executable->import(); // Check that the migration has completed. - $this->assertEquals($result, MigrationInterface::RESULT_COMPLETED); + $this->assertEquals(MigrationInterface::RESULT_COMPLETED, $result); /** @var \Drupal\migrate\Plugin\MigrateIdMapInterface $id_map_plugin */ $id_map_plugin = $migration->getIdMap(); diff --git a/core/modules/migrate/tests/src/Kernel/MigrateBundleTest.php b/core/modules/migrate/tests/src/Kernel/MigrateBundleTest.php index 2babdc1ab20..4f49b6fc1f1 100644 --- a/core/modules/migrate/tests/src/Kernel/MigrateBundleTest.php +++ b/core/modules/migrate/tests/src/Kernel/MigrateBundleTest.php @@ -68,7 +68,7 @@ class MigrateBundleTest extends MigrateTestBase { $term_executable->import(); /** @var \Drupal\taxonomy\Entity\Term $term */ $term = Term::load(1); - $this->assertEquals($term->bundle(), 'categories'); + $this->assertEquals('categories', $term->bundle()); } /** @@ -106,9 +106,9 @@ class MigrateBundleTest extends MigrateTestBase { $term_executable->import(); /** @var \Drupal\taxonomy\Entity\Term $term */ $term = Term::load(1); - $this->assertEquals($term->bundle(), 'categories'); + $this->assertEquals('categories', $term->bundle()); $term = Term::load(2); - $this->assertEquals($term->bundle(), 'tags'); + $this->assertEquals('tags', $term->bundle()); } /** @@ -148,9 +148,9 @@ class MigrateBundleTest extends MigrateTestBase { $term_executable->import(); /** @var \Drupal\taxonomy\Entity\Term $term */ $term = Term::load(1); - $this->assertEquals($term->bundle(), 'categories'); + $this->assertEquals('categories', $term->bundle()); $term = Term::load(2); - $this->assertEquals($term->bundle(), 'tags'); + $this->assertEquals('tags', $term->bundle()); } } diff --git a/core/modules/migrate/tests/src/Kernel/MigrateSkipRowTest.php b/core/modules/migrate/tests/src/Kernel/MigrateSkipRowTest.php index 6ccafe0eba3..b131f48eea8 100644 --- a/core/modules/migrate/tests/src/Kernel/MigrateSkipRowTest.php +++ b/core/modules/migrate/tests/src/Kernel/MigrateSkipRowTest.php @@ -86,7 +86,7 @@ class MigrateSkipRowTest extends KernelTestBase { $executable = new MigrateExecutable($migration); $result = $executable->import(); - $this->assertEquals($result, MigrationInterface::RESULT_COMPLETED); + $this->assertEquals(MigrationInterface::RESULT_COMPLETED, $result); $id_map_plugin = $migration->getIdMap(); diff --git a/core/modules/migrate/tests/src/Unit/MigrateSqlIdMapTest.php b/core/modules/migrate/tests/src/Unit/MigrateSqlIdMapTest.php index 4d598d05d06..91c27b0400c 100644 --- a/core/modules/migrate/tests/src/Unit/MigrateSqlIdMapTest.php +++ b/core/modules/migrate/tests/src/Unit/MigrateSqlIdMapTest.php @@ -328,7 +328,7 @@ class MigrateSqlIdMapTest extends MigrateTestCase { $this->assertEquals($message_default, $message_row->message); $this->assertEquals(MigrationInterface::MESSAGE_ERROR, $message_row->level); } - $this->assertEquals($count, 1); + $this->assertEquals(1, $count); // Retrieve messages with a specific level. $messages = $id_map->getMessages([], MigrationInterface::MESSAGE_WARNING); @@ -337,7 +337,7 @@ class MigrateSqlIdMapTest extends MigrateTestCase { $count = 1; $this->assertEquals(MigrationInterface::MESSAGE_WARNING, $message_row->level); } - $this->assertEquals($count, 1); + $this->assertEquals(1, $count); } /** diff --git a/core/modules/migrate/tests/src/Unit/destination/ConfigTest.php b/core/modules/migrate/tests/src/Unit/destination/ConfigTest.php index d85d3d5fcef..d55c21197b4 100644 --- a/core/modules/migrate/tests/src/Unit/destination/ConfigTest.php +++ b/core/modules/migrate/tests/src/Unit/destination/ConfigTest.php @@ -56,7 +56,7 @@ class ConfigTest extends UnitTestCase { ->will($this->returnValue($config)); $destination = new Config(['config_name' => 'd8_config'], 'd8_config', ['pluginId' => 'd8_config'], $migration, $config_factory, $language_manager); $destination_id = $destination->import($row); - $this->assertEquals($destination_id, ['d8_config']); + $this->assertEquals(['d8_config'], $destination_id); } /** @@ -106,7 +106,7 @@ class ConfigTest extends UnitTestCase { ->will($this->returnValue($config)); $destination = new Config(['config_name' => 'd8_config', 'translations' => 'true'], 'd8_config', ['pluginId' => 'd8_config'], $migration, $config_factory, $language_manager); $destination_id = $destination->import($row); - $this->assertEquals($destination_id, ['d8_config', 'mi']); + $this->assertEquals(['d8_config', 'mi'], $destination_id); } } diff --git a/core/modules/node/tests/src/Kernel/NodeFieldOverridesTest.php b/core/modules/node/tests/src/Kernel/NodeFieldOverridesTest.php index 4ee5a933897..ac5184735a4 100644 --- a/core/modules/node/tests/src/Kernel/NodeFieldOverridesTest.php +++ b/core/modules/node/tests/src/Kernel/NodeFieldOverridesTest.php @@ -53,7 +53,7 @@ class NodeFieldOverridesTest extends EntityKernelTestBase { $uid_field = \Drupal::service('entity_field.manager')->getBaseFieldDefinitions('node')['uid']; $config = $uid_field->getConfig('ponies'); $config->save(); - $this->assertEquals($config->get('default_value_callback'), 'Drupal\node\Entity\Node::getDefaultEntityOwner'); + $this->assertEquals('Drupal\node\Entity\Node::getDefaultEntityOwner', $config->get('default_value_callback')); /** @var \Drupal\node\NodeInterface $node */ $node = Node::create(['type' => 'ponies']); $owner = $node->getOwner(); diff --git a/core/modules/path_alias/tests/src/Kernel/AliasTest.php b/core/modules/path_alias/tests/src/Kernel/AliasTest.php index bcf7da6327e..d78ad96f968 100644 --- a/core/modules/path_alias/tests/src/Kernel/AliasTest.php +++ b/core/modules/path_alias/tests/src/Kernel/AliasTest.php @@ -194,7 +194,7 @@ class AliasTest extends KernelTestBase { // Destruct the whitelist so it persists its cache. $whitelist->destruct(); - $this->assertEquals($memoryCounterBackend->getCounter('set', 'path_alias_whitelist'), 1); + $this->assertEquals(1, $memoryCounterBackend->getCounter('set', 'path_alias_whitelist')); // Cache data should have data for 'user' and 'admin', even though just // 'admin' was looked up. This is because the cache is primed with all // menu router base paths. @@ -217,7 +217,7 @@ class AliasTest extends KernelTestBase { // from underneath it and not save anything to cache, to protect from // cache corruption. $whitelist->destruct(); - $this->assertEquals($memoryCounterBackend->getCounter('set', 'path_alias_whitelist'), 0); + $this->assertEquals(0, $memoryCounterBackend->getCounter('set', 'path_alias_whitelist')); $this->assertFalse($memoryCounterBackend->get('path_alias_whitelist')); $memoryCounterBackend->resetCounter(); } diff --git a/core/modules/rest/tests/src/Unit/CollectRoutesTest.php b/core/modules/rest/tests/src/Unit/CollectRoutesTest.php index a53caf9cc37..4ede3332a43 100644 --- a/core/modules/rest/tests/src/Unit/CollectRoutesTest.php +++ b/core/modules/rest/tests/src/Unit/CollectRoutesTest.php @@ -155,7 +155,7 @@ class CollectRoutesTest extends UnitTestCase { // Check auth options. $auth = $this->routes->get('view.test_view.page_1')->getOption('_auth'); $this->assertCount(1, $auth, 'View route with rest export has an auth option added'); - $this->assertEquals($auth[0], 'basic_auth', 'View route with rest export has the correct auth option added'); + $this->assertEquals('basic_auth', $auth[0], 'View route with rest export has the correct auth option added'); } } diff --git a/core/modules/serialization/tests/src/Kernel/EntitySerializationTest.php b/core/modules/serialization/tests/src/Kernel/EntitySerializationTest.php index 16353354fb5..2a09246428c 100644 --- a/core/modules/serialization/tests/src/Kernel/EntitySerializationTest.php +++ b/core/modules/serialization/tests/src/Kernel/EntitySerializationTest.php @@ -295,7 +295,7 @@ class EntitySerializationTest extends NormalizerTestBase { public function testDenormalizeCustomSerializedItem() { $entity = EntitySerializedField::create(['serialized_text' => serialize(['Hello world!'])]); $normalized = $this->serializer->normalize($entity); - $this->assertEquals($normalized['serialized_text'][0]['value'], ['Hello world!']); + $this->assertEquals(['Hello world!'], $normalized['serialized_text'][0]['value']); $this->expectException(\LogicException::class); $this->expectExceptionMessage('The generic FieldItemNormalizer cannot denormalize string values for "value" properties of the "serialized_text" field (field item class: Drupal\entity_test\Plugin\Field\FieldType\SerializedPropertyItem).'); $this->serializer->denormalize([ @@ -314,7 +314,7 @@ class EntitySerializationTest extends NormalizerTestBase { public function testDenormalizeInvalidCustomSerializedField() { $entity = EntitySerializedField::create(['serialized_long' => serialize(['Hello world!'])]); $normalized = $this->serializer->normalize($entity); - $this->assertEquals($normalized['serialized_long'][0]['value'], ['Hello world!']); + $this->assertEquals(['Hello world!'], $normalized['serialized_long'][0]['value']); $this->expectException(\LogicException::class); $this->expectExceptionMessage('The generic FieldItemNormalizer cannot denormalize string values for "value" properties of the "serialized_long" field (field item class: Drupal\Core\Field\Plugin\Field\FieldType\StringLongItem).'); $this->serializer->denormalize([ diff --git a/core/modules/settings_tray/tests/src/FunctionalJavascript/SettingsTrayBlockFormTest.php b/core/modules/settings_tray/tests/src/FunctionalJavascript/SettingsTrayBlockFormTest.php index 7ece59ef947..4f7c880bed9 100644 --- a/core/modules/settings_tray/tests/src/FunctionalJavascript/SettingsTrayBlockFormTest.php +++ b/core/modules/settings_tray/tests/src/FunctionalJavascript/SettingsTrayBlockFormTest.php @@ -99,9 +99,9 @@ class SettingsTrayBlockFormTest extends SettingsTrayTestBase { // Confirm "Display Title" is not checked. $web_assert->checkboxNotChecked('settings[label_display]'); // Confirm Title is not visible. - $this->assertEquals($this->isLabelInputVisible(), FALSE, 'Label is not visible'); + $this->assertFalse($this->isLabelInputVisible(), 'Label is not visible'); $page->checkField('settings[label_display]'); - $this->assertEquals($this->isLabelInputVisible(), TRUE, 'Label is visible'); + $this->assertTrue($this->isLabelInputVisible(), 'Label is visible'); // Fill out form, save the form. $page->fillField('settings[label]', $new_page_text); diff --git a/core/modules/settings_tray/tests/src/FunctionalJavascript/SettingsTrayTestBase.php b/core/modules/settings_tray/tests/src/FunctionalJavascript/SettingsTrayTestBase.php index 63692e954bb..29ed1541dde 100644 --- a/core/modules/settings_tray/tests/src/FunctionalJavascript/SettingsTrayTestBase.php +++ b/core/modules/settings_tray/tests/src/FunctionalJavascript/SettingsTrayTestBase.php @@ -137,11 +137,11 @@ class SettingsTrayTestBase extends OffCanvasTestBase { $web_assert->elementTextContains('css', '.form-item-settings-label-display label', 'Display block title'); // Confirm Block title label is shown if checkbox is checked. if ($this->getSession()->getPage()->find('css', 'input[name="settings[label_display]"]')->isChecked()) { - $this->assertEquals($this->isLabelInputVisible(), TRUE, 'Label is visible'); + $this->assertTrue($this->isLabelInputVisible(), 'Label is visible'); $web_assert->elementTextContains('css', '.form-item-settings-label label', 'Block title'); } else { - $this->assertEquals($this->isLabelInputVisible(), FALSE, 'Label is not visible'); + $this->assertFalse($this->isLabelInputVisible(), 'Label is not visible'); } // Check that common block form elements exist. diff --git a/core/modules/system/tests/src/Functional/Render/HtmlResponseAttachmentsTest.php b/core/modules/system/tests/src/Functional/Render/HtmlResponseAttachmentsTest.php index a0ace372dbb..f07424b455e 100644 --- a/core/modules/system/tests/src/Functional/Render/HtmlResponseAttachmentsTest.php +++ b/core/modules/system/tests/src/Functional/Render/HtmlResponseAttachmentsTest.php @@ -98,10 +98,9 @@ class HtmlResponseAttachmentsTest extends BrowserTestBase { * Helper function to make assertions about added HTTP headers. */ protected function assertTeapotHeaders() { - $headers = $this->getSession()->getResponseHeaders(); - $this->assertEquals($headers['X-Test-Teapot'], ['Teapot Mode Active']); - $this->assertEquals($headers['X-Test-Teapot-Replace'], ['Teapot replaced']); - $this->assertEquals($headers['X-Test-Teapot-No-Replace'], ['This value is not replaced', 'This one is added']); + $this->assertSession()->responseHeaderEquals('X-Test-Teapot', 'Teapot Mode Active'); + $this->assertSession()->responseHeaderEquals('X-Test-Teapot-Replace', 'Teapot replaced'); + $this->assertSession()->responseHeaderEquals('X-Test-Teapot-No-Replace', 'This value is not replaced'); } /** diff --git a/core/modules/system/tests/src/Kernel/Extension/ModuleHandlerTest.php b/core/modules/system/tests/src/Kernel/Extension/ModuleHandlerTest.php index 64956dec9e9..d3411dd881e 100644 --- a/core/modules/system/tests/src/Kernel/Extension/ModuleHandlerTest.php +++ b/core/modules/system/tests/src/Kernel/Extension/ModuleHandlerTest.php @@ -179,7 +179,7 @@ class ModuleHandlerTest extends KernelTestBase { $result = $this->moduleInstaller()->uninstall([$non_dependency]); $this->assertTrue($result, 'ModuleInstaller::uninstall() returns TRUE.'); $this->assertFalse($this->moduleHandler()->moduleExists($non_dependency)); - $this->assertEquals(drupal_get_installed_schema_version($non_dependency), SCHEMA_UNINSTALLED, "$non_dependency module was uninstalled."); + $this->assertEquals(SCHEMA_UNINSTALLED, drupal_get_installed_schema_version($non_dependency), "$non_dependency module was uninstalled."); // Verify that the installation profile itself was not uninstalled. $uninstalled_modules = \Drupal::state()->get('module_test.uninstall_order', []); diff --git a/core/modules/update/tests/src/Functional/UpdateContribTest.php b/core/modules/update/tests/src/Functional/UpdateContribTest.php index 0d24aa22a69..5265eafbe79 100644 --- a/core/modules/update/tests/src/Functional/UpdateContribTest.php +++ b/core/modules/update/tests/src/Functional/UpdateContribTest.php @@ -872,8 +872,8 @@ class UpdateContribTest extends UpdateTestBase { $this->assertFalse($compatibility_details->hasAttribute('open')); $this->assertSame('Compatible', $details_summary_element->getText()); $this->assertEquals( - $update_element->findLink('Download')->getAttribute('href'), - "http://example.com/{$this->updateProject}-$download_version.tar.gz" + "http://example.com/{$this->updateProject}-$download_version.tar.gz", + $update_element->findLink('Download')->getAttribute('href') ); } else { diff --git a/core/modules/user/tests/src/Functional/RestRegisterUserTest.php b/core/modules/user/tests/src/Functional/RestRegisterUserTest.php index f3f269a7395..7bcdf26583c 100644 --- a/core/modules/user/tests/src/Functional/RestRegisterUserTest.php +++ b/core/modules/user/tests/src/Functional/RestRegisterUserTest.php @@ -84,7 +84,7 @@ class RestRegisterUserTest extends ResourceTestBase { $this->assertFalse(empty($user->getPassword())); $email_count = count($this->drupalGetMails()); - $this->assertEquals($email_count, 0); + $this->assertEquals(0, $email_count); // Attempt to register without sending a password. $response = $this->registerRequest('Rick.Deckard', FALSE); diff --git a/core/modules/user/tests/src/Kernel/UserRoleEntityTest.php b/core/modules/user/tests/src/Kernel/UserRoleEntityTest.php index b597c3ddae8..89f272297fa 100644 --- a/core/modules/user/tests/src/Kernel/UserRoleEntityTest.php +++ b/core/modules/user/tests/src/Kernel/UserRoleEntityTest.php @@ -18,13 +18,13 @@ class UserRoleEntityTest extends KernelTestBase { ->grantPermission('a') ->grantPermission('c') ->save(); - $this->assertEquals($role->getPermissions(), ['a', 'b', 'c']); + $this->assertEquals(['a', 'b', 'c'], $role->getPermissions()); $role->revokePermission('b')->save(); - $this->assertEquals($role->getPermissions(), ['a', 'c']); + $this->assertEquals(['a', 'c'], $role->getPermissions()); $role->grantPermission('b')->save(); - $this->assertEquals($role->getPermissions(), ['a', 'b', 'c']); + $this->assertEquals(['a', 'b', 'c'], $role->getPermissions()); } } diff --git a/core/modules/user/tests/src/Unit/PermissionHandlerTest.php b/core/modules/user/tests/src/Unit/PermissionHandlerTest.php index 92b259ea5cb..e7447e6e5bc 100644 --- a/core/modules/user/tests/src/Unit/PermissionHandlerTest.php +++ b/core/modules/user/tests/src/Unit/PermissionHandlerTest.php @@ -327,12 +327,12 @@ EOF $actual_permissions = $this->permissionHandler->getPermissions(); $this->assertCount(2, $actual_permissions); - $this->assertEquals($actual_permissions['access module a']['title'], 'Access A'); - $this->assertEquals($actual_permissions['access module a']['provider'], 'module_a'); - $this->assertEquals($actual_permissions['access module a']['description'], 'bla bla'); - $this->assertEquals($actual_permissions['access module b']['title'], 'Access B'); - $this->assertEquals($actual_permissions['access module b']['provider'], 'module_a'); - $this->assertEquals($actual_permissions['access module b']['description'], 'bla bla'); + $this->assertEquals('Access A', $actual_permissions['access module a']['title']); + $this->assertEquals('module_a', $actual_permissions['access module a']['provider']); + $this->assertEquals('bla bla', $actual_permissions['access module a']['description']); + $this->assertEquals('Access B', $actual_permissions['access module b']['title']); + $this->assertEquals('module_a', $actual_permissions['access module b']['provider']); + $this->assertEquals('bla bla', $actual_permissions['access module b']['description']); } /** @@ -343,14 +343,14 @@ EOF */ protected function assertPermissions(array $actual_permissions) { $this->assertCount(4, $actual_permissions); - $this->assertEquals($actual_permissions['access_module_a']['title'], 'single_description'); - $this->assertEquals($actual_permissions['access_module_a']['provider'], 'module_a'); - $this->assertEquals($actual_permissions['access module b']['title'], 'Access B'); - $this->assertEquals($actual_permissions['access module b']['provider'], 'module_b'); - $this->assertEquals($actual_permissions['access_module_c']['title'], 'Access C'); - $this->assertEquals($actual_permissions['access_module_c']['provider'], 'module_c'); - $this->assertEquals($actual_permissions['access_module_c']['restrict access'], TRUE); - $this->assertEquals($actual_permissions['access module a via module b']['provider'], 'module_a'); + $this->assertEquals('single_description', $actual_permissions['access_module_a']['title']); + $this->assertEquals('module_a', $actual_permissions['access_module_a']['provider']); + $this->assertEquals('Access B', $actual_permissions['access module b']['title']); + $this->assertEquals('module_b', $actual_permissions['access module b']['provider']); + $this->assertEquals('Access C', $actual_permissions['access_module_c']['title']); + $this->assertEquals('module_c', $actual_permissions['access_module_c']['provider']); + $this->assertTrue($actual_permissions['access_module_c']['restrict access']); + $this->assertEquals('module_a', $actual_permissions['access module a via module b']['provider']); } } diff --git a/core/modules/views/tests/src/Unit/ViewExecutableTest.php b/core/modules/views/tests/src/Unit/ViewExecutableTest.php index 8746dee6651..f24c0d1428a 100644 --- a/core/modules/views/tests/src/Unit/ViewExecutableTest.php +++ b/core/modules/views/tests/src/Unit/ViewExecutableTest.php @@ -344,8 +344,8 @@ class ViewExecutableTest extends UnitTestCase { public function testGenerateHandlerId() { // Test the generateHandlerId() method. $test_ids = ['test' => 'test', 'test_1' => 'test_1']; - $this->assertEquals(ViewExecutable::generateHandlerId('new', $test_ids), 'new'); - $this->assertEquals(ViewExecutable::generateHandlerId('test', $test_ids), 'test_2'); + $this->assertEquals('new', ViewExecutable::generateHandlerId('new', $test_ids)); + $this->assertEquals('test_2', ViewExecutable::generateHandlerId('test', $test_ids)); } /** diff --git a/core/modules/views_ui/tests/src/Functional/FilterNumericWebTest.php b/core/modules/views_ui/tests/src/Functional/FilterNumericWebTest.php index 43093efbf3e..9368750c612 100644 --- a/core/modules/views_ui/tests/src/Functional/FilterNumericWebTest.php +++ b/core/modules/views_ui/tests/src/Functional/FilterNumericWebTest.php @@ -128,7 +128,7 @@ class FilterNumericWebTest extends UITestBase { $max_element_label = $this->xpath('//fieldset[contains(@id, "edit-age-wrapper")]//label[contains(@for, "edit-age-max") and contains(text(), "Max")]'); $this->assertCount(1, $max_element_label); // Check that the description is shown in the right place. - $this->assertEquals(trim($this->cssSelect('#edit-age-wrapper--description')[0]->getText()), 'Description of the exposed filter'); + $this->assertEquals('Description of the exposed filter', trim($this->cssSelect('#edit-age-wrapper--description')[0]->getText())); // Change to an operation that only requires one form element ('>'). $this->drupalGet('admin/structure/views/nojs/handler/test_view/default/filter/age'); diff --git a/core/tests/Drupal/FunctionalTests/Entity/ContentEntityFormCorrectUserInputMappingOnFieldDeltaElementsTest.php b/core/tests/Drupal/FunctionalTests/Entity/ContentEntityFormCorrectUserInputMappingOnFieldDeltaElementsTest.php index 39176200f76..1cd176328f5 100644 --- a/core/tests/Drupal/FunctionalTests/Entity/ContentEntityFormCorrectUserInputMappingOnFieldDeltaElementsTest.php +++ b/core/tests/Drupal/FunctionalTests/Entity/ContentEntityFormCorrectUserInputMappingOnFieldDeltaElementsTest.php @@ -114,10 +114,10 @@ class ContentEntityFormCorrectUserInputMappingOnFieldDeltaElementsTest extends B // Assert that after rearranging the field items the user input will be // mapped on the correct delta field items. - $this->assertEquals($entity->get($this->fieldName)->getValue(), [ + $this->assertEquals([ ['shape' => 'circle', 'color' => 'blue'], ['shape' => 'rectangle', 'color' => 'green'], - ]); + ], $entity->get($this->fieldName)->getValue()); } } diff --git a/core/tests/Drupal/FunctionalTests/Update/UpdatePathTestBaseTest.php b/core/tests/Drupal/FunctionalTests/Update/UpdatePathTestBaseTest.php index fa05eb2c206..925e18922c3 100644 --- a/core/tests/Drupal/FunctionalTests/Update/UpdatePathTestBaseTest.php +++ b/core/tests/Drupal/FunctionalTests/Update/UpdatePathTestBaseTest.php @@ -105,7 +105,7 @@ class UpdatePathTestBaseTest extends UpdatePathTestBase { // Ensure the index was added for column a. $this->assertTrue($connection->schema()->indexExists('update_test_schema_table', 'test'), 'Version 8001 of the update_test_schema module is installed.'); // Ensure update_test_semver_update_n_update_8001 was run. - $this->assertEquals(\Drupal::state()->get('update_test_semver_update_n_update_8001'), 'Yes, I was run. Thanks for testing!'); + $this->assertEquals('Yes, I was run. Thanks for testing!', \Drupal::state()->get('update_test_semver_update_n_update_8001')); } /** diff --git a/core/tests/Drupal/KernelTests/Core/Action/EmailActionTest.php b/core/tests/Drupal/KernelTests/Core/Action/EmailActionTest.php index 4b1f921358a..81d8aad8956 100644 --- a/core/tests/Drupal/KernelTests/Core/Action/EmailActionTest.php +++ b/core/tests/Drupal/KernelTests/Core/Action/EmailActionTest.php @@ -57,9 +57,9 @@ class EmailActionTest extends KernelTestBase { ->execute() ->fetch(); - $this->assertEquals($log->message, 'Sent email to %recipient'); + $this->assertEquals('Sent email to %recipient', $log->message); $variables = unserialize($log->variables); - $this->assertEquals($variables['%recipient'], 'test@example.com'); + $this->assertEquals('test@example.com', $variables['%recipient']); } } diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityDuplicateTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityDuplicateTest.php index c663ebd724b..4480d4e1c60 100644 --- a/core/tests/Drupal/KernelTests/Core/Entity/EntityDuplicateTest.php +++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityDuplicateTest.php @@ -41,7 +41,7 @@ class EntityDuplicateTest extends EntityKernelTestBase { $duplicate_first_revision = $this->entityTestRevStorage->loadRevision($first_revision_id)->createDuplicate(); $this->assertTrue($duplicate_first_revision->isDefaultRevision(), 'Duplicating a non-default revision creates a default revision.'); - $this->assertEquals($duplicate_first_revision->label(), 'First Revision'); + $this->assertEquals('First Revision', $duplicate_first_revision->label()); $duplicate_first_revision->save(); $duplicate_first_revision->name = 'Updated name'; diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityHasFieldConstraintValidatorTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityHasFieldConstraintValidatorTest.php index ce60e6cdb81..fcccd1e3c21 100644 --- a/core/tests/Drupal/KernelTests/Core/Entity/EntityHasFieldConstraintValidatorTest.php +++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityHasFieldConstraintValidatorTest.php @@ -47,7 +47,7 @@ class EntityHasFieldConstraintValidatorTest extends EntityKernelTestBase { // field has been created. $violations = $entity->validate(); $this->assertCount(1, $violations); - $this->assertEquals($violations[0]->getMessage(), 'The entity must have the body field.'); + $this->assertEquals('The entity must have the body field.', $violations[0]->getMessage()); $storage->save($entity); // Create the field. diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityRevisionTranslationTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityRevisionTranslationTest.php index b2f0f179052..c67bb05482f 100644 --- a/core/tests/Drupal/KernelTests/Core/Entity/EntityRevisionTranslationTest.php +++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityRevisionTranslationTest.php @@ -134,8 +134,8 @@ class EntityRevisionTranslationTest extends EntityKernelTestBase { $pending_revision = $storage->loadRevision($pending_revision_id); - $this->assertEquals($pending_revision->name->value, 'updated pending revision - en'); - $this->assertEquals($pending_revision->getTranslation('de')->name->value, 'pending revision - de'); + $this->assertEquals('updated pending revision - en', $pending_revision->name->value); + $this->assertEquals('pending revision - de', $pending_revision->getTranslation('de')->name->value); } /** diff --git a/core/tests/Drupal/Tests/Component/Annotation/Doctrine/DocParserTest.php b/core/tests/Drupal/Tests/Component/Annotation/Doctrine/DocParserTest.php index ad2cd7b9068..5a028bcb4ff 100644 --- a/core/tests/Drupal/Tests/Component/Annotation/Doctrine/DocParserTest.php +++ b/core/tests/Drupal/Tests/Component/Annotation/Doctrine/DocParserTest.php @@ -211,7 +211,7 @@ DOCBLOCK; $this->assertNull($annot->name); $this->assertNotNull($annot->data); - $this->assertEquals($annot->data, "Some data"); + $this->assertEquals("Some data", $annot->data); @@ -230,8 +230,8 @@ DOCBLOCK; $this->assertNotNull($annot); $this->assertInstanceOf(SomeAnnotationClassNameWithoutConstructor::class, $annot); - $this->assertEquals($annot->name, "Some Name"); - $this->assertEquals($annot->data, "Some data"); + $this->assertEquals("Some Name", $annot->name); + $this->assertEquals("Some data", $annot->data); @@ -246,7 +246,7 @@ DOCBLOCK; $this->assertCount(1, $result); $annot = $result[0]; - $this->assertEquals($annot->data, "Some data"); + $this->assertEquals("Some data", $annot->data); $this->assertNull($annot->name); @@ -260,7 +260,7 @@ DOCBLOCK; $this->assertCount(1, $result); $annot = $result[0]; - $this->assertEquals($annot->name, "Some name"); + $this->assertEquals("Some name", $annot->name); $this->assertNull($annot->data); $docblock = <<