Commit 39bacf44 authored by catch's avatar catch
Browse files

Issue #3192427 by mondrake, daffie: Replace usages of deprecated AssertLegacyTrait::assertNotEqual

parent 3302b4e0
......@@ -100,7 +100,7 @@ public function testCRUD() {
'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);
......
......@@ -96,7 +96,7 @@ public function testExportImport() {
$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();
......
......@@ -251,7 +251,7 @@ public function testImportLock() {
$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 @@ public function testImportValidation() {
$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() {
......
......@@ -61,7 +61,7 @@ public function testTransformedExportImport() {
$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();
......
......@@ -199,7 +199,7 @@ public function testSiteWideContact() {
$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);
......
......@@ -133,10 +133,10 @@ public function testSetTranslatable() {
$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.');
}
}
......@@ -138,7 +138,7 @@ protected function doTestBasicTranslation() {
$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 @@ public function doTestChangedTimeAfterSaveWithoutChanges() {
$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.');
}
}
......
......@@ -71,7 +71,7 @@ public function testMessages() {
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']));
}
......
......@@ -40,7 +40,7 @@ public function testNotApplicableFallback() {
$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');
}
......
......@@ -51,7 +51,7 @@ public function testNotApplicableFallback() {
$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');
}
......
......@@ -54,9 +54,9 @@ public function testAnonymousNode() {
$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 @@ public function testAnonymousNodeWithFile() {
$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 @@ protected function doTestNodeWithFileWithoutTitle() {
$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());
}
}
......
......@@ -154,7 +154,7 @@ public function uploadNodeFiles(array $files, $field_name, $nid_or_type, $new_re
$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();
......
......@@ -333,7 +333,7 @@ public function testPrivateFileComment() {
$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);
......
......@@ -113,8 +113,8 @@ public function assertFileUnchanged(FileInterface $before, FileInterface $after)
* 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()]));
}
/**
......
......@@ -58,7 +58,7 @@ public function testExistingRename() {
// 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']);
......
......@@ -126,8 +126,8 @@ public function assertFileUnchanged(FileInterface $before, FileInterface $after)
* 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()]));
}
/**
......
......@@ -75,7 +75,7 @@ public function testExistingRename() {
// 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.');
}
/**
......
......@@ -177,7 +177,7 @@ public function doImageStyleUrlAndPathTests($scheme, $clean_url = TRUE, $extra_s
// 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) {
......
......@@ -96,7 +96,7 @@ private function checkUrl(LanguageInterface $language, $message) {
// 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");
......
......@@ -390,7 +390,7 @@ protected function deleteLocaleTranslationData($config_name, $key, $source_value
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 @@ protected function assertNoConfigOverride($config_name, $langcode) {
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);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment