diff --git a/core/modules/config/tests/src/Functional/ConfigEntityTest.php b/core/modules/config/tests/src/Functional/ConfigEntityTest.php index 47901274cbe..0335fbbe81a 100644 --- a/core/modules/config/tests/src/Functional/ConfigEntityTest.php +++ b/core/modules/config/tests/src/Functional/ConfigEntityTest.php @@ -100,7 +100,7 @@ class ConfigEntityTest extends BrowserTestBase { 'label' => $this->randomString(), 'style' => $this->randomMachineName(), ]); - $this->assertNotEqual($config_test->uuid(), $empty->uuid()); + $this->assertNotEquals($empty->uuid(), $config_test->uuid()); $this->assertIdentical($config_test->label, $expected['label']); $this->assertIdentical($config_test->style, $expected['style']); $this->assertIdentical($config_test->language()->getId(), $default_langcode); diff --git a/core/modules/config/tests/src/Functional/ConfigExportImportUITest.php b/core/modules/config/tests/src/Functional/ConfigExportImportUITest.php index 4fb541524bf..edf9d4c80d0 100644 --- a/core/modules/config/tests/src/Functional/ConfigExportImportUITest.php +++ b/core/modules/config/tests/src/Functional/ConfigExportImportUITest.php @@ -96,7 +96,7 @@ class ConfigExportImportUITest extends BrowserTestBase { $this->originalSlogan = $this->config('system.site')->get('slogan'); $this->newSlogan = $this->randomString(16); - $this->assertNotEqual($this->newSlogan, $this->originalSlogan); + $this->assertNotEquals($this->originalSlogan, $this->newSlogan); $this->config('system.site') ->set('slogan', $this->newSlogan) ->save(); diff --git a/core/modules/config/tests/src/Functional/ConfigImportUITest.php b/core/modules/config/tests/src/Functional/ConfigImportUITest.php index e3cac9ab9cc..78a96163b17 100644 --- a/core/modules/config/tests/src/Functional/ConfigImportUITest.php +++ b/core/modules/config/tests/src/Functional/ConfigImportUITest.php @@ -251,7 +251,7 @@ class ConfigImportUITest extends BrowserTestBase { $this->container->get('lock.persistent')->release($config_importer::LOCK_NAME); // Verify site name has not changed. - $this->assertNotEqual($new_site_name, $this->config('system.site')->get('name')); + $this->assertNotEquals($this->config('system.site')->get('name'), $new_site_name); } /** @@ -370,7 +370,7 @@ class ConfigImportUITest extends BrowserTestBase { $this->assertText('Config import validate error 2.'); // Verify site name has not changed. - $this->assertNotEqual($new_site_name, $this->config('system.site')->get('name')); + $this->assertNotEquals($this->config('system.site')->get('name'), $new_site_name); } public function testConfigUninstallConfigException() { diff --git a/core/modules/config/tests/src/Functional/TransformedConfigExportImportUITest.php b/core/modules/config/tests/src/Functional/TransformedConfigExportImportUITest.php index 5ad7bd3f6bf..2c50a24d62e 100644 --- a/core/modules/config/tests/src/Functional/TransformedConfigExportImportUITest.php +++ b/core/modules/config/tests/src/Functional/TransformedConfigExportImportUITest.php @@ -61,7 +61,7 @@ class TransformedConfigExportImportUITest extends BrowserTestBase { $originalSlogan = $this->config('system.site')->get('slogan'); $this->assertEmpty($originalSlogan); $newSlogan = $this->randomMachineName(16); - $this->assertNotEqual($newSlogan, $originalSlogan); + $this->assertNotEquals($originalSlogan, $newSlogan); $this->config('system.site') ->set('slogan', $newSlogan) ->save(); diff --git a/core/modules/contact/tests/src/Functional/ContactSitewideTest.php b/core/modules/contact/tests/src/Functional/ContactSitewideTest.php index 05749867a8c..c7d45765331 100644 --- a/core/modules/contact/tests/src/Functional/ContactSitewideTest.php +++ b/core/modules/contact/tests/src/Functional/ContactSitewideTest.php @@ -199,7 +199,7 @@ class ContactSitewideTest extends BrowserTestBase { $this->assertEqual($config['label'], $label); $this->assertEqual($config['recipients'], [$recipients[0], $recipients[1]]); $this->assertEqual($config['reply'], $reply); - $this->assertNotEqual($id, $this->config('contact.settings')->get('default_form')); + $this->assertNotEquals($this->config('contact.settings')->get('default_form'), $id); $this->assertText('Contact form ' . $label . ' has been updated.'); // Ensure the label is displayed on the contact page for this form. $this->drupalGet('contact/' . $id); diff --git a/core/modules/content_translation/tests/src/Functional/ContentTranslationMetadataFieldsTest.php b/core/modules/content_translation/tests/src/Functional/ContentTranslationMetadataFieldsTest.php index cd920556234..a42b93d2d89 100644 --- a/core/modules/content_translation/tests/src/Functional/ContentTranslationMetadataFieldsTest.php +++ b/core/modules/content_translation/tests/src/Functional/ContentTranslationMetadataFieldsTest.php @@ -133,10 +133,10 @@ class ContentTranslationMetadataFieldsTest extends ContentTranslationTestBase { $metadata_target_translation->setPublished(TRUE); $metadata_target_translation->setAuthor($this->editor); - $this->assertNotEqual($metadata_source_translation->getCreatedTime(), $metadata_target_translation->getCreatedTime(), 'Metadata created field correctly different on both translations.'); - $this->assertNotEqual($metadata_source_translation->getChangedTime(), $metadata_target_translation->getChangedTime(), 'Metadata changed field correctly different on both translations.'); - $this->assertNotEqual($metadata_source_translation->isPublished(), $metadata_target_translation->isPublished(), 'Metadata published field correctly different on both translations.'); - $this->assertNotEqual($metadata_source_translation->getAuthor()->id(), $metadata_target_translation->getAuthor()->id(), 'Metadata author field correctly different on both translations.'); + $this->assertNotEquals($metadata_source_translation->getCreatedTime(), $metadata_target_translation->getCreatedTime(), 'Metadata created field correctly different on both translations.'); + $this->assertNotEquals($metadata_source_translation->getChangedTime(), $metadata_target_translation->getChangedTime(), 'Metadata changed field correctly different on both translations.'); + $this->assertNotEquals($metadata_source_translation->isPublished(), $metadata_target_translation->isPublished(), 'Metadata published field correctly different on both translations.'); + $this->assertNotEquals($metadata_source_translation->getAuthor()->id(), $metadata_target_translation->getAuthor()->id(), 'Metadata author field correctly different on both translations.'); } } diff --git a/core/modules/content_translation/tests/src/Functional/ContentTranslationUITestBase.php b/core/modules/content_translation/tests/src/Functional/ContentTranslationUITestBase.php index 1edeed4c13f..3846f2bcd1a 100644 --- a/core/modules/content_translation/tests/src/Functional/ContentTranslationUITestBase.php +++ b/core/modules/content_translation/tests/src/Functional/ContentTranslationUITestBase.php @@ -138,7 +138,7 @@ abstract class ContentTranslationUITestBase extends ContentTranslationTestBase { $this->assertEqual($metadata_target_translation->getAuthor()->id(), $this->translator->id(), new FormattableMarkup('Author of the target translation @langcode correctly stored for translatable owner field.', ['@langcode' => $langcode])); - $this->assertNotEqual($metadata_target_translation->getAuthor()->id(), $metadata_source_translation->getAuthor()->id(), + $this->assertNotEquals($metadata_target_translation->getAuthor()->id(), $metadata_source_translation->getAuthor()->id(), new FormattableMarkup('Author of the target translation @target different from the author of the source translation @source for translatable owner field.', ['@target' => $langcode, '@source' => $default_langcode])); } @@ -624,7 +624,7 @@ abstract class ContentTranslationUITestBase extends ContentTranslationTestBase { $storage->resetCache([$this->entityId]); $entity = $storage->load($this->entityId); - $this->assertNotEqual($changed_timestamp, $entity->getChangedTime(), 'The entity\'s changed time was updated after form save without changes.'); + $this->assertNotEquals($changed_timestamp, $entity->getChangedTime(), 'The entity\'s changed time was updated after form save without changes.'); } } diff --git a/core/modules/dblog/tests/src/Kernel/Views/ViewsIntegrationTest.php b/core/modules/dblog/tests/src/Kernel/Views/ViewsIntegrationTest.php index abd6a4ce208..eb6d063b2cb 100644 --- a/core/modules/dblog/tests/src/Kernel/Views/ViewsIntegrationTest.php +++ b/core/modules/dblog/tests/src/Kernel/Views/ViewsIntegrationTest.php @@ -71,7 +71,7 @@ class ViewsIntegrationTest extends ViewsKernelTestBase { if ($index == 2) { // Make sure that unsafe link differs from the rendered link, so we know // that some filtering actually happened. - $this->assertNotEqual($link_field, $entry['variables']['link']); + $this->assertNotEquals($entry['variables']['link'], $link_field); } $this->assertEqual($link_field, Xss::filterAdmin($entry['variables']['link'])); } diff --git a/core/modules/field/tests/src/Kernel/FormatterPluginManagerTest.php b/core/modules/field/tests/src/Kernel/FormatterPluginManagerTest.php index 0b07e3ad9b8..3cf07079b09 100644 --- a/core/modules/field/tests/src/Kernel/FormatterPluginManagerTest.php +++ b/core/modules/field/tests/src/Kernel/FormatterPluginManagerTest.php @@ -40,7 +40,7 @@ class FormatterPluginManagerTest extends FieldKernelTestBase { $instance = $formatter_plugin_manager->getInstance($formatter_options); // Instance should be default widget. - $this->assertNotEqual($instance->getPluginId(), 'field_test_applicable'); + $this->assertNotSame('field_test_applicable', $instance->getPluginId()); $this->assertEqual($instance->getPluginId(), 'field_test_default'); } diff --git a/core/modules/field/tests/src/Kernel/WidgetPluginManagerTest.php b/core/modules/field/tests/src/Kernel/WidgetPluginManagerTest.php index 61e48dc944a..380647d60cd 100644 --- a/core/modules/field/tests/src/Kernel/WidgetPluginManagerTest.php +++ b/core/modules/field/tests/src/Kernel/WidgetPluginManagerTest.php @@ -51,7 +51,7 @@ class WidgetPluginManagerTest extends FieldKernelTestBase { $instance = $widget_plugin_manager->getInstance($widget_options); // Instance should be default widget. - $this->assertNotEqual($instance->getPluginId(), 'test_field_widget_multiple'); + $this->assertNotSame('test_field_widget_multiple', $instance->getPluginId()); $this->assertEqual($instance->getPluginId(), 'test_field_widget'); } diff --git a/core/modules/file/tests/src/Functional/FileFieldAnonymousSubmissionTest.php b/core/modules/file/tests/src/Functional/FileFieldAnonymousSubmissionTest.php index 40676e1b886..a649cf169c2 100644 --- a/core/modules/file/tests/src/Functional/FileFieldAnonymousSubmissionTest.php +++ b/core/modules/file/tests/src/Functional/FileFieldAnonymousSubmissionTest.php @@ -54,9 +54,9 @@ class FileFieldAnonymousSubmissionTest extends FileFieldTestBase { $matches = []; if (preg_match('@node/(\d+)$@', $this->getUrl(), $matches)) { $nid = end($matches); - $this->assertNotEqual($nid, 0, 'The node ID was extracted from the URL.'); + $this->assertNotEquals(0, $nid, 'The node ID was extracted from the URL.'); $node = Node::load($nid); - $this->assertNotEqual($node, NULL, 'The node was loaded successfully.'); + $this->assertNotNull($node, 'The node was loaded successfully.'); } } @@ -90,9 +90,9 @@ class FileFieldAnonymousSubmissionTest extends FileFieldTestBase { $matches = []; if (preg_match('@node/(\d+)$@', $this->getUrl(), $matches)) { $nid = end($matches); - $this->assertNotEqual($nid, 0, 'The node ID was extracted from the URL.'); + $this->assertNotEquals(0, $nid, 'The node ID was extracted from the URL.'); $node = Node::load($nid); - $this->assertNotEqual($node, NULL, 'The node was loaded successfully.'); + $this->assertNotNull($node, 'The node was loaded successfully.'); $this->assertFileExists(File::load($node->field_image->target_id)->getFileUri()); } } @@ -164,9 +164,9 @@ class FileFieldAnonymousSubmissionTest extends FileFieldTestBase { $matches = []; if (preg_match('@node/(\d+)$@', $this->getUrl(), $matches)) { $nid = end($matches); - $this->assertNotEqual($nid, 0, 'The node ID was extracted from the URL.'); + $this->assertNotEquals(0, $nid, 'The node ID was extracted from the URL.'); $node = Node::load($nid); - $this->assertNotEqual($node, NULL, 'The node was loaded successfully.'); + $this->assertNotNull($node, 'The node was loaded successfully.'); $this->assertFileExists(File::load($node->field_image->target_id)->getFileUri()); } } diff --git a/core/modules/file/tests/src/Functional/FileFieldTestBase.php b/core/modules/file/tests/src/Functional/FileFieldTestBase.php index feca5df7779..2612565a905 100644 --- a/core/modules/file/tests/src/Functional/FileFieldTestBase.php +++ b/core/modules/file/tests/src/Functional/FileFieldTestBase.php @@ -154,7 +154,7 @@ abstract class FileFieldTestBase extends BrowserTestBase { $node->save(); $node_storage->resetCache([$nid]); $node = $node_storage->load($nid); - $this->assertNotEqual($nid, $node->getRevisionId(), 'Node revision exists.'); + $this->assertNotEquals($nid, $node->getRevisionId(), 'Node revision exists.'); } $this->drupalGet("node/$nid/edit"); $page = $this->getSession()->getPage(); diff --git a/core/modules/file/tests/src/Functional/FileFieldWidgetTest.php b/core/modules/file/tests/src/Functional/FileFieldWidgetTest.php index 0f4e5930a02..81b4a260561 100644 --- a/core/modules/file/tests/src/Functional/FileFieldWidgetTest.php +++ b/core/modules/file/tests/src/Functional/FileFieldWidgetTest.php @@ -333,7 +333,7 @@ class FileFieldWidgetTest extends FileFieldTestBase { $this->assertFileExists($comment_file->getFileUri()); // Test authenticated file download. $url = $comment_file->createFileUrl(); - $this->assertNotEqual($url, NULL, 'Confirmed that the URL is valid'); + $this->assertNotNull($url, 'Confirmed that the URL is valid'); $this->drupalGet($comment_file->createFileUrl()); $this->assertSession()->statusCodeEquals(200); diff --git a/core/modules/file/tests/src/Functional/FileManagedTestBase.php b/core/modules/file/tests/src/Functional/FileManagedTestBase.php index 3d7b8e6c2d6..7436d35e9fa 100644 --- a/core/modules/file/tests/src/Functional/FileManagedTestBase.php +++ b/core/modules/file/tests/src/Functional/FileManagedTestBase.php @@ -113,8 +113,8 @@ abstract class FileManagedTestBase extends BrowserTestBase { * File object to compare. */ public function assertDifferentFile(FileInterface $file1, FileInterface $file2) { - $this->assertNotEqual($file1->id(), $file2->id(), t('Files have different ids: %file1 != %file2.', ['%file1' => $file1->id(), '%file2' => $file2->id()]), 'Different file'); - $this->assertNotEqual($file1->getFileUri(), $file2->getFileUri(), t('Files have different paths: %file1 != %file2.', ['%file1' => $file1->getFileUri(), '%file2' => $file2->getFileUri()]), 'Different file'); + $this->assertNotEquals($file1->id(), $file2->id(), t('Files have different ids: %file1 != %file2.', ['%file1' => $file1->id(), '%file2' => $file2->id()])); + $this->assertNotEquals($file1->getFileUri(), $file2->getFileUri(), t('Files have different paths: %file1 != %file2.', ['%file1' => $file1->getFileUri(), '%file2' => $file2->getFileUri()])); } /** diff --git a/core/modules/file/tests/src/Kernel/CopyTest.php b/core/modules/file/tests/src/Kernel/CopyTest.php index e196508ccd0..4395712d306 100644 --- a/core/modules/file/tests/src/Kernel/CopyTest.php +++ b/core/modules/file/tests/src/Kernel/CopyTest.php @@ -58,7 +58,7 @@ class CopyTest extends FileManagedUnitTestBase { // Check the return status and that the contents changed. $this->assertNotFalse($result, 'File copied successfully.'); $this->assertEqual($contents, file_get_contents($result->getFileUri()), 'Contents of file were copied correctly.'); - $this->assertNotEqual($result->getFileUri(), $source->getFileUri(), 'Returned file path has changed from the original.'); + $this->assertNotEquals($source->getFileUri(), $result->getFileUri(), 'Returned file path has changed from the original.'); // Check that the correct hooks were called. $this->assertFileHooksCalled(['copy', 'insert']); diff --git a/core/modules/file/tests/src/Kernel/FileManagedUnitTestBase.php b/core/modules/file/tests/src/Kernel/FileManagedUnitTestBase.php index a487566aa68..30f3161568f 100644 --- a/core/modules/file/tests/src/Kernel/FileManagedUnitTestBase.php +++ b/core/modules/file/tests/src/Kernel/FileManagedUnitTestBase.php @@ -126,8 +126,8 @@ abstract class FileManagedUnitTestBase extends KernelTestBase { * File object to compare. */ public function assertDifferentFile(FileInterface $file1, FileInterface $file2) { - $this->assertNotEqual($file1->id(), $file2->id(), t('Files have different ids: %file1 != %file2.', ['%file1' => $file1->id(), '%file2' => $file2->id()]), 'Different file'); - $this->assertNotEqual($file1->getFileUri(), $file2->getFileUri(), t('Files have different paths: %file1 != %file2.', ['%file1' => $file1->getFileUri(), '%file2' => $file2->getFileUri()]), 'Different file'); + $this->assertNotEquals($file1->id(), $file2->id(), t('Files have different ids: %file1 != %file2.', ['%file1' => $file1->id(), '%file2' => $file2->id()])); + $this->assertNotEquals($file1->getFileUri(), $file2->getFileUri(), t('Files have different paths: %file1 != %file2.', ['%file1' => $file1->getFileUri(), '%file2' => $file2->getFileUri()])); } /** diff --git a/core/modules/file/tests/src/Kernel/MoveTest.php b/core/modules/file/tests/src/Kernel/MoveTest.php index c841d36c5fc..6205457187a 100644 --- a/core/modules/file/tests/src/Kernel/MoveTest.php +++ b/core/modules/file/tests/src/Kernel/MoveTest.php @@ -75,7 +75,7 @@ class MoveTest extends FileManagedUnitTestBase { // Compare the source and results. $loaded_source = File::load($source->id()); $this->assertEqual($loaded_source->id(), $result->id(), "Returned file's id matches the source."); - $this->assertNotEqual($loaded_source->getFileUri(), $source->getFileUri(), 'Returned file path has changed from the original.'); + $this->assertNotEquals($source->getFileUri(), $loaded_source->getFileUri(), 'Returned file path has changed from the original.'); } /** diff --git a/core/modules/image/tests/src/Functional/ImageStylesPathAndUrlTest.php b/core/modules/image/tests/src/Functional/ImageStylesPathAndUrlTest.php index 445cdfa49bd..71a014a59d8 100644 --- a/core/modules/image/tests/src/Functional/ImageStylesPathAndUrlTest.php +++ b/core/modules/image/tests/src/Functional/ImageStylesPathAndUrlTest.php @@ -177,7 +177,7 @@ class ImageStylesPathAndUrlTest extends BrowserTestBase { // in it. if ($extra_slash) { $modified_uri = str_replace('://', ':///', $original_uri); - $this->assertNotEqual($original_uri, $modified_uri, 'An extra slash was added to the generated file URI.'); + $this->assertNotEquals($original_uri, $modified_uri, 'An extra slash was added to the generated file URI.'); $generate_url = $this->style->buildUrl($modified_uri, $clean_url); } if (!$clean_url) { diff --git a/core/modules/language/tests/src/Functional/LanguageUrlRewritingTest.php b/core/modules/language/tests/src/Functional/LanguageUrlRewritingTest.php index 386f0b0ebf0..eb1b19081c6 100644 --- a/core/modules/language/tests/src/Functional/LanguageUrlRewritingTest.php +++ b/core/modules/language/tests/src/Functional/LanguageUrlRewritingTest.php @@ -96,7 +96,7 @@ class LanguageUrlRewritingTest extends BrowserTestBase { // we can always check the prefixed URL. $prefixes = $this->config('language.negotiation')->get('url.prefixes'); $stored_prefix = isset($prefixes[$language->getId()]) ? $prefixes[$language->getId()] : $this->randomMachineName(); - $this->assertNotEqual($stored_prefix, $prefix, $message); + $this->assertNotEquals($prefix, $stored_prefix, $message); $prefix = $stored_prefix; $this->drupalGet("$prefix/$path"); diff --git a/core/modules/locale/tests/src/Kernel/LocaleConfigSubscriberTest.php b/core/modules/locale/tests/src/Kernel/LocaleConfigSubscriberTest.php index c3d1fed4842..e5a33c9f263 100644 --- a/core/modules/locale/tests/src/Kernel/LocaleConfigSubscriberTest.php +++ b/core/modules/locale/tests/src/Kernel/LocaleConfigSubscriberTest.php @@ -390,7 +390,7 @@ class LocaleConfigSubscriberTest extends KernelTestBase { protected function assertNoConfigOverride($config_name, $langcode) { $config_langcode = $this->configFactory->getEditable($config_name)->get('langcode'); $override = $this->languageManager->getLanguageConfigOverride($langcode, $config_name); - $this->assertNotEqual($config_langcode, $langcode); + $this->assertNotEquals($langcode, $config_langcode); $this->assertEqual($override->isNew(), TRUE); } @@ -409,7 +409,7 @@ class LocaleConfigSubscriberTest extends KernelTestBase { protected function assertConfigOverride($config_name, $key, $value, $langcode) { $config_langcode = $this->configFactory->getEditable($config_name)->get('langcode'); $override = $this->languageManager->getLanguageConfigOverride($langcode, $config_name); - $this->assertNotEqual($config_langcode, $langcode); + $this->assertNotEquals($langcode, $config_langcode); $this->assertEqual($override->get($key), $value); } diff --git a/core/modules/locale/tests/src/Kernel/LocaleStringIsSafeTest.php b/core/modules/locale/tests/src/Kernel/LocaleStringIsSafeTest.php index 5cc4cde577d..fe4740c33c6 100644 --- a/core/modules/locale/tests/src/Kernel/LocaleStringIsSafeTest.php +++ b/core/modules/locale/tests/src/Kernel/LocaleStringIsSafeTest.php @@ -67,9 +67,9 @@ class LocaleStringIsSafeTest extends KernelTestBase { $rendered_original_string = \Drupal::theme()->render('locale_test_tokenized', ['content' => $original_string]); // Twig assumes that strings are unsafe so it escapes them, and so the // original and the rendered version should be different. - $this->assertNotEqual( - $rendered_original_string, + $this->assertNotEquals( $original_string . "\n", + $rendered_original_string, 'Security test ' . $i . ' before translation' ); diff --git a/core/modules/node/tests/src/Functional/NodeFormSaveChangedTimeTest.php b/core/modules/node/tests/src/Functional/NodeFormSaveChangedTimeTest.php index e8268b204c6..d06998f6214 100644 --- a/core/modules/node/tests/src/Functional/NodeFormSaveChangedTimeTest.php +++ b/core/modules/node/tests/src/Functional/NodeFormSaveChangedTimeTest.php @@ -78,7 +78,7 @@ class NodeFormSaveChangedTimeTest extends BrowserTestBase { $storage->resetCache([1]); $node = $storage->load(1); - $this->assertNotEqual($changed_timestamp, $node->getChangedTime(), "The entity's changed time was updated after form save without changes."); + $this->assertNotEquals($node->getChangedTime(), $changed_timestamp, "The entity's changed time was updated after form save without changes."); } } diff --git a/core/modules/node/tests/src/Functional/NodeRevisionsTest.php b/core/modules/node/tests/src/Functional/NodeRevisionsTest.php index b6ec911e1d2..e6f4fe56f10 100644 --- a/core/modules/node/tests/src/Functional/NodeRevisionsTest.php +++ b/core/modules/node/tests/src/Functional/NodeRevisionsTest.php @@ -430,7 +430,7 @@ class NodeRevisionsTest extends NodeTestBase { $this->assertGreaterThan($translation_revision_id, $node->getRevisionId()); $this->assertEqual($node->label(), $default_translation_title); $this->assertEqual($node->getTranslation('it')->label(), $translated_title); - $this->assertNotEqual($node->untranslatable_string_field->value, $untranslatable_string); + $this->assertNotEquals($untranslatable_string, $node->untranslatable_string_field->value); $latest_revision_id = $translation->getRevisionId(); diff --git a/core/modules/node/tests/src/Functional/NodeRevisionsUiTest.php b/core/modules/node/tests/src/Functional/NodeRevisionsUiTest.php index 53b1dba2db6..615130ed048 100644 --- a/core/modules/node/tests/src/Functional/NodeRevisionsUiTest.php +++ b/core/modules/node/tests/src/Functional/NodeRevisionsUiTest.php @@ -79,7 +79,7 @@ class NodeRevisionsUiTest extends NodeTestBase { // Load the node again and check the revision is different from before. $node_storage->resetCache([$node->id()]); $node_revision = $node_storage->load($node->id()); - $this->assertNotEqual($node_revision->getRevisionId(), $node->getRevisionId(), "After an existing node is saved with 'Create new revision' checked, a new revision is created."); + $this->assertNotEquals($node->getRevisionId(), $node_revision->getRevisionId(), "After an existing node is saved with 'Create new revision' checked, a new revision is created."); } /** diff --git a/core/modules/node/tests/src/Kernel/NodeAccessRecordsTest.php b/core/modules/node/tests/src/Kernel/NodeAccessRecordsTest.php index 2705a315b3f..f595f5d4242 100644 --- a/core/modules/node/tests/src/Kernel/NodeAccessRecordsTest.php +++ b/core/modules/node/tests/src/Kernel/NodeAccessRecordsTest.php @@ -90,7 +90,7 @@ class NodeAccessRecordsTest extends NodeAccessTestBase { $grants = node_test_node_grants($web_user, $op); $altered_grants = $grants; \Drupal::moduleHandler()->alter('node_grants', $altered_grants, $web_user, $op); - $this->assertNotEqual($grants, $altered_grants, new FormattableMarkup('Altered the %op grant for a user.', ['%op' => $op])); + $this->assertNotEquals($grants, $altered_grants, new FormattableMarkup('Altered the %op grant for a user.', ['%op' => $op])); } // Check that core does not grant access to an unpublished node when an diff --git a/core/modules/rest/tests/src/Functional/Views/StyleSerializerTest.php b/core/modules/rest/tests/src/Functional/Views/StyleSerializerTest.php index f1bef15452a..2adf01ce1ea 100644 --- a/core/modules/rest/tests/src/Functional/Views/StyleSerializerTest.php +++ b/core/modules/rest/tests/src/Functional/Views/StyleSerializerTest.php @@ -352,7 +352,7 @@ class StyleSerializerTest extends ViewTestBase { $this->assertNotEmpty($render_cache->get($original)); // Ensure that the XML output is different from the JSON one. - $this->assertNotEqual($result1, $result_xml); + $this->assertNotEquals($result1, $result_xml); // Ensure that the cached page works. $result2 = Json::decode($this->drupalGet('test/serialize/entity', ['query' => ['_format' => 'json']])); @@ -368,7 +368,7 @@ class StyleSerializerTest extends ViewTestBase { $result3 = Json::decode($this->drupalGet('test/serialize/entity', ['query' => ['_format' => 'json']])); $this->addRequestWithFormat('json'); $this->assertSession()->responseHeaderEquals('content-type', 'application/json'); - $this->assertNotEqual($result3, $result2); + $this->assertNotEquals($result2, $result3); // Add the new entity cache tag and remove the first one, because we just // show 10 items in total. diff --git a/core/modules/search/tests/src/Functional/SearchAdvancedSearchFormTest.php b/core/modules/search/tests/src/Functional/SearchAdvancedSearchFormTest.php index e123f3e994f..50165e7922f 100644 --- a/core/modules/search/tests/src/Functional/SearchAdvancedSearchFormTest.php +++ b/core/modules/search/tests/src/Functional/SearchAdvancedSearchFormTest.php @@ -57,7 +57,7 @@ class SearchAdvancedSearchFormTest extends BrowserTestBase { // Verify some properties of the node that was created. $this->assertSame('page', $this->node->getType(), 'Node type is Basic page.'); $dummy_title = 'Lorem ipsum'; - $this->assertNotEqual($dummy_title, $this->node->label(), "Dummy title doesn't equal node title."); + $this->assertNotEquals($dummy_title, $this->node->label(), "Dummy title doesn't equal node title."); // Search for the dummy title with a GET query. $this->drupalGet('search/node', ['query' => ['keys' => $dummy_title]]); diff --git a/core/modules/search/tests/src/Functional/SearchNodeUpdateAndDeletionTest.php b/core/modules/search/tests/src/Functional/SearchNodeUpdateAndDeletionTest.php index 36dbe60693d..5f7fc07e412 100644 --- a/core/modules/search/tests/src/Functional/SearchNodeUpdateAndDeletionTest.php +++ b/core/modules/search/tests/src/Functional/SearchNodeUpdateAndDeletionTest.php @@ -106,7 +106,7 @@ class SearchNodeUpdateAndDeletionTest extends BrowserTestBase { ->condition('word', 'dragons') ->execute() ->fetchField(); - $this->assertNotEqual($search_index_dataset, FALSE, t('Node info found on the search_index')); + $this->assertNotFalse($search_index_dataset, t('Node info found on the search_index')); // Delete the node. $node->delete(); diff --git a/core/modules/shortcut/tests/src/Functional/ShortcutSetsTest.php b/core/modules/shortcut/tests/src/Functional/ShortcutSetsTest.php index 09005584ee5..e9a90a47f47 100644 --- a/core/modules/shortcut/tests/src/Functional/ShortcutSetsTest.php +++ b/core/modules/shortcut/tests/src/Functional/ShortcutSetsTest.php @@ -140,7 +140,7 @@ class ShortcutSetsTest extends ShortcutTestBase { ]; $this->drupalPostForm('user/' . $this->adminUser->id() . '/shortcuts', $edit, 'Change set'); $current_set = shortcut_current_displayed_set($this->adminUser); - $this->assertNotEqual($current_set->id(), $this->set->id(), 'A shortcut set can be switched to at the same time as it is created.'); + $this->assertNotEquals($this->set->id(), $current_set->id(), 'A shortcut set can be switched to at the same time as it is created.'); $this->assertEqual($current_set->label(), $edit['label'], 'The new set is correctly assigned to the user.'); } diff --git a/core/modules/system/tests/src/Functional/Entity/EntityFormTest.php b/core/modules/system/tests/src/Functional/Entity/EntityFormTest.php index 92285578acf..27435cb0105 100644 --- a/core/modules/system/tests/src/Functional/Entity/EntityFormTest.php +++ b/core/modules/system/tests/src/Functional/Entity/EntityFormTest.php @@ -93,7 +93,7 @@ class EntityFormTest extends BrowserTestBase { $this->assertNull($entity, new FormattableMarkup('%entity_type: The entity has been modified.', ['%entity_type' => $entity_type])); $entity = $this->loadEntityByName($entity_type, $name2); $this->assertNotNull($entity, new FormattableMarkup('%entity_type: Modified entity found in the database.', ['%entity_type' => $entity_type])); - $this->assertNotEqual($entity->name->value, $name1, new FormattableMarkup('%entity_type: The entity name has been modified.', ['%entity_type' => $entity_type])); + $this->assertNotEquals($name1, $entity->name->value, new FormattableMarkup('%entity_type: The entity name has been modified.', ['%entity_type' => $entity_type])); $this->drupalGet($entity_type . '/manage/' . $entity->id() . '/edit'); $this->clickLink(t('Delete')); diff --git a/core/modules/system/tests/src/Functional/Entity/EntityRevisionsTest.php b/core/modules/system/tests/src/Functional/Entity/EntityRevisionsTest.php index b7d063ca2f3..5c9a4403e47 100644 --- a/core/modules/system/tests/src/Functional/Entity/EntityRevisionsTest.php +++ b/core/modules/system/tests/src/Functional/Entity/EntityRevisionsTest.php @@ -147,8 +147,8 @@ class EntityRevisionsTest extends BrowserTestBase { // Check that the fields and properties contain new content. // Verify that the revision ID changed. $this->assertGreaterThan($legacy_revision_id, $entity->revision_id->value); - $this->assertNotEqual($entity->name->value, $legacy_name, new FormattableMarkup('%entity_type: Name changed.', ['%entity_type' => $entity_type])); - $this->assertNotEqual($entity->translatable_test_field->value, $legacy_text, new FormattableMarkup('%entity_type: Text changed.', ['%entity_type' => $entity_type])); + $this->assertNotEquals($legacy_name, $entity->name->value, new FormattableMarkup('%entity_type: Name changed.', ['%entity_type' => $entity_type])); + $this->assertNotEquals($legacy_text, $entity->translatable_test_field->value, new FormattableMarkup('%entity_type: Text changed.', ['%entity_type' => $entity_type])); } $revisions = $storage->loadMultipleRevisions($revision_ids); diff --git a/core/modules/system/tests/src/Functional/Form/FormStoragePageCacheTest.php b/core/modules/system/tests/src/Functional/Form/FormStoragePageCacheTest.php index df1f19ac7a2..0b9024c3230 100644 --- a/core/modules/system/tests/src/Functional/Form/FormStoragePageCacheTest.php +++ b/core/modules/system/tests/src/Functional/Form/FormStoragePageCacheTest.php @@ -55,7 +55,7 @@ class FormStoragePageCacheTest extends BrowserTestBase { $this->submitForm($edit, 'Save'); $this->assertText('No old build id'); $build_id_first_validation = $this->getFormBuildId(); - $this->assertNotEqual($build_id_initial, $build_id_first_validation, 'Build id changes when form validation fails'); + $this->assertNotEquals($build_id_initial, $build_id_first_validation, 'Build id changes when form validation fails'); // Trigger validation error by again submitting an empty title. $edit = ['title' => '']; @@ -76,8 +76,8 @@ class FormStoragePageCacheTest extends BrowserTestBase { $this->submitForm($edit, 'Save'); $this->assertText('No old build id'); $build_id_from_cache_first_validation = $this->getFormBuildId(); - $this->assertNotEqual($build_id_initial, $build_id_from_cache_first_validation, 'Build id changes when form validation fails'); - $this->assertNotEqual($build_id_first_validation, $build_id_from_cache_first_validation, 'Build id from first user is not reused'); + $this->assertNotEquals($build_id_initial, $build_id_from_cache_first_validation, 'Build id changes when form validation fails'); + $this->assertNotEquals($build_id_first_validation, $build_id_from_cache_first_validation, 'Build id from first user is not reused'); // Trigger validation error by again submitting an empty title. $edit = ['title' => '']; @@ -106,14 +106,14 @@ class FormStoragePageCacheTest extends BrowserTestBase { $this->assertNoText('No old build id'); $this->assertNoText($build_id_initial); $build_id_first_rebuild = $this->getFormBuildId(); - $this->assertNotEqual($build_id_initial, $build_id_first_rebuild, 'Build id changes on first rebuild.'); + $this->assertNotEquals($build_id_initial, $build_id_first_rebuild, 'Build id changes on first rebuild.'); // Trigger subsequent rebuild, should regenerate the build id again. $edit = ['title' => 'something']; $this->submitForm($edit, 'Rebuild'); $this->assertText($build_id_first_rebuild); $build_id_second_rebuild = $this->getFormBuildId(); - $this->assertNotEqual($build_id_first_rebuild, $build_id_second_rebuild, 'Build id changes on second rebuild.'); + $this->assertNotEquals($build_id_first_rebuild, $build_id_second_rebuild, 'Build id changes on second rebuild.'); } } diff --git a/core/modules/system/tests/src/Functional/Mail/HtmlToTextTest.php b/core/modules/system/tests/src/Functional/Mail/HtmlToTextTest.php index 82137262024..d4605398971 100644 --- a/core/modules/system/tests/src/Functional/Mail/HtmlToTextTest.php +++ b/core/modules/system/tests/src/Functional/Mail/HtmlToTextTest.php @@ -371,7 +371,7 @@ EOT; public function testRemoveTrailingWhitespace() { $text = "Hi there! \nHerp Derp"; $mail_lines = explode("\n", MailFormatHelper::wrapMail($text)); - $this->assertNotEqual(" ", substr($mail_lines[0], -1), 'Trailing whitespace removed.'); + $this->assertNotEquals(" ", substr($mail_lines[0], -1), 'Trailing whitespace removed.'); } /** diff --git a/core/modules/system/tests/src/Functional/Session/SessionTest.php b/core/modules/system/tests/src/Functional/Session/SessionTest.php index 8a19706b5e2..414ecb98477 100644 --- a/core/modules/system/tests/src/Functional/Session/SessionTest.php +++ b/core/modules/system/tests/src/Functional/Session/SessionTest.php @@ -265,7 +265,7 @@ class SessionTest extends BrowserTestBase { $this->drupalGet('session-test/set/foo'); $times2 = $query->execute()->fetchObject(); $this->assertEqual($times2->access, $times1->access, 'Users table was not updated.'); - $this->assertNotEqual($times2->timestamp, $times1->timestamp, 'Sessions table was updated.'); + $this->assertNotEquals($times1->timestamp, $times2->timestamp, 'Sessions table was updated.'); // Write the same value again, i.e. do not modify the session. sleep(1); @@ -289,8 +289,8 @@ class SessionTest extends BrowserTestBase { $this->writeSettings($settings); $this->drupalGet(''); $times5 = $query->execute()->fetchObject(); - $this->assertNotEqual($times5->access, $times4->access, 'Users table was updated.'); - $this->assertNotEqual($times5->timestamp, $times4->timestamp, 'Sessions table was updated.'); + $this->assertNotEquals($times4->access, $times5->access, 'Users table was updated.'); + $this->assertNotEquals($times4->timestamp, $times5->timestamp, 'Sessions table was updated.'); } /** diff --git a/core/modules/system/tests/src/Kernel/Form/ProgrammaticTest.php b/core/modules/system/tests/src/Kernel/Form/ProgrammaticTest.php index aacd9366955..8fca1ba5f63 100644 --- a/core/modules/system/tests/src/Kernel/Form/ProgrammaticTest.php +++ b/core/modules/system/tests/src/Kernel/Form/ProgrammaticTest.php @@ -113,7 +113,7 @@ class ProgrammaticTest extends KernelTestBase { $form_state->setProgrammedBypassAccessCheck(FALSE); \Drupal::formBuilder()->submitForm('\Drupal\form_test\Form\FormTestProgrammaticForm', $form_state); $values = $form_state->get('programmatic_form_submit'); - $this->assertNotEqual($values['field_restricted'], 'dummy value', 'The value for the restricted field is not stored.'); + $this->assertNotSame('dummy value', $values['field_restricted'], 'The value for the restricted field is not stored.'); } diff --git a/core/modules/toolbar/tests/src/Functional/ToolbarAdminMenuTest.php b/core/modules/toolbar/tests/src/Functional/ToolbarAdminMenuTest.php index f108b24dcd0..81e1933b1b9 100644 --- a/core/modules/toolbar/tests/src/Functional/ToolbarAdminMenuTest.php +++ b/core/modules/toolbar/tests/src/Functional/ToolbarAdminMenuTest.php @@ -340,7 +340,7 @@ class ToolbarAdminMenuTest extends BrowserTestBase { // Assert that the old admin menu subtrees hash and the new admin menu // subtrees hash are different. $this->assertNotEmpty($new_subtree_hash, 'A valid hash value for the admin menu subtrees was created.'); - $this->assertNotEqual($original_subtree_hash, $new_subtree_hash, 'The user-specific subtree menu hash has been updated.'); + $this->assertNotEquals($original_subtree_hash, $new_subtree_hash, 'The user-specific subtree menu hash has been updated.'); } /** @@ -379,7 +379,7 @@ class ToolbarAdminMenuTest extends BrowserTestBase { // Assert that the old admin menu subtree hash and the new admin menu // subtree hash are different. $this->assertNotEmpty($new_subtree_hash, 'A valid hash value for the admin menu subtrees was created.'); - $this->assertNotEqual($this->hash, $new_subtree_hash, 'The user-specific subtree menu hash has been updated.'); + $this->assertNotEquals($this->hash, $new_subtree_hash, 'The user-specific subtree menu hash has been updated.'); } /** @@ -442,7 +442,7 @@ class ToolbarAdminMenuTest extends BrowserTestBase { // Assert that the old admin menu subtree hash and the new admin menu // subtree hash are different. $this->assertNotEmpty($new_subtree_hash, 'A valid hash value for the admin menu subtrees was created.'); - $this->assertNotEqual($this->hash, $new_subtree_hash, 'The user-specific subtree menu hash has been updated.'); + $this->assertNotEquals($this->hash, $new_subtree_hash, 'The user-specific subtree menu hash has been updated.'); // Save the new subtree hash as the original. $this->hash = $new_subtree_hash; diff --git a/core/modules/user/tests/src/Functional/UserPermissionsTest.php b/core/modules/user/tests/src/Functional/UserPermissionsTest.php index 06301d606b5..b8b4c04bebe 100644 --- a/core/modules/user/tests/src/Functional/UserPermissionsTest.php +++ b/core/modules/user/tests/src/Functional/UserPermissionsTest.php @@ -78,7 +78,7 @@ class UserPermissionsTest extends BrowserTestBase { $this->assertTrue($account->hasPermission('administer users'), 'User now has "administer users" permission.'); $current_permissions_hash = $permissions_hash_generator->generate($account); $this->assertIdentical($current_permissions_hash, $permissions_hash_generator->generate($this->loggedInUser)); - $this->assertNotEqual($previous_permissions_hash, $current_permissions_hash, 'Permissions hash has changed.'); + $this->assertNotEquals($previous_permissions_hash, $current_permissions_hash, 'Permissions hash has changed.'); $previous_permissions_hash = $current_permissions_hash; // Remove a permission. @@ -91,7 +91,7 @@ class UserPermissionsTest extends BrowserTestBase { $this->assertFalse($account->hasPermission('access user profiles'), 'User no longer has "access user profiles" permission.'); $current_permissions_hash = $permissions_hash_generator->generate($account); $this->assertIdentical($current_permissions_hash, $permissions_hash_generator->generate($this->loggedInUser)); - $this->assertNotEqual($previous_permissions_hash, $current_permissions_hash, 'Permissions hash has changed.'); + $this->assertNotEquals($previous_permissions_hash, $current_permissions_hash, 'Permissions hash has changed.'); // Ensure that the admin role doesn't have any checkboxes. $this->drupalGet('admin/people/permissions'); @@ -173,7 +173,7 @@ class UserPermissionsTest extends BrowserTestBase { // Verify the permissions hash has changed. $current_permissions_hash = $permissions_hash_generator->generate($account); - $this->assertNotEqual($previous_permissions_hash, $current_permissions_hash, 'Permissions hash has changed.'); + $this->assertNotEquals($previous_permissions_hash, $current_permissions_hash, 'Permissions hash has changed.'); } /** diff --git a/core/modules/user/tests/src/Functional/Views/AccessRoleTest.php b/core/modules/user/tests/src/Functional/Views/AccessRoleTest.php index 166ce5850d3..cc9a9909989 100644 --- a/core/modules/user/tests/src/Functional/Views/AccessRoleTest.php +++ b/core/modules/user/tests/src/Functional/Views/AccessRoleTest.php @@ -127,7 +127,7 @@ class AccessRoleTest extends AccessTestBase { $this->assertContains('user.roles', $build['#cache']['contexts']); $this->assertEqual(['config:views.view.test_access_role'], $build['#cache']['tags']); $this->assertEqual(Cache::PERMANENT, $build['#cache']['max-age']); - $this->assertNotEqual($result, ''); + $this->assertNotSame('', $result); // Then without access. $build = DisplayPluginBase::buildBasicRenderable('test_access_role', 'default'); diff --git a/core/modules/views/tests/src/Kernel/Handler/SortRandomTest.php b/core/modules/views/tests/src/Kernel/Handler/SortRandomTest.php index 76738bcb3e5..a7593381b89 100644 --- a/core/modules/views/tests/src/Kernel/Handler/SortRandomTest.php +++ b/core/modules/views/tests/src/Kernel/Handler/SortRandomTest.php @@ -133,7 +133,7 @@ class SortRandomTest extends ViewsKernelTestBase { $result2 = $renderer->renderPlain($build); // Ensure that the random ordering works and don't produce the same result. - $this->assertNotEqual($result, $result2); + $this->assertNotEquals($result, $result2); } } diff --git a/core/modules/views/tests/src/Kernel/Plugin/CacheTest.php b/core/modules/views/tests/src/Kernel/Plugin/CacheTest.php index 0bc456c1b04..3daf154310c 100644 --- a/core/modules/views/tests/src/Kernel/Plugin/CacheTest.php +++ b/core/modules/views/tests/src/Kernel/Plugin/CacheTest.php @@ -166,7 +166,7 @@ class CacheTest extends ViewsKernelTestBase { // Get the cache item. $cid2 = $view->display_handler->getPlugin('cache')->generateResultsKey(); - $this->assertNotEqual($cid1, $cid2, "Results keys are different."); + $this->assertNotEquals($cid1, $cid2, "Results keys are different."); // Build the expected result. $dataset = [['name' => 'Ringo']]; diff --git a/core/tests/Drupal/KernelTests/AssertContentTrait.php b/core/tests/Drupal/KernelTests/AssertContentTrait.php index 47042edf571..48749a99c1b 100644 --- a/core/tests/Drupal/KernelTests/AssertContentTrait.php +++ b/core/tests/Drupal/KernelTests/AssertContentTrait.php @@ -849,7 +849,7 @@ trait AssertContentTrait { '@unexpected' => var_export($title, TRUE), ]); } - return $this->assertNotEqual($actual, $title, $message, $group); + return $this->assertNotEquals($title, $actual, $message, $group); } /** diff --git a/core/tests/Drupal/KernelTests/Core/Database/ConnectionTest.php b/core/tests/Drupal/KernelTests/Core/Database/ConnectionTest.php index 5df4cbf0144..cbbfeffc378 100644 --- a/core/tests/Drupal/KernelTests/Core/Database/ConnectionTest.php +++ b/core/tests/Drupal/KernelTests/Core/Database/ConnectionTest.php @@ -116,7 +116,7 @@ class ConnectionTest extends DatabaseTestBase { // Get a fresh copy of the default connection options. $connectionOptions = $db->getConnectionOptions(); - $this->assertNotEqual($connection_info['default']['database'], $connectionOptions['database'], 'The test connection info database does not match the current connection options database.'); + $this->assertNotEquals($connection_info['default']['database'], $connectionOptions['database'], 'The test connection info database does not match the current connection options database.'); } /** diff --git a/core/tests/Drupal/KernelTests/Core/Database/SelectComplexTest.php b/core/tests/Drupal/KernelTests/Core/Database/SelectComplexTest.php index da3b7d4766c..a8446643360 100644 --- a/core/tests/Drupal/KernelTests/Core/Database/SelectComplexTest.php +++ b/core/tests/Drupal/KernelTests/Core/Database/SelectComplexTest.php @@ -40,7 +40,7 @@ class SelectComplexTest extends DatabaseTestBase { foreach ($result as $record) { $num_records++; $this->assertGreaterThanOrEqual($last_priority, $record->$priority_field); - $this->assertNotEqual($record->$name_field, 'Ringo', 'Taskless person not selected.'); + $this->assertNotSame('Ringo', $record->$name_field, 'Taskless person not selected.'); $last_priority = $record->$priority_field; } @@ -333,7 +333,7 @@ class SelectComplexTest extends DatabaseTestBase { $query->where("[$alias].[name] <> [test].[name]"); $crowded_job = $query->execute()->fetch(); $this->assertEqual($crowded_job->job, $crowded_job->other_job, 'Correctly joined same table twice.'); - $this->assertNotEqual($crowded_job->name, $crowded_job->other_name, 'Correctly joined same table twice.'); + $this->assertNotEquals($crowded_job->other_name, $crowded_job->name, 'Correctly joined same table twice.'); } /** @@ -414,7 +414,7 @@ class SelectComplexTest extends DatabaseTestBase { $num_records++; // Verify that the results are returned in the correct order. $this->assertGreaterThanOrEqual($last_priority, $record->$priority_field); - $this->assertNotEqual($record->$name_field, 'Ringo', 'Taskless person not selected.'); + $this->assertNotSame('Ringo', $record->$name_field, 'Taskless person not selected.'); $last_priority = $record->$priority_field; } diff --git a/core/tests/Drupal/KernelTests/Core/Database/SelectTest.php b/core/tests/Drupal/KernelTests/Core/Database/SelectTest.php index 2fa6a45b3f1..b051bbadad4 100644 --- a/core/tests/Drupal/KernelTests/Core/Database/SelectTest.php +++ b/core/tests/Drupal/KernelTests/Core/Database/SelectTest.php @@ -468,7 +468,7 @@ class SelectTest extends DatabaseTestBase { ->orderRandom() ->execute() ->fetchCol(); - $this->assertNotEqual($randomized_ids, $ordered_ids, 'A query with random ordering returns an unordered set of IDs.'); + $this->assertNotEquals($ordered_ids, $randomized_ids, 'A query with random ordering returns an unordered set of IDs.'); $sorted_ids = $randomized_ids; sort($sorted_ids); $this->assertEqual($sorted_ids, $ordered_ids, 'After sorting the random list, the result matches the original query.'); @@ -481,7 +481,7 @@ class SelectTest extends DatabaseTestBase { ->orderRandom() ->execute() ->fetchCol(); - $this->assertNotEqual($randomized_ids_second_set, $randomized_ids, 'Performing the query with random ordering a second time returns IDs in a different order.'); + $this->assertNotEquals($randomized_ids, $randomized_ids_second_set, 'Performing the query with random ordering a second time returns IDs in a different order.'); $sorted_ids_second_set = $randomized_ids_second_set; sort($sorted_ids_second_set); $this->assertEqual($sorted_ids_second_set, $sorted_ids, 'After sorting the second random list, the result matches the sorted version of the first random list.'); diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityApiTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityApiTest.php index f9ec4d59a1f..fe3c273e0e0 100644 --- a/core/tests/Drupal/KernelTests/Core/Entity/EntityApiTest.php +++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityApiTest.php @@ -218,7 +218,7 @@ class EntityApiTest extends EntityKernelTestBase { $entity->save(); } catch (EntityStorageException $e) { - $this->assertNotEqual($e->getCode(), 1, 'Entity presave EntityStorageException caught.'); + $this->assertNotEquals(1, $e->getCode(), 'Entity presave EntityStorageException caught.'); } $entity = EntityTest::create(['name' => 'test3']); @@ -239,7 +239,7 @@ class EntityApiTest extends EntityKernelTestBase { $entity->delete(); } catch (EntityStorageException $e) { - $this->assertNotEqual($e->getCode(), 2, 'Entity predelete EntityStorageException thrown.'); + $this->assertNotEquals(2, $e->getCode(), 'Entity predelete EntityStorageException thrown.'); } } diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntitySchemaTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntitySchemaTest.php index 0e655446334..24588716b0e 100644 --- a/core/tests/Drupal/KernelTests/Core/Entity/EntitySchemaTest.php +++ b/core/tests/Drupal/KernelTests/Core/Entity/EntitySchemaTest.php @@ -347,7 +347,7 @@ class EntitySchemaTest extends EntityKernelTestBase { } // Ensure that there are storage definitions from the entity_test module. - $this->assertNotEqual($entity_type_id_count, 0, 'There are storage definitions provided by the entity_test module in the schema.'); + $this->assertNotEquals(0, $entity_type_id_count, 'There are storage definitions provided by the entity_test module in the schema.'); // Uninstall the entity_test module. $this->container->get('module_installer')->uninstall(['entity_test']); diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityTranslationTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityTranslationTest.php index f2bacb683af..8a2ae7f0a12 100644 --- a/core/tests/Drupal/KernelTests/Core/Entity/EntityTranslationTest.php +++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityTranslationTest.php @@ -522,7 +522,7 @@ class EntityTranslationTest extends EntityLanguageTestBase { $this->assertEqual($entity->name->value, $name, 'No stale reference for the translation object corresponding to the original language.'); $translation2 = $entity->getTranslation($langcode); $translation2->name->value .= $this->randomMachineName(); - $this->assertNotEqual($translation->name->value, $translation2->name->value, 'No stale reference for the actual translation object.'); + $this->assertNotEquals($translation->name->value, $translation2->name->value, 'No stale reference for the actual translation object.'); $this->assertEqual($entity, $translation2->getUntranslated(), 'No stale reference in the actual translation object.'); // Verify that deep-cloning is still available when we are not instantiating diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityUUIDTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityUUIDTest.php index 75fb5d0c228..a28beb485aa 100644 --- a/core/tests/Drupal/KernelTests/Core/Entity/EntityUUIDTest.php +++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityUUIDTest.php @@ -58,7 +58,7 @@ class EntityUUIDTest extends EntityKernelTestBase { $this->assertNotEmpty($uuid); // Verify that the new UUID is different. - $this->assertNotEqual($custom_entity->uuid(), $uuid); + $this->assertNotEquals($custom_entity->uuid(), $uuid); // Verify that the UUID is retained upon saving. $entity->save(); @@ -84,20 +84,20 @@ class EntityUUIDTest extends EntityKernelTestBase { case 'uuid': $this->assertNotNull($entity_duplicate->uuid()); $this->assertNotNull($entity->uuid()); - $this->assertNotEqual($entity_duplicate->uuid(), $entity->uuid()); + $this->assertNotEquals($entity->uuid(), $entity_duplicate->uuid()); break; case 'id': $this->assertNull($entity_duplicate->id()); $this->assertNotNull($entity->id()); - $this->assertNotEqual($entity_duplicate->id(), $entity->id()); + $this->assertNotEquals($entity->id(), $entity_duplicate->id()); break; case 'revision_id': $this->assertNull($entity_duplicate->getRevisionId()); $this->assertNotNull($entity->getRevisionId()); - $this->assertNotEqual($entity_duplicate->getRevisionId(), $entity->getRevisionId()); - $this->assertNotEqual($entity_duplicate->{$property}->getValue(), $entity->{$property}->getValue()); + $this->assertNotEquals($entity->getRevisionId(), $entity_duplicate->getRevisionId()); + $this->assertNotEquals($entity->{$property}->getValue(), $entity_duplicate->{$property}->getValue()); break; default: @@ -105,7 +105,7 @@ class EntityUUIDTest extends EntityKernelTestBase { } } $entity_duplicate->save(); - $this->assertNotEqual($entity->id(), $entity_duplicate->id()); + $this->assertNotEquals($entity_duplicate->id(), $entity->id()); } } diff --git a/core/tests/Drupal/KernelTests/Core/Entity/FieldSqlStorageTest.php b/core/tests/Drupal/KernelTests/Core/Entity/FieldSqlStorageTest.php index 73ef33d732d..f19a3248620 100644 --- a/core/tests/Drupal/KernelTests/Core/Entity/FieldSqlStorageTest.php +++ b/core/tests/Drupal/KernelTests/Core/Entity/FieldSqlStorageTest.php @@ -539,8 +539,8 @@ class FieldSqlStorageTest extends EntityKernelTestBase { 'field_name' => $field_name . '2', 'type' => 'test_field', ]); - $this->assertNotEqual($this->tableMapping->getDedicatedDataTableName($field_storage), $this->tableMapping->getDedicatedDataTableName($field_storage2)); - $this->assertNotEqual($this->tableMapping->getDedicatedRevisionTableName($field_storage), $this->tableMapping->getDedicatedRevisionTableName($field_storage2)); + $this->assertNotEquals($this->tableMapping->getDedicatedDataTableName($field_storage), $this->tableMapping->getDedicatedDataTableName($field_storage2)); + $this->assertNotEquals($this->tableMapping->getDedicatedRevisionTableName($field_storage), $this->tableMapping->getDedicatedRevisionTableName($field_storage2)); // Deleted field. $field_storage = FieldStorageConfig::create([ diff --git a/core/tests/Drupal/KernelTests/Core/File/DirectoryTest.php b/core/tests/Drupal/KernelTests/Core/File/DirectoryTest.php index 6e715deb0ac..246e29e9ea1 100644 --- a/core/tests/Drupal/KernelTests/Core/File/DirectoryTest.php +++ b/core/tests/Drupal/KernelTests/Core/File/DirectoryTest.php @@ -164,7 +164,7 @@ class DirectoryTest extends FileTestBase { $path = $file_system->getDestinationFilename($destination, FileSystemInterface::EXISTS_REPLACE); $this->assertEqual($path, $destination, 'Existing filepath destination remains the same with FileSystemInterface::EXISTS_REPLACE.', 'File'); $path = $file_system->getDestinationFilename($destination, FileSystemInterface::EXISTS_RENAME); - $this->assertNotEqual($path, $destination, 'A new filepath destination is created when filepath destination already exists with FileSystemInterface::EXISTS_RENAME.', 'File'); + $this->assertNotEquals($destination, $path, 'A new filepath destination is created when filepath destination already exists with FileSystemInterface::EXISTS_RENAME.'); $path = $file_system->getDestinationFilename($destination, FileSystemInterface::EXISTS_ERROR); $this->assertEqual($path, FALSE, 'An error is returned when filepath destination already exists with FileSystemInterface::EXISTS_ERROR.', 'File'); diff --git a/core/tests/Drupal/KernelTests/Core/File/FileCopyTest.php b/core/tests/Drupal/KernelTests/Core/File/FileCopyTest.php index c3f5cf66a20..c62843e4cf4 100644 --- a/core/tests/Drupal/KernelTests/Core/File/FileCopyTest.php +++ b/core/tests/Drupal/KernelTests/Core/File/FileCopyTest.php @@ -36,7 +36,7 @@ class FileCopyTest extends FileTestBase { $this->assertNotFalse(file_put_contents($desired_filepath, ' '), 'Created a file so a rename will have to happen.'); $newer_filepath = \Drupal::service('file_system')->copy($uri, $desired_filepath, FileSystemInterface::EXISTS_RENAME); $this->assertNotFalse($newer_filepath, 'Copy was successful.'); - $this->assertNotEqual($newer_filepath, $desired_filepath, 'Returned expected filepath.'); + $this->assertNotEquals($desired_filepath, $newer_filepath, 'Returned expected filepath.'); $this->assertFileExists($uri); $this->assertFileExists($newer_filepath); $this->assertFilePermissions($newer_filepath, Settings::get('file_chmod_file', FileSystem::CHMOD_FILE)); @@ -69,7 +69,7 @@ class FileCopyTest extends FileTestBase { $file_system = \Drupal::service('file_system'); $new_filepath = $file_system->copy($uri, $uri, FileSystemInterface::EXISTS_RENAME); $this->assertNotFalse($new_filepath, 'Copying onto itself with renaming works.'); - $this->assertNotEqual($new_filepath, $uri, 'Copied file has a new name.'); + $this->assertNotEquals($uri, $new_filepath, 'Copied file has a new name.'); $this->assertFileExists($uri); $this->assertFileExists($new_filepath); $this->assertFilePermissions($new_filepath, Settings::get('file_chmod_file', FileSystem::CHMOD_FILE)); @@ -88,7 +88,7 @@ class FileCopyTest extends FileTestBase { // Copy the file into same directory with renaming works. $new_filepath = $file_system->copy($uri, $file_system->dirname($uri), FileSystemInterface::EXISTS_RENAME); $this->assertNotFalse($new_filepath, 'Copying into same directory works.'); - $this->assertNotEqual($new_filepath, $uri, 'Copied file has a new name.'); + $this->assertNotEquals($uri, $new_filepath, 'Copied file has a new name.'); $this->assertFileExists($uri); $this->assertFileExists($new_filepath); $this->assertFilePermissions($new_filepath, Settings::get('file_chmod_file', FileSystem::CHMOD_FILE)); diff --git a/core/tests/Drupal/KernelTests/Core/File/FileMoveTest.php b/core/tests/Drupal/KernelTests/Core/File/FileMoveTest.php index 155ef1f8bf9..bc9dfaa2d8f 100644 --- a/core/tests/Drupal/KernelTests/Core/File/FileMoveTest.php +++ b/core/tests/Drupal/KernelTests/Core/File/FileMoveTest.php @@ -39,7 +39,7 @@ class FileMoveTest extends FileTestBase { $this->assertNotFalse(file_put_contents($desired_filepath, ' '), 'Created a file so a rename will have to happen.'); $newer_filepath = $file_system->move($new_filepath, $desired_filepath, FileSystemInterface::EXISTS_RENAME); $this->assertNotFalse($newer_filepath, 'Move was successful.'); - $this->assertNotEqual($newer_filepath, $desired_filepath, 'Returned expected filepath.'); + $this->assertNotEquals($desired_filepath, $newer_filepath, 'Returned expected filepath.'); $this->assertFileExists($newer_filepath); $this->assertFileNotExists($new_filepath); $this->assertFilePermissions($newer_filepath, Settings::get('file_chmod_file', FileSystem::CHMOD_FILE)); diff --git a/core/tests/Drupal/KernelTests/Core/File/NameMungingTest.php b/core/tests/Drupal/KernelTests/Core/File/NameMungingTest.php index 26f54f97fcc..0568aacd3b8 100644 --- a/core/tests/Drupal/KernelTests/Core/File/NameMungingTest.php +++ b/core/tests/Drupal/KernelTests/Core/File/NameMungingTest.php @@ -66,7 +66,7 @@ class NameMungingTest extends FileTestBase { $messages = \Drupal::messenger()->all(); \Drupal::messenger()->deleteAll(); $this->assertContainsEquals(strtr('For security reasons, your upload has been renamed to %filename.', ['%filename' => $munged_name]), $messages['status'], 'Alert properly set when a file is renamed.'); - $this->assertNotEqual($munged_name, $this->name, new FormattableMarkup('The new filename (%munged) has been modified from the original (%original)', ['%munged' => $munged_name, '%original' => $this->name])); + $this->assertNotEquals($this->name, $munged_name, new FormattableMarkup('The new filename (%munged) has been modified from the original (%original)', ['%munged' => $munged_name, '%original' => $this->name])); } /** diff --git a/core/tests/Drupal/KernelTests/Core/KeyValueStore/KeyValueContentEntityStorageTest.php b/core/tests/Drupal/KernelTests/Core/KeyValueStore/KeyValueContentEntityStorageTest.php index d96f7dca42d..092cf1e0b50 100644 --- a/core/tests/Drupal/KernelTests/Core/KeyValueStore/KeyValueContentEntityStorageTest.php +++ b/core/tests/Drupal/KernelTests/Core/KeyValueStore/KeyValueContentEntityStorageTest.php @@ -94,7 +94,7 @@ class KeyValueContentEntityStorageTest extends KernelTestBase { ]); $this->assertIdentical($entity_test->id->value, $expected['id']); $this->assertNotEmpty($entity_test->uuid->value); - $this->assertNotEqual($entity_test->uuid->value, $empty->uuid->value); + $this->assertNotEquals($empty->uuid->value, $entity_test->uuid->value); $this->assertIdentical($entity_test->name->value, $expected['name']); $this->assertIdentical($entity_test->langcode->value, $default_langcode); diff --git a/core/tests/Drupal/KernelTests/Core/Theme/TwigEnvironmentTest.php b/core/tests/Drupal/KernelTests/Core/Theme/TwigEnvironmentTest.php index 21b4931e31e..941bb2f7e0e 100644 --- a/core/tests/Drupal/KernelTests/Core/Theme/TwigEnvironmentTest.php +++ b/core/tests/Drupal/KernelTests/Core/Theme/TwigEnvironmentTest.php @@ -177,7 +177,7 @@ class TwigEnvironmentTest extends KernelTestBase { $new_extension_filename = $cache->generateKey($template_path, $class); \Drupal::getContainer()->set('twig', NULL); - $this->assertNotEqual($new_extension_filename, $original_filename); + $this->assertNotEquals($original_filename, $new_extension_filename); } /** diff --git a/core/tests/Drupal/KernelTests/KernelTestBaseTest.php b/core/tests/Drupal/KernelTests/KernelTestBaseTest.php index 909e4b5d9bd..ffb3f4b57ea 100644 --- a/core/tests/Drupal/KernelTests/KernelTestBaseTest.php +++ b/core/tests/Drupal/KernelTests/KernelTestBaseTest.php @@ -338,6 +338,16 @@ class KernelTestBaseTest extends KernelTestBase { $this->assertIdenticalObject((object) ['foo' => 'bar'], (object) ['foo' => 'bar']); } + /** + * Tests the deprecation of AssertLegacyTrait::assertNotEqual. + * + * @group legacy + */ + public function testAssertNotEqual() { + $this->expectDeprecation('AssertLegacyTrait::assertNotEqual() is deprecated in drupal:8.0.0 and is removed from drupal:10.0.0. Use $this->assertNotEquals() instead. See https://www.drupal.org/node/3129738'); + $this->assertNotEqual('foo', 'bar'); + } + /** * Tests the deprecation of AssertLegacyTrait::assertNotIdentical. * diff --git a/core/tests/Drupal/Tests/Listeners/DeprecationListenerTrait.php b/core/tests/Drupal/Tests/Listeners/DeprecationListenerTrait.php index 3307d4b12d1..ad1d7763a7b 100644 --- a/core/tests/Drupal/Tests/Listeners/DeprecationListenerTrait.php +++ b/core/tests/Drupal/Tests/Listeners/DeprecationListenerTrait.php @@ -122,7 +122,6 @@ trait DeprecationListenerTrait { // Simpletest's legacy assertion methods. 'UiHelperTrait::drupalPostForm() is deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. Use $this->submitForm() instead. See https://www.drupal.org/node/3168858', 'AssertLegacyTrait::assertEqual() is deprecated in drupal:8.0.0 and is removed from drupal:10.0.0. Use $this->assertEquals() instead. See https://www.drupal.org/node/3129738', - 'AssertLegacyTrait::assertNotEqual() is deprecated in drupal:8.0.0 and is removed from drupal:10.0.0. Use $this->assertNotEquals() instead. See https://www.drupal.org/node/3129738', 'AssertLegacyTrait::assertIdentical() is deprecated in drupal:8.0.0 and is removed from drupal:10.0.0. Use $this->assertSame() instead. See https://www.drupal.org/node/3129738', 'AssertLegacyTrait::assertText() is deprecated in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->responseContains() or $this->assertSession()->pageTextContains() instead. See https://www.drupal.org/node/3129738', 'AssertLegacyTrait::assertNoText() is deprecated in drupal:8.2.0 and is removed from drupal:10.0.0. Use $this->assertSession()->responseNotContains() or $this->assertSession()->pageTextNotContains() instead. See https://www.drupal.org/node/3129738',