diff --git a/core/modules/aggregator/src/Tests/AggregatorTestBase.php b/core/modules/aggregator/src/Tests/AggregatorTestBase.php
index 10f95b2..f422489 100644
--- a/core/modules/aggregator/src/Tests/AggregatorTestBase.php
+++ b/core/modules/aggregator/src/Tests/AggregatorTestBase.php
@@ -187,7 +187,7 @@ public function updateFeedItems(FeedInterface $feed, $expected_count = NULL) {
if ($expected_count !== NULL) {
$feed->item_count = count($feed->items);
- $this->assertEquals($expected_count, $feed->item_count, format_string('Total items in feed equal to the total items in database (@val1 != @val2)', ['@val1' => $expected_count, '@val2' => $feed->item_count]));
+ $this->assertEqual($expected_count, $feed->item_count, format_string('Total items in feed equal to the total items in database (@val1 != @val2)', ['@val1' => $expected_count, '@val2' => $feed->item_count]));
}
}
diff --git a/core/modules/block_content/src/Tests/Views/BlockContentTestBase.php b/core/modules/block_content/src/Tests/Views/BlockContentTestBase.php
index 2680510..3ea2dba 100644
--- a/core/modules/block_content/src/Tests/Views/BlockContentTestBase.php
+++ b/core/modules/block_content/src/Tests/Views/BlockContentTestBase.php
@@ -73,7 +73,7 @@ protected function createBlockContent(array $settings = []) {
if ($block_content = BlockContent::create($settings)) {
$status = $block_content->save();
}
- $this->assertEquals($status, SAVED_NEW, SafeMarkup::format('Created block content %info.', ['%info' => $block_content->label()]));
+ $this->assertEqual($status, SAVED_NEW, SafeMarkup::format('Created block content %info.', ['%info' => $block_content->label()]));
return $block_content;
}
@@ -105,7 +105,7 @@ protected function createBlockContentType(array $values = []) {
$status = $bundle->save();
block_content_add_body_field($bundle->id());
- $this->assertEquals($status, SAVED_NEW, SafeMarkup::format('Created block content type %bundle.', ['%bundle' => $bundle->id()]));
+ $this->assertEqual($status, SAVED_NEW, SafeMarkup::format('Created block content type %bundle.', ['%bundle' => $bundle->id()]));
return $bundle;
}
diff --git a/core/modules/block_content/tests/src/Functional/BlockContentTranslationUITest.php b/core/modules/block_content/tests/src/Functional/BlockContentTranslationUITest.php
index c1f76a8..2699fcf 100644
--- a/core/modules/block_content/tests/src/Functional/BlockContentTranslationUITest.php
+++ b/core/modules/block_content/tests/src/Functional/BlockContentTranslationUITest.php
@@ -172,7 +172,7 @@ public function testDisabledBundle() {
// Make sure that only a single row was inserted into the block table.
$rows = db_query('SELECT * FROM {block_content_field_data} WHERE id = :id', [':id' => $enabled_block_content->id()])->fetchAll();
- $this->assertEquals(1, count($rows));
+ $this->assertEqual(1, count($rows));
}
/**
diff --git a/core/modules/comment/src/Tests/CommentNewIndicatorTest.php b/core/modules/comment/src/Tests/CommentNewIndicatorTest.php
index 9bb3f14..318e17c 100644
--- a/core/modules/comment/src/Tests/CommentNewIndicatorTest.php
+++ b/core/modules/comment/src/Tests/CommentNewIndicatorTest.php
@@ -109,8 +109,8 @@ public function testCommentNewCommentsIndicator() {
// The data will be pre-seeded on this particular page in drupalSettings, to
// avoid the need for the client to make a separate request to the server.
$settings = $this->getDrupalSettings();
- $this->assertEquals($settings['history'], ['lastReadTimestamps' => [1 => 0]]);
- $this->assertEquals($settings['comment'], [
+ $this->assertEqual($settings['history'], ['lastReadTimestamps' => [1 => 0]]);
+ $this->assertEqual($settings['comment'], [
'newCommentsLinks' => [
'node' => [
'comment' => [
diff --git a/core/modules/comment/src/Tests/CommentPagerTest.php b/core/modules/comment/src/Tests/CommentPagerTest.php
index 4ab53ce..48326bc 100644
--- a/core/modules/comment/src/Tests/CommentPagerTest.php
+++ b/core/modules/comment/src/Tests/CommentPagerTest.php
@@ -218,7 +218,7 @@ public function assertCommentOrder(array $comments, array $expected_order) {
foreach ($comment_anchors as $anchor) {
$result_order[] = substr($anchor['id'], 8);
}
- return $this->assertEquals($expected_cids, $result_order, format_string('Comment order: expected @expected, returned @returned.', ['@expected' => implode(',', $expected_cids), '@returned' => implode(',', $result_order)]));
+ return $this->assertEqual($expected_cids, $result_order, format_string('Comment order: expected @expected, returned @returned.', ['@expected' => implode(',', $expected_cids), '@returned' => implode(',', $result_order)]));
}
/**
@@ -309,7 +309,7 @@ public function testCommentNewPageIndicator() {
foreach ($expected_pages as $new_replies => $expected_page) {
$returned_page = \Drupal::entityManager()->getStorage('comment')
->getNewCommentPageNumber($node->get('comment')->comment_count, $new_replies, $node, 'comment');
- $this->assertEquals($expected_page, $returned_page, format_string('Threaded mode, @new replies: expected page @expected, returned page @returned.', ['@new' => $new_replies, '@expected' => $expected_page, '@returned' => $returned_page]));
+ $this->assertEqual($expected_page, $returned_page, format_string('Threaded mode, @new replies: expected page @expected, returned page @returned.', ['@new' => $new_replies, '@expected' => $expected_page, '@returned' => $returned_page]));
}
}
diff --git a/core/modules/content_translation/src/Tests/ContentTranslationUITestBase.php b/core/modules/content_translation/src/Tests/ContentTranslationUITestBase.php
index 70bf24d..e7a7dfc 100644
--- a/core/modules/content_translation/src/Tests/ContentTranslationUITestBase.php
+++ b/core/modules/content_translation/src/Tests/ContentTranslationUITestBase.php
@@ -101,7 +101,7 @@ protected function doTestBasicTranslation() {
$stored_value = $this->getValue($translation, $property, $default_langcode);
$value = is_array($value) ? $value[0]['value'] : $value;
$message = format_string('@property correctly stored in the default language.', ['@property' => $property]);
- $this->assertEquals($stored_value, $value, $message);
+ $this->assertEqual($stored_value, $value, $message);
}
// Add a content translation.
@@ -140,7 +140,7 @@ protected function doTestBasicTranslation() {
$author_field_name = $entity->hasField('content_translation_uid') ? 'content_translation_uid' : 'uid';
if ($entity->getFieldDefinition($author_field_name)->isTranslatable()) {
- $this->assertEquals($metadata_target_translation->getAuthor()->id(), $this->translator->id(),
+ $this->assertEqual($metadata_target_translation->getAuthor()->id(), $this->translator->id(),
SafeMarkup::format('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(),
@@ -148,7 +148,7 @@ protected function doTestBasicTranslation() {
['@target' => $langcode, '@source' => $default_langcode]));
}
else {
- $this->assertEquals($metadata_target_translation->getAuthor()->id(), $this->editor->id(), 'Author of the entity remained untouched after translation for non translatable owner field.');
+ $this->assertEqual($metadata_target_translation->getAuthor()->id(), $this->editor->id(), 'Author of the entity remained untouched after translation for non translatable owner field.');
}
$created_field_name = $entity->hasField('content_translation_created') ? 'content_translation_created' : 'created';
@@ -158,7 +158,7 @@ protected function doTestBasicTranslation() {
['@target' => $langcode, '@source' => $default_langcode]));
}
else {
- $this->assertEquals($metadata_target_translation->getCreatedTime(), $metadata_source_translation->getCreatedTime(), 'Creation timestamp of the entity remained untouched after translation for non translatable created field.');
+ $this->assertEqual($metadata_target_translation->getCreatedTime(), $metadata_source_translation->getCreatedTime(), 'Creation timestamp of the entity remained untouched after translation for non translatable created field.');
}
if ($this->testLanguageSelector) {
@@ -207,7 +207,7 @@ protected function doTestBasicTranslation() {
$stored_value = $this->getValue($translation, $property, $langcode);
$value = is_array($value) ? $value[0]['value'] : $value;
$message = format_string('%property correctly stored with language %language.', ['%property' => $property, '%language' => $langcode]);
- $this->assertEquals($stored_value, $value, $message);
+ $this->assertEqual($stored_value, $value, $message);
}
}
}
@@ -229,10 +229,10 @@ protected function doTestTranslationOverview() {
$language = new Language(['id' => $langcode]);
$view_url = $entity->url('canonical', ['language' => $language]);
$elements = $this->xpath('//table//a[@href=:href]', [':href' => $view_url]);
- $this->assertEquals((string) $elements[0], $entity->getTranslation($langcode)->label(), format_string('Label correctly shown for %language translation.', ['%language' => $langcode]));
+ $this->assertEqual((string) $elements[0], $entity->getTranslation($langcode)->label(), format_string('Label correctly shown for %language translation.', ['%language' => $langcode]));
$edit_path = $entity->url('edit-form', ['language' => $language]);
$elements = $this->xpath('//table//ul[@class="dropbutton"]/li/a[@href=:href]', [':href' => $edit_path]);
- $this->assertEquals((string) $elements[0], t('Edit'), format_string('Edit link correct for %language translation.', ['%language' => $langcode]));
+ $this->assertEqual((string) $elements[0], t('Edit'), format_string('Edit link correct for %language translation.', ['%language' => $langcode]));
}
}
}
@@ -339,8 +339,8 @@ protected function doTestAuthoringInfo() {
$entity = $storage->load($this->entityId);
foreach ($this->langcodes as $langcode) {
$metadata = $this->manager->getTranslationMetadata($entity->getTranslation($langcode));
- $this->assertEquals($metadata->getAuthor()->id(), $values[$langcode]['uid'], 'Translation author correctly stored.');
- $this->assertEquals($metadata->getCreatedTime(), $values[$langcode]['created'], 'Translation date correctly stored.');
+ $this->assertEqual($metadata->getAuthor()->id(), $values[$langcode]['uid'], 'Translation author correctly stored.');
+ $this->assertEqual($metadata->getCreatedTime(), $values[$langcode]['created'], 'Translation date correctly stored.');
}
// Try to post non valid values and check that they are rejected.
@@ -353,8 +353,8 @@ protected function doTestAuthoringInfo() {
$this->drupalPostForm($entity->urlInfo('edit-form'), $edit, $this->getFormSubmitAction($entity, $langcode));
$this->assertTrue($this->xpath('//div[contains(@class, "error")]//ul'), 'Invalid values generate a list of form errors.');
$metadata = $this->manager->getTranslationMetadata($entity->getTranslation($langcode));
- $this->assertEquals($metadata->getAuthor()->id(), $values[$langcode]['uid'], 'Translation author correctly kept.');
- $this->assertEquals($metadata->getCreatedTime(), $values[$langcode]['created'], 'Translation date correctly kept.');
+ $this->assertEqual($metadata->getAuthor()->id(), $values[$langcode]['uid'], 'Translation author correctly kept.');
+ $this->assertEqual($metadata->getCreatedTime(), $values[$langcode]['created'], 'Translation date correctly kept.');
}
/**
@@ -565,7 +565,7 @@ protected function doTestTranslationChanged() {
->getStorage($this->entityTypeId);
$storage->resetCache([$this->entityId]);
$entity = $storage->load($this->entityId);
- $this->assertEquals(
+ $this->assertEqual(
$entity->getChangedTimeAcrossTranslations(), $entity->getTranslation($langcode)->getChangedTime(),
format_string('Changed time for language %language is the latest change over all languages.', ['%language' => $language->getName()])
);
@@ -580,13 +580,13 @@ protected function doTestTranslationChanged() {
}
if ($translatable_changed_field) {
- $this->assertEquals(
+ $this->assertEqual(
count($timestamps), count($entity->getTranslationLanguages()),
'All timestamps from all languages are different.'
);
}
else {
- $this->assertEquals(
+ $this->assertEqual(
count($timestamps), 1,
'All timestamps from all languages are identical.'
);
@@ -611,7 +611,7 @@ public function doTestChangedTimeAfterSaveWithoutChanges() {
->getStorage($this->entityTypeId);
$storage->resetCache([$this->entityId]);
$entity = $storage->load($this->entityId);
- $this->assertEquals($changed_timestamp, $entity->getChangedTime(), 'The entity\'s changed time wasn\'t updated after API save without changes.');
+ $this->assertEqual($changed_timestamp, $entity->getChangedTime(), 'The entity\'s changed time wasn\'t updated after API save without changes.');
// Ensure different save timestamps.
sleep(1);
diff --git a/core/modules/content_translation/tests/src/Functional/ContentTranslationLanguageChangeTest.php b/core/modules/content_translation/tests/src/Functional/ContentTranslationLanguageChangeTest.php
index 651246e..ae326ef 100644
--- a/core/modules/content_translation/tests/src/Functional/ContentTranslationLanguageChangeTest.php
+++ b/core/modules/content_translation/tests/src/Functional/ContentTranslationLanguageChangeTest.php
@@ -110,7 +110,7 @@ public function testTitleDoesNotChangesOnChangingLanguageWidgetAndTriggeringAjax
'test_field_only_en_fr' => 'node created',
];
$this->drupalPostForm(NULL, $edit, t('Save'));
- $this->assertEquals('node created', \Drupal::state()->get('test_field_only_en_fr'));
+ $this->assertEqual('node created', \Drupal::state()->get('test_field_only_en_fr'));
// Create a translation in French.
$this->clickLink('Translate');
diff --git a/core/modules/editor/src/Tests/EditorUploadImageScaleTest.php b/core/modules/editor/src/Tests/EditorUploadImageScaleTest.php
index 3c58471..100fb4f 100644
--- a/core/modules/editor/src/Tests/EditorUploadImageScaleTest.php
+++ b/core/modules/editor/src/Tests/EditorUploadImageScaleTest.php
@@ -76,8 +76,8 @@ public function testEditorUploadImageScale() {
$this->setMaxDimensions($max_width, $max_height);
$this->assertSavedMaxDimensions($max_width, $max_height);
list($uploaded_image_file_width, $uploaded_image_file_height) = $this->uploadImage($test_image->uri);
- $this->assertEquals($uploaded_image_file_width, $image_file_width);
- $this->assertEquals($uploaded_image_file_height, $image_file_height);
+ $this->assertEqual($uploaded_image_file_width, $image_file_width);
+ $this->assertEqual($uploaded_image_file_height, $image_file_height);
$this->assertNoRaw(t('The image was resized to fit within the maximum allowed dimensions of %dimensions pixels.', ['%dimensions' => $max_width . 'x' . $max_height]));
// Case 2: max width smaller than uploaded image: image scaled down.
@@ -88,8 +88,8 @@ public function testEditorUploadImageScale() {
$this->setMaxDimensions($max_width, $max_height);
$this->assertSavedMaxDimensions($max_width, $max_height);
list($uploaded_image_file_width, $uploaded_image_file_height) = $this->uploadImage($test_image->uri);
- $this->assertEquals($uploaded_image_file_width, $max_width);
- $this->assertEquals($uploaded_image_file_height, $uploaded_image_file_height * ($uploaded_image_file_width / $max_width));
+ $this->assertEqual($uploaded_image_file_width, $max_width);
+ $this->assertEqual($uploaded_image_file_height, $uploaded_image_file_height * ($uploaded_image_file_width / $max_width));
$this->assertRaw(t('The image was resized to fit within the maximum allowed dimensions of %dimensions pixels.', ['%dimensions' => $max_width . 'x' . $max_height]));
// Case 3: max height smaller than uploaded image: image scaled down.
@@ -100,8 +100,8 @@ public function testEditorUploadImageScale() {
$this->setMaxDimensions($max_width, $max_height);
$this->assertSavedMaxDimensions($max_width, $max_height);
list($uploaded_image_file_width, $uploaded_image_file_height) = $this->uploadImage($test_image->uri);
- $this->assertEquals($uploaded_image_file_width, $uploaded_image_file_width * ($uploaded_image_file_height / $max_height));
- $this->assertEquals($uploaded_image_file_height, $max_height);
+ $this->assertEqual($uploaded_image_file_width, $uploaded_image_file_width * ($uploaded_image_file_height / $max_height));
+ $this->assertEqual($uploaded_image_file_height, $max_height);
$this->assertRaw(t('The image was resized to fit within the maximum allowed dimensions of %dimensions pixels.', ['%dimensions' => $max_width . 'x' . $max_height]));
// Case 4: max dimensions greater than uploaded image: image not scaled.
@@ -112,8 +112,8 @@ public function testEditorUploadImageScale() {
$this->setMaxDimensions($max_width, $max_height);
$this->assertSavedMaxDimensions($max_width, $max_height);
list($uploaded_image_file_width, $uploaded_image_file_height) = $this->uploadImage($test_image->uri);
- $this->assertEquals($uploaded_image_file_width, $image_file_width);
- $this->assertEquals($uploaded_image_file_height, $image_file_height);
+ $this->assertEqual($uploaded_image_file_width, $image_file_width);
+ $this->assertEqual($uploaded_image_file_height, $image_file_height);
$this->assertNoRaw(t('The image was resized to fit within the maximum allowed dimensions of %dimensions pixels.', ['%dimensions' => $max_width . 'x' . $max_height]));
// Case 5: only max width dimension was provided and it was smaller than
@@ -125,8 +125,8 @@ public function testEditorUploadImageScale() {
$this->setMaxDimensions($max_width, $max_height);
$this->assertSavedMaxDimensions($max_width, $max_height);
list($uploaded_image_file_width, $uploaded_image_file_height) = $this->uploadImage($test_image->uri);
- $this->assertEquals($uploaded_image_file_width, $max_width);
- $this->assertEquals($uploaded_image_file_height, $uploaded_image_file_height * ($uploaded_image_file_width / $max_width));
+ $this->assertEqual($uploaded_image_file_width, $max_width);
+ $this->assertEqual($uploaded_image_file_height, $uploaded_image_file_height * ($uploaded_image_file_width / $max_width));
$this->assertRaw(t('The image was resized to fit within the maximum allowed width of %width pixels.', ['%width' => $max_width]));
// Case 6: only max height dimension was provided and it was smaller than
@@ -138,8 +138,8 @@ public function testEditorUploadImageScale() {
$this->setMaxDimensions($max_width, $max_height);
$this->assertSavedMaxDimensions($max_width, $max_height);
list($uploaded_image_file_width, $uploaded_image_file_height) = $this->uploadImage($test_image->uri);
- $this->assertEquals($uploaded_image_file_width, $uploaded_image_file_width * ($uploaded_image_file_height / $max_height));
- $this->assertEquals($uploaded_image_file_height, $max_height);
+ $this->assertEqual($uploaded_image_file_width, $uploaded_image_file_width * ($uploaded_image_file_height / $max_height));
+ $this->assertEqual($uploaded_image_file_height, $max_height);
$this->assertRaw(t('The image was resized to fit within the maximum allowed height of %height pixels.', ['%height' => $max_height]));
}
@@ -215,8 +215,8 @@ protected function assertSavedMaxDimensions($width, $height) {
'width' => $image_upload_settings['max_dimensions']['width'],
'height' => $image_upload_settings['max_dimensions']['height'],
];
- $same_width = $this->assertEquals($width, $expected['width'], 'Actual width of "' . $width . '" equals the expected width of "' . $expected['width'] . '"');
- $same_height = $this->assertEquals($height, $expected['height'], 'Actual height of "' . $height . '" equals the expected width of "' . $expected['height'] . '"');
+ $same_width = $this->assertEqual($width, $expected['width'], 'Actual width of "' . $width . '" equals the expected width of "' . $expected['width'] . '"');
+ $same_height = $this->assertEqual($height, $expected['height'], 'Actual height of "' . $height . '" equals the expected width of "' . $expected['height'] . '"');
return $same_width && $same_height;
}
diff --git a/core/modules/field/src/Tests/Boolean/BooleanFormatterSettingsTest.php b/core/modules/field/src/Tests/Boolean/BooleanFormatterSettingsTest.php
index 4bbca3c..92efa98 100644
--- a/core/modules/field/src/Tests/Boolean/BooleanFormatterSettingsTest.php
+++ b/core/modules/field/src/Tests/Boolean/BooleanFormatterSettingsTest.php
@@ -124,7 +124,7 @@ public function testBooleanFormatterSettings() {
foreach ($settings as $values) {
$this->drupalGet('admin/structure/types/manage/' . $this->bundle . '/display');
$result = $this->xpath('//div[contains(@class, :class) and contains(text(), :text)]', [':class' => 'field-plugin-summary', ':text' => 'Display: TRUE / FALSE']);
- $this->assertEquals(count($result), 1, "Boolean formatter settings summary exist.");
+ $this->assertEqual(count($result), 1, "Boolean formatter settings summary exist.");
}
}
diff --git a/core/modules/field/src/Tests/EntityReference/EntityReferenceAdminTest.php b/core/modules/field/src/Tests/EntityReference/EntityReferenceAdminTest.php
index eec74d4..9bacb07 100644
--- a/core/modules/field/src/Tests/EntityReference/EntityReferenceAdminTest.php
+++ b/core/modules/field/src/Tests/EntityReference/EntityReferenceAdminTest.php
@@ -461,7 +461,7 @@ public function testMultipleTargetBundles() {
/** @var \Drupal\field\Entity\FieldConfig $field_config */
$field_config = FieldConfig::load($field_id);
// Expect that the target bundle has been saved in the backend.
- $this->assertEquals($field_config->getSetting('handler_settings')['auto_create_bundle'], $vocabularies[1]->id());
+ $this->assertEqual($field_config->getSetting('handler_settings')['auto_create_bundle'], $vocabularies[1]->id());
// Delete the other bundle. Field config should not be affected.
$vocabularies[0]->delete();
diff --git a/core/modules/field/src/Tests/FieldImportDeleteUninstallUiTest.php b/core/modules/field/src/Tests/FieldImportDeleteUninstallUiTest.php
index 32d8241..e353086 100644
--- a/core/modules/field/src/Tests/FieldImportDeleteUninstallUiTest.php
+++ b/core/modules/field/src/Tests/FieldImportDeleteUninstallUiTest.php
@@ -74,8 +74,8 @@ public function testImportDeleteUninstall() {
// Verify entity has been created properly.
$id = $entity->id();
$entity = EntityTest::load($id);
- $this->assertEquals($entity->field_tel->value, $value);
- $this->assertEquals($entity->field_tel[0]->value, $value);
+ $this->assertEqual($entity->field_tel->value, $value);
+ $this->assertEqual($entity->field_tel[0]->value, $value);
$active = $this->container->get('config.storage');
$sync = $this->container->get('config.storage.sync');
diff --git a/core/modules/field/src/Tests/FieldTestBase.php b/core/modules/field/src/Tests/FieldTestBase.php
index 0b0cf46..a610757 100644
--- a/core/modules/field/src/Tests/FieldTestBase.php
+++ b/core/modules/field/src/Tests/FieldTestBase.php
@@ -59,9 +59,9 @@ public function assertFieldValues(EntityInterface $entity, $field_name, $expecte
// Filter out empty values so that they don't mess with the assertions.
$field->filterEmptyItems();
$values = $field->getValue();
- $this->assertEquals(count($values), count($expected_values), 'Expected number of values were saved.');
+ $this->assertEqual(count($values), count($expected_values), 'Expected number of values were saved.');
foreach ($expected_values as $key => $value) {
- $this->assertEquals($values[$key][$column], $value, format_string('Value @value was saved correctly.', ['@value' => $value]));
+ $this->assertEqual($values[$key][$column], $value, format_string('Value @value was saved correctly.', ['@value' => $value]));
}
}
diff --git a/core/modules/field/src/Tests/FormTest.php b/core/modules/field/src/Tests/FormTest.php
index 245c0f5..786e367 100644
--- a/core/modules/field/src/Tests/FormTest.php
+++ b/core/modules/field/src/Tests/FormTest.php
@@ -132,7 +132,7 @@ public function testFieldFormSingle() {
$id = $match[1];
$this->assertText(t('entity_test @id has been created.', ['@id' => $id]), 'Entity was created');
$entity = EntityTest::load($id);
- $this->assertEquals($entity->{$field_name}->value, $value, 'Field value was saved');
+ $this->assertEqual($entity->{$field_name}->value, $value, 'Field value was saved');
// Display edit form.
$this->drupalGet('entity_test/manage/' . $id . '/edit');
@@ -148,7 +148,7 @@ public function testFieldFormSingle() {
$this->assertText(t('entity_test @id has been updated.', ['@id' => $id]), 'Entity was updated');
$this->container->get('entity.manager')->getStorage('entity_test')->resetCache([$id]);
$entity = EntityTest::load($id);
- $this->assertEquals($entity->{$field_name}->value, $value, 'Field value was updated');
+ $this->assertEqual($entity->{$field_name}->value, $value, 'Field value was updated');
// Empty the field.
$value = '';
@@ -220,7 +220,7 @@ public function testFieldFormSingleRequired() {
$id = $match[1];
$this->assertText(t('entity_test @id has been created.', ['@id' => $id]), 'Entity was created');
$entity = EntityTest::load($id);
- $this->assertEquals($entity->{$field_name}->value, $value, 'Field value was saved');
+ $this->assertEqual($entity->{$field_name}->value, $value, 'Field value was saved');
// Edit with missing required value.
$value = '';
@@ -502,8 +502,8 @@ public function testFieldFormAccess() {
$storage = $this->container->get('entity_type.manager')
->getStorage($entity_type);
$entity = $storage->load($id);
- $this->assertEquals($entity->$field_name_no_access->value, 99, 'Default value was saved for the field with no edit access.');
- $this->assertEquals($entity->$field_name->value, 1, 'Entered value vas saved for the field with edit access.');
+ $this->assertEqual($entity->$field_name_no_access->value, 99, 'Default value was saved for the field with no edit access.');
+ $this->assertEqual($entity->$field_name->value, 1, 'Entered value vas saved for the field with edit access.');
// Create a new revision.
$edit = [
@@ -515,15 +515,15 @@ public function testFieldFormAccess() {
// Check that the new revision has the expected values.
$storage->resetCache([$id]);
$entity = $storage->load($id);
- $this->assertEquals($entity->$field_name_no_access->value, 99, 'New revision has the expected value for the field with no edit access.');
- $this->assertEquals($entity->$field_name->value, 2, 'New revision has the expected value for the field with edit access.');
+ $this->assertEqual($entity->$field_name_no_access->value, 99, 'New revision has the expected value for the field with no edit access.');
+ $this->assertEqual($entity->$field_name->value, 2, 'New revision has the expected value for the field with edit access.');
// Check that the revision is also saved in the revisions table.
$entity = $this->container->get('entity_type.manager')
->getStorage($entity_type)
->loadRevision($entity->getRevisionId());
- $this->assertEquals($entity->$field_name_no_access->value, 99, 'New revision has the expected value for the field with no edit access.');
- $this->assertEquals($entity->$field_name->value, 2, 'New revision has the expected value for the field with edit access.');
+ $this->assertEqual($entity->$field_name_no_access->value, 99, 'New revision has the expected value for the field with no edit access.');
+ $this->assertEqual($entity->$field_name->value, 2, 'New revision has the expected value for the field with edit access.');
}
/**
@@ -558,7 +558,7 @@ public function testHiddenField() {
->getStorage($entity_type);
$entity = $storage->load($id);
- $this->assertEquals($entity->{$field_name}->value, 99, 'Default value was saved');
+ $this->assertEqual($entity->{$field_name}->value, 99, 'Default value was saved');
// Update the field to remove the default value, and switch to the default
// widget.
@@ -581,7 +581,7 @@ public function testHiddenField() {
$this->assertText(t('entity_test_rev @id has been updated.', ['@id' => $id]), 'Entity was updated');
$storage->resetCache([$id]);
$entity = $storage->load($id);
- $this->assertEquals($entity->{$field_name}->value, $value, 'Field value was updated');
+ $this->assertEqual($entity->{$field_name}->value, $value, 'Field value was updated');
// Set the field back to hidden.
entity_get_form_display($entity_type, $this->field->getTargetBundle(), 'default')
@@ -595,7 +595,7 @@ public function testHiddenField() {
// Check that the expected value has been carried over to the new revision.
$storage->resetCache([$id]);
$entity = $storage->load($id);
- $this->assertEquals($entity->{$field_name}->value, $value, 'New revision has the expected value for the field with the Hidden widget');
+ $this->assertEqual($entity->{$field_name}->value, $value, 'New revision has the expected value for the field with the Hidden widget');
}
/**
diff --git a/core/modules/field/src/Tests/NestedFormTest.php b/core/modules/field/src/Tests/NestedFormTest.php
index 92aedf4..0bbfb0d 100644
--- a/core/modules/field/src/Tests/NestedFormTest.php
+++ b/core/modules/field/src/Tests/NestedFormTest.php
@@ -189,7 +189,7 @@ public function testNestedEntityFormEntityLevelValidation() {
$this->drupalPostForm(NULL, $edit, t('Save'));
$elements = $this->cssSelect('.entity-2.error');
- $this->assertEquals(1, count($elements), 'The whole nested entity form has been correctly flagged with an error class.');
+ $this->assertEqual(1, count($elements), 'The whole nested entity form has been correctly flagged with an error class.');
}
}
diff --git a/core/modules/field/src/Tests/Number/NumberFieldTest.php b/core/modules/field/src/Tests/Number/NumberFieldTest.php
index 8268c9f..64da6c1 100644
--- a/core/modules/field/src/Tests/Number/NumberFieldTest.php
+++ b/core/modules/field/src/Tests/Number/NumberFieldTest.php
@@ -177,7 +177,7 @@ public function testNumberIntegerField() {
'indexes' => [],
'foreign keys' => []
];
- $this->assertEquals($storage->getSchema(), $expected);
+ $this->assertEqual($storage->getSchema(), $expected);
// Display creation form.
$this->drupalGet('entity_test/add');
diff --git a/core/modules/field/src/Tests/Views/FieldUITest.php b/core/modules/field/src/Tests/Views/FieldUITest.php
index ce86a2b..efe7685 100644
--- a/core/modules/field/src/Tests/Views/FieldUITest.php
+++ b/core/modules/field/src/Tests/Views/FieldUITest.php
@@ -62,7 +62,7 @@ public function testHandlerUI() {
}, $result);
// @todo Replace this sort by assertArray once it's in.
sort($options, SORT_STRING);
- $this->assertEquals($options, ['text_default', 'text_trimmed'], 'The text formatters for a simple text field appear as expected.');
+ $this->assertEqual($options, ['text_default', 'text_trimmed'], 'The text formatters for a simple text field appear as expected.');
$this->drupalPostForm(NULL, ['options[type]' => 'text_trimmed'], t('Apply'));
@@ -78,8 +78,8 @@ public function testHandlerUI() {
$this->drupalPostForm('admin/structure/views/view/test_view_fieldapi', [], t('Save'));
$view = Views::getView('test_view_fieldapi');
$view->initHandlers();
- $this->assertEquals($view->field['field_name_0']->options['type'], 'text_trimmed');
- $this->assertEquals($view->field['field_name_0']->options['settings']['trim_length'], $random_number);
+ $this->assertEqual($view->field['field_name_0']->options['type'], 'text_trimmed');
+ $this->assertEqual($view->field['field_name_0']->options['settings']['trim_length'], $random_number);
// Now change the formatter back to 'default' which doesn't have any
// settings. We want to ensure that the settings are empty then.
@@ -88,8 +88,8 @@ public function testHandlerUI() {
$this->drupalPostForm('admin/structure/views/view/test_view_fieldapi', [], t('Save'));
$view = Views::getView('test_view_fieldapi');
$view->initHandlers();
- $this->assertEquals($view->field['field_name_0']->options['type'], 'text_default');
- $this->assertEquals($view->field['field_name_0']->options['settings'], []);
+ $this->assertEqual($view->field['field_name_0']->options['type'], 'text_default');
+ $this->assertEqual($view->field['field_name_0']->options['settings'], []);
// Ensure that the view depends on the field storage.
$dependencies = \Drupal::service('config.manager')->findConfigEntityDependents('config', [$this->fieldStorages[0]->getConfigDependencyName()]);
@@ -116,7 +116,7 @@ public function testHandlerUIAggregation() {
}, $result);
sort($options, SORT_STRING);
- $this->assertEquals($options, ['format', 'value'], 'The expected sort field options were found.');
+ $this->assertEqual($options, ['format', 'value'], 'The expected sort field options were found.');
}
/**
@@ -143,15 +143,15 @@ public function testBooleanFilterHandler() {
// Verify that using a boolean field as a filter also results in using the
// boolean plugin.
$option = $this->xpath('//label[@for="edit-options-value-1"]');
- $this->assertEquals(t('True'), (string) $option[0]);
+ $this->assertEqual(t('True'), (string) $option[0]);
$option = $this->xpath('//label[@for="edit-options-value-0"]');
- $this->assertEquals(t('False'), (string) $option[0]);
+ $this->assertEqual(t('False'), (string) $option[0]);
// Expose the filter and see if the 'Any' option is added and if we can save
// it.
$this->drupalPostForm(NULL, [], 'Expose filter');
$option = $this->xpath('//label[@for="edit-options-value-all"]');
- $this->assertEquals(t('- Any -'), (string) $option[0]);
+ $this->assertEqual(t('- Any -'), (string) $option[0]);
$this->drupalPostForm(NULL, ['options[value]' => 'All', 'options[expose][required]' => FALSE], 'Apply');
$this->drupalPostForm(NULL, [], 'Save');
$this->drupalGet('/admin/structure/views/nojs/handler/test_view_fieldapi/default/filter/field_boolean_value');
diff --git a/core/modules/field/src/Tests/Views/HandlerFieldFieldTest.php b/core/modules/field/src/Tests/Views/HandlerFieldFieldTest.php
index ab52ca8..da958e9 100644
--- a/core/modules/field/src/Tests/Views/HandlerFieldFieldTest.php
+++ b/core/modules/field/src/Tests/Views/HandlerFieldFieldTest.php
@@ -141,7 +141,7 @@ public function _testSimpleFieldRender() {
$field_name = $this->fieldStorages[$key]->getName();
$rendered_field = $view->style_plugin->getField($i, $field_name);
$expected_field = $this->nodes[$i]->$field_name->value;
- $this->assertEquals($rendered_field, $expected_field);
+ $this->assertEqual($rendered_field, $expected_field);
}
}
}
@@ -180,7 +180,7 @@ public function _testFormatterSimpleFieldRender() {
// @TODO: actually there should be a specific formatter.
for ($i = 0; $i < 2; $i++) {
$rendered_field = $view->style_plugin->getField($i, $this->fieldStorages[5]->getName());
- $this->assertEquals(strlen(html_entity_decode($rendered_field)), 3);
+ $this->assertEqual(strlen(html_entity_decode($rendered_field)), 3);
}
}
@@ -202,7 +202,7 @@ public function _testMultipleFieldRender() {
foreach ($pure_items as $j => $item) {
$items[] = $pure_items[$j]['value'];
}
- $this->assertEquals($rendered_field, implode(', ', $items), 'The amount of items is limited.');
+ $this->assertEqual($rendered_field, implode(', ', $items), 'The amount of items is limited.');
}
// Test that an empty field is rendered without error.
@@ -224,7 +224,7 @@ public function _testMultipleFieldRender() {
foreach ($pure_items as $j => $item) {
$items[] = $pure_items[$j]['value'];
}
- $this->assertEquals($rendered_field, implode(', ', $items), 'The amount of items is limited and the offset is correct.');
+ $this->assertEqual($rendered_field, implode(', ', $items), 'The amount of items is limited and the offset is correct.');
}
$view->destroy();
@@ -245,7 +245,7 @@ public function _testMultipleFieldRender() {
foreach ($pure_items as $j => $item) {
$items[] = $pure_items[$j]['value'];
}
- $this->assertEquals($rendered_field, implode(', ', $items), 'The amount of items is limited and they are reversed.');
+ $this->assertEqual($rendered_field, implode(', ', $items), 'The amount of items is limited and they are reversed.');
}
$view->destroy();
@@ -263,7 +263,7 @@ public function _testMultipleFieldRender() {
$pure_items = $this->nodes[$i]->{$field_name}->getValue();
$items[] = $pure_items[0]['value'];
$items[] = $pure_items[4]['value'];
- $this->assertEquals($rendered_field, implode(', ', $items), 'Items are limited to first and last.');
+ $this->assertEqual($rendered_field, implode(', ', $items), 'Items are limited to first and last.');
}
$view->destroy();
@@ -283,7 +283,7 @@ public function _testMultipleFieldRender() {
foreach ($pure_items as $j => $item) {
$items[] = $pure_items[$j]['value'];
}
- $this->assertEquals($rendered_field, implode(':', $items), 'The amount of items is limited and the custom separator is correct.');
+ $this->assertEqual($rendered_field, implode(':', $items), 'The amount of items is limited and the custom separator is correct.');
}
$view->destroy();
@@ -302,7 +302,7 @@ public function _testMultipleFieldRender() {
foreach ($pure_items as $j => $item) {
$items[] = $pure_items[$j]['value'];
}
- $this->assertEquals($rendered_field, implode('
test
', $items), 'The custom separator is correctly escaped.');
+ $this->assertEqual($rendered_field, implode('test
', $items), 'The custom separator is correctly escaped.');
}
$view->destroy();
}
diff --git a/core/modules/field_ui/src/Tests/ManageDisplayTest.php b/core/modules/field_ui/src/Tests/ManageDisplayTest.php
index 89521eb..688b9e9 100644
--- a/core/modules/field_ui/src/Tests/ManageDisplayTest.php
+++ b/core/modules/field_ui/src/Tests/ManageDisplayTest.php
@@ -97,7 +97,7 @@ public function testFormatterUI() {
'field_test_with_prepare_view',
'field_test_applicable',
];
- $this->assertEquals($options, $expected_options, 'The expected formatter ordering is respected.');
+ $this->assertEqual($options, $expected_options, 'The expected formatter ordering is respected.');
// Ensure that fields can be hidden directly by changing the region.
$this->drupalGet($manage_display);
@@ -135,8 +135,8 @@ public function testFormatterUI() {
$display_options = $display->getComponent('field_test');
$current_format = $display_options['type'];
$current_setting_value = $display_options['settings'][$setting_name];
- $this->assertEquals($current_format, $format, 'The formatter was updated.');
- $this->assertEquals($current_setting_value, $setting_value, 'The setting was updated.');
+ $this->assertEqual($current_format, $format, 'The formatter was updated.');
+ $this->assertEqual($current_setting_value, $setting_value, 'The setting was updated.');
// Assert that hook_field_formatter_settings_summary_alter() is called.
$this->assertText('field_test_field_formatter_settings_summary_alter');
@@ -160,7 +160,7 @@ public function testFormatterUI() {
$storage = $this->container->get('entity_type.manager')->getStorage('entity_view_display');
$storage->resetCache([$id]);
$display = $storage->load($id);
- $this->assertEquals($display->getRenderer('field_test')->getThirdPartySetting('field_third_party_test', 'field_test_field_formatter_third_party_settings_form'), 'foo');
+ $this->assertEqual($display->getRenderer('field_test')->getThirdPartySetting('field_third_party_test', 'field_test_field_formatter_third_party_settings_form'), 'foo');
$this->assertTrue(in_array('field_third_party_test', $display->calculateDependencies()->getDependencies()['module']), 'The display has a dependency on field_third_party_test module.');
// Confirm that the third party settings are not updated on the settings form.
@@ -254,7 +254,7 @@ public function testWidgetUI() {
'test_field_widget',
'test_field_widget_multiple',
];
- $this->assertEquals($options, $expected_options, 'The expected widget ordering is respected.');
+ $this->assertEqual($options, $expected_options, 'The expected widget ordering is respected.');
// Change the widget and check that the summary is updated.
$edit = [
@@ -276,8 +276,8 @@ public function testWidgetUI() {
$display_options = $display->getComponent('field_test');
$current_widget = $display_options['type'];
$current_setting_value = $display_options['settings'][$setting_name];
- $this->assertEquals($current_widget, $widget_type, 'The widget was updated.');
- $this->assertEquals($current_setting_value, $setting_value, 'The setting was updated.');
+ $this->assertEqual($current_widget, $widget_type, 'The widget was updated.');
+ $this->assertEqual($current_setting_value, $setting_value, 'The setting was updated.');
// Assert that hook_field_widget_settings_summary_alter() is called.
$this->assertText('field_test_field_widget_settings_summary_alter');
@@ -298,7 +298,7 @@ public function testWidgetUI() {
$storage = $this->container->get('entity_type.manager')->getStorage('entity_form_display');
$storage->resetCache(['node.' . $this->type . '.default']);
$display = $storage->load('node.' . $this->type . '.default');
- $this->assertEquals($display->getRenderer('field_test')->getThirdPartySetting('field_third_party_test', 'field_test_widget_third_party_settings_form'), 'foo');
+ $this->assertEqual($display->getRenderer('field_test')->getThirdPartySetting('field_third_party_test', 'field_test_widget_third_party_settings_form'), 'foo');
$this->assertTrue(in_array('field_third_party_test', $display->calculateDependencies()->getDependencies()['module']), 'Form display does not have a dependency on field_third_party_test module.');
// Confirm that the third party settings are not updated on the settings form.
diff --git a/core/modules/field_ui/src/Tests/ManageFieldsTest.php b/core/modules/field_ui/src/Tests/ManageFieldsTest.php
index 95eda85..d08ab03 100644
--- a/core/modules/field_ui/src/Tests/ManageFieldsTest.php
+++ b/core/modules/field_ui/src/Tests/ManageFieldsTest.php
@@ -169,7 +169,7 @@ public function manageFieldsPage($type = '') {
}
}
- $this->assertEquals($number_of_links, $number_of_links_found);
+ $this->assertEqual($number_of_links, $number_of_links_found);
}
/**
@@ -438,7 +438,7 @@ public function testDefaultValue() {
$this->drupalPostForm($admin_path, $edit, t('Save settings'));
$this->assertText("Saved $field_name configuration", 'The form was successfully submitted.');
$field = FieldConfig::loadByName('node', $this->contentType, $field_name);
- $this->assertEquals($field->getDefaultValueLiteral(), [['value' => 1]], 'The default value was correctly saved.');
+ $this->assertEqual($field->getDefaultValueLiteral(), [['value' => 1]], 'The default value was correctly saved.');
// Check that the default value shows up in the form
$this->drupalGet($admin_path);
@@ -449,7 +449,7 @@ public function testDefaultValue() {
$this->drupalPostForm(NULL, $edit, t('Save settings'));
$this->assertText("Saved $field_name configuration", 'The form was successfully submitted.');
$field = FieldConfig::loadByName('node', $this->contentType, $field_name);
- $this->assertEquals($field->getDefaultValueLiteral(), NULL, 'The default value was correctly saved.');
+ $this->assertEqual($field->getDefaultValueLiteral(), NULL, 'The default value was correctly saved.');
// Check that the default value can be empty when the field is marked as
// required and can store unlimited values.
@@ -467,7 +467,7 @@ public function testDefaultValue() {
$this->drupalPostForm(NULL, [], t('Save settings'));
$this->assertText("Saved $field_name configuration", 'The form was successfully submitted.');
$field = FieldConfig::loadByName('node', $this->contentType, $field_name);
- $this->assertEquals($field->getDefaultValueLiteral(), NULL, 'The default value was correctly saved.');
+ $this->assertEqual($field->getDefaultValueLiteral(), NULL, 'The default value was correctly saved.');
// Check that the default widget is used when the field is hidden.
entity_get_form_display($field->getTargetEntityTypeId(), $field->getTargetBundle(), 'default')
@@ -739,17 +739,17 @@ public function testPreconfiguredFields() {
// Add a field with every possible preconfigured value.
$this->fieldUIAddNewField(NULL, 'test_custom_options', 'Test label', 'field_ui:test_field_with_preconfigured_options:custom_options');
$field_storage = FieldStorageConfig::loadByName('node', 'field_test_custom_options');
- $this->assertEquals($field_storage->getCardinality(), FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED);
- $this->assertEquals($field_storage->getSetting('test_field_storage_setting'), 'preconfigured_storage_setting');
+ $this->assertEqual($field_storage->getCardinality(), FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED);
+ $this->assertEqual($field_storage->getSetting('test_field_storage_setting'), 'preconfigured_storage_setting');
$field = FieldConfig::loadByName('node', 'article', 'field_test_custom_options');
$this->assertTrue($field->isRequired());
- $this->assertEquals($field->getSetting('test_field_setting'), 'preconfigured_field_setting');
+ $this->assertEqual($field->getSetting('test_field_setting'), 'preconfigured_field_setting');
$form_display = entity_get_form_display('node', 'article', 'default');
- $this->assertEquals($form_display->getComponent('field_test_custom_options')['type'], 'test_field_widget_multiple');
+ $this->assertEqual($form_display->getComponent('field_test_custom_options')['type'], 'test_field_widget_multiple');
$view_display = entity_get_display('node', 'article', 'default');
- $this->assertEquals($view_display->getComponent('field_test_custom_options')['type'], 'field_test_multiple');
+ $this->assertEqual($view_display->getComponent('field_test_custom_options')['type'], 'field_test_multiple');
}
/**
diff --git a/core/modules/file/src/Tests/DownloadTest.php b/core/modules/file/src/Tests/DownloadTest.php
index de88870..8f85f09 100644
--- a/core/modules/file/src/Tests/DownloadTest.php
+++ b/core/modules/file/src/Tests/DownloadTest.php
@@ -24,7 +24,7 @@ public function testPublicFileTransfer() {
// URLs can't contain characters outside the ASCII set so $filename has to be
// encoded.
$filename = $GLOBALS['base_url'] . '/' . \Drupal::service('stream_wrapper_manager')->getViaScheme('public')->getDirectoryPath() . '/' . rawurlencode($file->getFilename());
- $this->assertEquals($filename, $url, 'Correctly generated a URL for a created file.');
+ $this->assertEqual($filename, $url, 'Correctly generated a URL for a created file.');
$this->drupalHead($url);
$this->assertResponse(200, 'Confirmed that the generated URL is correct by downloading the created file.');
@@ -32,7 +32,7 @@ public function testPublicFileTransfer() {
// Drupal core, a module or a theme, for example a JavaScript file).
$filepath = 'core/assets/vendor/jquery/jquery.min.js';
$url = file_create_url($filepath);
- $this->assertEquals($GLOBALS['base_url'] . '/' . $filepath, $url, 'Correctly generated a URL for a shipped file.');
+ $this->assertEqual($GLOBALS['base_url'] . '/' . $filepath, $url, 'Correctly generated a URL for a shipped file.');
$this->drupalHead($url);
$this->assertResponse(200, 'Confirmed that the generated URL is correct by downloading the shipped file.');
}
@@ -65,12 +65,12 @@ protected function doPrivateFileTransferTest() {
// Set file_test access header to allow the download.
file_test_set_return('download', ['x-foo' => 'Bar']);
$this->drupalGet($url);
- $this->assertEquals($this->drupalGetHeader('x-foo'), 'Bar', 'Found header set by file_test module on private download.');
+ $this->assertEqual($this->drupalGetHeader('x-foo'), 'Bar', 'Found header set by file_test module on private download.');
$this->assertFalse($this->drupalGetHeader('x-drupal-cache'), 'Page cache is disabled on private file download.');
$this->assertResponse(200, 'Correctly allowed access to a file when file_test provides headers.');
// Test that the file transferred correctly.
- $this->assertEquals($contents, $this->content, 'Contents of the file are correct.');
+ $this->assertEqual($contents, $this->content, 'Contents of the file are correct.');
// Deny access to all downloads via a -1 header.
file_test_set_return('download', -1);
@@ -117,7 +117,7 @@ public function testFileCreateUrl() {
$this->checkUrl('public', '', $basename, $base_path . '/' . $public_directory_path . '/' . $basename_encoded);
$this->checkUrl('private', '', $basename, $base_path . '/' . $script_path . 'system/files/' . $basename_encoded);
}
- $this->assertEquals(file_create_url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg=='), 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==', t('Generated URL matches expected URL.'));
+ $this->assertEqual(file_create_url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg=='), 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==', t('Generated URL matches expected URL.'));
}
/**
@@ -146,7 +146,7 @@ private function checkUrl($scheme, $directory, $filename, $expected_url) {
$file = $this->createFile($filepath, NULL, $scheme);
$url = file_create_url($file->getFileUri());
- $this->assertEquals($url, $expected_url);
+ $this->assertEqual($url, $expected_url);
if ($scheme == 'private') {
// Tell the implementation of hook_file_download() in file_test.module
diff --git a/core/modules/file/src/Tests/FileFieldRevisionTest.php b/core/modules/file/src/Tests/FileFieldRevisionTest.php
index 22d70e3..04fbcb8 100644
--- a/core/modules/file/src/Tests/FileFieldRevisionTest.php
+++ b/core/modules/file/src/Tests/FileFieldRevisionTest.php
@@ -61,7 +61,7 @@ public function testRevisions() {
// Check that the original file is still in place on the first revision.
$node = node_revision_load($node_vid_r1);
$current_file = File::load($node->{$field_name}->target_id);
- $this->assertEquals($node_file_r1->id(), $current_file->id(), 'Original file still in place after replacing file in new revision.');
+ $this->assertEqual($node_file_r1->id(), $current_file->id(), 'Original file still in place after replacing file in new revision.');
$this->assertFileExists($node_file_r1, 'Original file still in place after replacing file in new revision.');
$this->assertFileEntryExists($node_file_r1, 'Original file entry still in place after replacing file in new revision');
$this->assertFileIsPermanent($node_file_r1, 'Original file is still permanent.');
@@ -73,7 +73,7 @@ public function testRevisions() {
$node = $node_storage->load($nid);
$node_file_r3 = File::load($node->{$field_name}->target_id);
$node_vid_r3 = $node->getRevisionId();
- $this->assertEquals($node_file_r2->id(), $node_file_r3->id(), 'Previous revision file still in place after creating a new revision without a new file.');
+ $this->assertEqual($node_file_r2->id(), $node_file_r3->id(), 'Previous revision file still in place after creating a new revision without a new file.');
$this->assertFileIsPermanent($node_file_r3, 'New revision file is permanent.');
// Revert to the first revision and check that the original file is active.
@@ -81,7 +81,7 @@ public function testRevisions() {
$node_storage->resetCache([$nid]);
$node = $node_storage->load($nid);
$node_file_r4 = File::load($node->{$field_name}->target_id);
- $this->assertEquals($node_file_r1->id(), $node_file_r4->id(), 'Original revision file still in place after reverting to the original revision.');
+ $this->assertEqual($node_file_r1->id(), $node_file_r4->id(), 'Original revision file still in place after reverting to the original revision.');
$this->assertFileIsPermanent($node_file_r4, 'Original revision file still permanent after reverting to the original revision.');
// Delete the second revision and check that the file is kept (since it is
diff --git a/core/modules/file/src/Tests/FileFieldTestBase.php b/core/modules/file/src/Tests/FileFieldTestBase.php
index f167b3b..ba34c8f 100644
--- a/core/modules/file/src/Tests/FileFieldTestBase.php
+++ b/core/modules/file/src/Tests/FileFieldTestBase.php
@@ -274,7 +274,7 @@ public function assertFileEntryExists($file, $message = NULL) {
$this->container->get('entity.manager')->getStorage('file')->resetCache();
$db_file = File::load($file->id());
$message = isset($message) ? $message : format_string('File %file exists in database at the correct path.', ['%file' => $file->getFileUri()]);
- $this->assertEquals($db_file->getFileUri(), $file->getFileUri(), $message);
+ $this->assertEqual($db_file->getFileUri(), $file->getFileUri(), $message);
}
/**
diff --git a/core/modules/file/src/Tests/FileFieldValidateTest.php b/core/modules/file/src/Tests/FileFieldValidateTest.php
index e54c8d1..be96f3c 100644
--- a/core/modules/file/src/Tests/FileFieldValidateTest.php
+++ b/core/modules/file/src/Tests/FileFieldValidateTest.php
@@ -205,7 +205,7 @@ public function testAJAXValidationMessage() {
$elements = $this->xpath('//div[contains(@class, :class)]', [
':class' => 'messages--error',
]);
- $this->assertEquals(count($elements), 1, 'Ajax validation messages are displayed once.');
+ $this->assertEqual(count($elements), 1, 'Ajax validation messages are displayed once.');
}
}
diff --git a/core/modules/file/src/Tests/FileFieldWidgetTest.php b/core/modules/file/src/Tests/FileFieldWidgetTest.php
index 59b57a1..8017ebf 100644
--- a/core/modules/file/src/Tests/FileFieldWidgetTest.php
+++ b/core/modules/file/src/Tests/FileFieldWidgetTest.php
@@ -251,7 +251,7 @@ public function testMultiValuedWidget() {
$nid = $this->uploadNodeFiles($upload_files_node_creation, $field_name, $type_name);
$node_storage->resetCache([$nid]);
$node = $node_storage->load($nid);
- $this->assertEquals(count($node->{$field_name}), count($upload_files_node_creation), 'Node was successfully saved with mulitple files.');
+ $this->assertEqual(count($node->{$field_name}), count($upload_files_node_creation), 'Node was successfully saved with mulitple files.');
// Try to upload more files than allowed on revision.
$upload_files_node_revision = [$test_file, $test_file, $test_file, $test_file];
@@ -265,7 +265,7 @@ public function testMultiValuedWidget() {
$this->assertRaw(t('Field %field can only hold @max values but there were @count uploaded. The following files have been omitted as a result: %list.', $args));
$node_storage->resetCache([$nid]);
$node = $node_storage->load($nid);
- $this->assertEquals(count($node->{$field_name}), $cardinality, 'More files than allowed could not be saved to node.');
+ $this->assertEqual(count($node->{$field_name}), $cardinality, 'More files than allowed could not be saved to node.');
// Try to upload exactly the allowed number of files on revision. Create an
// empty node first, to fill it in its first revision.
@@ -275,14 +275,14 @@ public function testMultiValuedWidget() {
$this->uploadNodeFile($test_file, $field_name, $node->id(), 1);
$node_storage->resetCache([$nid]);
$node = $node_storage->load($nid);
- $this->assertEquals(count($node->{$field_name}), $cardinality, 'Node was successfully revised to maximum number of files.');
+ $this->assertEqual(count($node->{$field_name}), $cardinality, 'Node was successfully revised to maximum number of files.');
// Try to upload exactly the allowed number of files, new node.
$upload_files = array_fill(0, $cardinality, $test_file);
$nid = $this->uploadNodeFiles($upload_files, $field_name, $type_name);
$node_storage->resetCache([$nid]);
$node = $node_storage->load($nid);
- $this->assertEquals(count($node->{$field_name}), $cardinality, 'Node was successfully saved with maximum number of files.');
+ $this->assertEqual(count($node->{$field_name}), $cardinality, 'Node was successfully saved with maximum number of files.');
// Try to upload more files than allowed, new node.
$upload_files[] = $test_file;
@@ -557,7 +557,7 @@ protected function doTestTemporaryFileRemovalExploit(UserInterface $victim_user,
$victim_tmp_file = File::load($victim_tmp_file->id());
$this->assertTrue($victim_tmp_file->isTemporary(), 'New file saved to disk is temporary.');
$this->assertFalse(empty($victim_tmp_file->id()), 'New file has an fid.');
- $this->assertEquals($victim_user->id(), $victim_tmp_file->getOwnerId(), 'New file belongs to the victim.');
+ $this->assertEqual($victim_user->id(), $victim_tmp_file->getOwnerId(), 'New file belongs to the victim.');
// Have attacker create a new node with a different uploaded file and
// ensure it got uploaded successfully.
@@ -573,7 +573,7 @@ protected function doTestTemporaryFileRemovalExploit(UserInterface $victim_user,
/** @var \Drupal\file\FileInterface $node_file */
$node_file = File::load($node->{$field_name}->target_id);
$this->assertFileExists($node_file, 'A file was saved to disk on node creation');
- $this->assertEquals($attacker_user->id(), $node_file->getOwnerId(), 'New file belongs to the attacker.');
+ $this->assertEqual($attacker_user->id(), $node_file->getOwnerId(), 'New file belongs to the attacker.');
// Ensure the file can be downloaded.
$this->drupalGet(file_create_url($node_file->getFileUri()));
diff --git a/core/modules/file/src/Tests/FileListingTest.php b/core/modules/file/src/Tests/FileListingTest.php
index e8f3d00..5c8b834 100644
--- a/core/modules/file/src/Tests/FileListingTest.php
+++ b/core/modules/file/src/Tests/FileListingTest.php
@@ -128,7 +128,7 @@ public function testFileListingPages() {
$this->assertRaw('admin/content/files/usage/' . $file->id() . '">' . $usage);
$result = $this->xpath("//td[contains(@class, 'views-field-status') and contains(text(), :value)]", [':value' => t('Temporary')]);
- $this->assertEquals(1, count($result), 'Unused file marked as temporary.');
+ $this->assertEqual(1, count($result), 'Unused file marked as temporary.');
// Test file usage page.
foreach ($nodes as $node) {
diff --git a/core/modules/file/src/Tests/FileManagedFileElementTest.php b/core/modules/file/src/Tests/FileManagedFileElementTest.php
index c2d39bf..f48532e 100644
--- a/core/modules/file/src/Tests/FileManagedFileElementTest.php
+++ b/core/modules/file/src/Tests/FileManagedFileElementTest.php
@@ -42,7 +42,7 @@ public function testManagedFile() {
$this->drupalPostForm($path, $edit, t('Save'));
$this->assertText('The form has become outdated. Copy any unsaved work in the form below');
$last_fid = $this->getLastFileId();
- $this->assertEquals($last_fid_prior, $last_fid, 'File was not saved when uploaded with an invalid form token.');
+ $this->assertEqual($last_fid_prior, $last_fid, 'File was not saved when uploaded with an invalid form token.');
// Submit a new file, without using the Upload button.
$last_fid_prior = $this->getLastFileId();
diff --git a/core/modules/file/src/Tests/FileManagedTestBase.php b/core/modules/file/src/Tests/FileManagedTestBase.php
index 63286f0..879e1c4 100644
--- a/core/modules/file/src/Tests/FileManagedTestBase.php
+++ b/core/modules/file/src/Tests/FileManagedTestBase.php
@@ -85,7 +85,7 @@ public function assertFileHookCalled($hook, $expected_count = 1, $message = NULL
$message = format_string('hook_file_@name was expected to be called %expected times but was called %actual times.', ['@name' => $hook, '%expected' => $expected_count, '%actual' => $actual_count]);
}
}
- $this->assertEquals($actual_count, $expected_count, $message);
+ $this->assertEqual($actual_count, $expected_count, $message);
}
/**
@@ -97,13 +97,13 @@ public function assertFileHookCalled($hook, $expected_count = 1, $message = NULL
* File object to compare.
*/
public function assertFileUnchanged(FileInterface $before, FileInterface $after) {
- $this->assertEquals($before->id(), $after->id(), t('File id is the same: %file1 == %file2.', ['%file1' => $before->id(), '%file2' => $after->id()]), 'File unchanged');
- $this->assertEquals($before->getOwner()->id(), $after->getOwner()->id(), t('File owner is the same: %file1 == %file2.', ['%file1' => $before->getOwner()->id(), '%file2' => $after->getOwner()->id()]), 'File unchanged');
- $this->assertEquals($before->getFilename(), $after->getFilename(), t('File name is the same: %file1 == %file2.', ['%file1' => $before->getFilename(), '%file2' => $after->getFilename()]), 'File unchanged');
- $this->assertEquals($before->getFileUri(), $after->getFileUri(), t('File path is the same: %file1 == %file2.', ['%file1' => $before->getFileUri(), '%file2' => $after->getFileUri()]), 'File unchanged');
- $this->assertEquals($before->getMimeType(), $after->getMimeType(), t('File MIME type is the same: %file1 == %file2.', ['%file1' => $before->getMimeType(), '%file2' => $after->getMimeType()]), 'File unchanged');
- $this->assertEquals($before->getSize(), $after->getSize(), t('File size is the same: %file1 == %file2.', ['%file1' => $before->getSize(), '%file2' => $after->getSize()]), 'File unchanged');
- $this->assertEquals($before->isPermanent(), $after->isPermanent(), t('File status is the same: %file1 == %file2.', ['%file1' => $before->isPermanent(), '%file2' => $after->isPermanent()]), 'File unchanged');
+ $this->assertEqual($before->id(), $after->id(), t('File id is the same: %file1 == %file2.', ['%file1' => $before->id(), '%file2' => $after->id()]), 'File unchanged');
+ $this->assertEqual($before->getOwner()->id(), $after->getOwner()->id(), t('File owner is the same: %file1 == %file2.', ['%file1' => $before->getOwner()->id(), '%file2' => $after->getOwner()->id()]), 'File unchanged');
+ $this->assertEqual($before->getFilename(), $after->getFilename(), t('File name is the same: %file1 == %file2.', ['%file1' => $before->getFilename(), '%file2' => $after->getFilename()]), 'File unchanged');
+ $this->assertEqual($before->getFileUri(), $after->getFileUri(), t('File path is the same: %file1 == %file2.', ['%file1' => $before->getFileUri(), '%file2' => $after->getFileUri()]), 'File unchanged');
+ $this->assertEqual($before->getMimeType(), $after->getMimeType(), t('File MIME type is the same: %file1 == %file2.', ['%file1' => $before->getMimeType(), '%file2' => $after->getMimeType()]), 'File unchanged');
+ $this->assertEqual($before->getSize(), $after->getSize(), t('File size is the same: %file1 == %file2.', ['%file1' => $before->getSize(), '%file2' => $after->getSize()]), 'File unchanged');
+ $this->assertEqual($before->isPermanent(), $after->isPermanent(), t('File status is the same: %file1 == %file2.', ['%file1' => $before->isPermanent(), '%file2' => $after->isPermanent()]), 'File unchanged');
}
/**
@@ -128,8 +128,8 @@ public function assertDifferentFile(FileInterface $file1, FileInterface $file2)
* File object to compare.
*/
public function assertSameFile(FileInterface $file1, FileInterface $file2) {
- $this->assertEquals($file1->id(), $file2->id(), t('Files have the same ids: %file1 == %file2.', ['%file1' => $file1->id(), '%file2-fid' => $file2->id()]), 'Same file');
- $this->assertEquals($file1->getFileUri(), $file2->getFileUri(), t('Files have the same path: %file1 == %file2.', ['%file1' => $file1->getFileUri(), '%file2' => $file2->getFileUri()]), 'Same file');
+ $this->assertEqual($file1->id(), $file2->id(), t('Files have the same ids: %file1 == %file2.', ['%file1' => $file1->id(), '%file2-fid' => $file2->id()]), 'Same file');
+ $this->assertEqual($file1->getFileUri(), $file2->getFileUri(), t('Files have the same path: %file1 == %file2.', ['%file1' => $file1->getFileUri(), '%file2' => $file2->getFileUri()]), 'Same file');
}
/**
diff --git a/core/modules/file/src/Tests/FilePrivateTest.php b/core/modules/file/src/Tests/FilePrivateTest.php
index 2942cde..88574cb 100644
--- a/core/modules/file/src/Tests/FilePrivateTest.php
+++ b/core/modules/file/src/Tests/FilePrivateTest.php
@@ -135,7 +135,7 @@ public function testPrivateFile() {
/** @var \Drupal\file\FileStorageInterface $file_storage */
$file_storage = $this->container->get('entity.manager')->getStorage('file');
$files = $file_storage->loadByProperties(['uid' => 0]);
- $this->assertEquals(1, count($files), 'Loaded one anonymous file.');
+ $this->assertEqual(1, count($files), 'Loaded one anonymous file.');
$file = end($files);
$this->assertTrue($file->isTemporary(), 'File is temporary.');
$usage = $this->container->get('file.usage')->listUsage($file);
diff --git a/core/modules/file/src/Tests/FileTokenReplaceTest.php b/core/modules/file/src/Tests/FileTokenReplaceTest.php
index e48f038..5bfa07b 100644
--- a/core/modules/file/src/Tests/FileTokenReplaceTest.php
+++ b/core/modules/file/src/Tests/FileTokenReplaceTest.php
@@ -78,8 +78,8 @@ public function testFileTokenReplacement() {
foreach ($tests as $input => $expected) {
$bubbleable_metadata = new BubbleableMetadata();
$output = $token_service->replace($input, ['file' => $file], ['langcode' => $language_interface->getId()], $bubbleable_metadata);
- $this->assertEquals($output, $expected, format_string('Sanitized file token %token replaced.', ['%token' => $input]));
- $this->assertEquals($bubbleable_metadata, $metadata_tests[$input]);
+ $this->assertEqual($output, $expected, format_string('Sanitized file token %token replaced.', ['%token' => $input]));
+ $this->assertEqual($bubbleable_metadata, $metadata_tests[$input]);
}
// Generate and test unsanitized tokens.
@@ -90,7 +90,7 @@ public function testFileTokenReplacement() {
foreach ($tests as $input => $expected) {
$output = $token_service->replace($input, ['file' => $file], ['langcode' => $language_interface->getId(), 'sanitize' => FALSE]);
- $this->assertEquals($output, $expected, format_string('Unsanitized file token %token replaced.', ['%token' => $input]));
+ $this->assertEqual($output, $expected, format_string('Unsanitized file token %token replaced.', ['%token' => $input]));
}
}
diff --git a/core/modules/file/src/Tests/SaveUploadFormTest.php b/core/modules/file/src/Tests/SaveUploadFormTest.php
index 3d3a7f4..e5680706 100644
--- a/core/modules/file/src/Tests/SaveUploadFormTest.php
+++ b/core/modules/file/src/Tests/SaveUploadFormTest.php
@@ -89,7 +89,7 @@ public function testNormal() {
$file1 = File::load($max_fid_after);
$this->assertTrue($file1, 'Loaded the file.');
// MIME type of the uploaded image may be either image/jpeg or image/png.
- $this->assertEquals(substr($file1->getMimeType(), 0, 5), 'image', 'A MIME type was set.');
+ $this->assertEqual(substr($file1->getMimeType(), 0, 5), 'image', 'A MIME type was set.');
// Reset the hook counters to get rid of the 'load' we just called.
file_test_reset();
@@ -110,7 +110,7 @@ public function testNormal() {
$file2 = File::load($max_fid_after);
$this->assertTrue($file2, 'Loaded the file');
// MIME type of the uploaded image may be either image/jpeg or image/png.
- $this->assertEquals(substr($file2->getMimeType(), 0, 5), 'image', 'A MIME type was set.');
+ $this->assertEqual(substr($file2->getMimeType(), 0, 5), 'image', 'A MIME type was set.');
// Load both files using File::loadMultiple().
$files = File::loadMultiple([$file1->id(), $file2->id()]);
@@ -467,7 +467,7 @@ public function testCombinedErrorMessages() {
* Tests highlighting of file upload field when it has an error.
*/
public function testUploadFieldIsHighlighted() {
- $this->assertEquals(0, count($this->cssSelect('input[name="files[file_test_upload][]"].error')), 'Successful file upload has no error.');
+ $this->assertEqual(0, count($this->cssSelect('input[name="files[file_test_upload][]"].error')), 'Successful file upload has no error.');
/** @var \Drupal\Core\File\FileSystemInterface $file_system */
$file_system = \Drupal::service('file_system');
@@ -478,7 +478,7 @@ public function testUploadFieldIsHighlighted() {
$this->drupalPostForm('file-test/save_upload_from_form_test', $edit, t('Submit'));
$this->assertResponse(200, 'Received a 200 response for posted test file.');
$this->assertRaw(t('Epic upload FAIL!'), 'Found the failure message.');
- $this->assertEquals(1, count($this->cssSelect('input[name="files[file_test_upload][]"].error')), 'File upload field has error.');
+ $this->assertEqual(1, count($this->cssSelect('input[name="files[file_test_upload][]"].error')), 'File upload field has error.');
}
}
diff --git a/core/modules/file/src/Tests/SaveUploadTest.php b/core/modules/file/src/Tests/SaveUploadTest.php
index 8ffef84..a6e6f9a 100644
--- a/core/modules/file/src/Tests/SaveUploadTest.php
+++ b/core/modules/file/src/Tests/SaveUploadTest.php
@@ -81,7 +81,7 @@ public function testNormal() {
$file1 = File::load($max_fid_after);
$this->assertTrue($file1, 'Loaded the file.');
// MIME type of the uploaded image may be either image/jpeg or image/png.
- $this->assertEquals(substr($file1->getMimeType(), 0, 5), 'image', 'A MIME type was set.');
+ $this->assertEqual(substr($file1->getMimeType(), 0, 5), 'image', 'A MIME type was set.');
// Reset the hook counters to get rid of the 'load' we just called.
file_test_reset();
@@ -100,7 +100,7 @@ public function testNormal() {
$file2 = File::load($max_fid_after);
$this->assertTrue($file2, 'Loaded the file');
// MIME type of the uploaded image may be either image/jpeg or image/png.
- $this->assertEquals(substr($file2->getMimeType(), 0, 5), 'image', 'A MIME type was set.');
+ $this->assertEqual(substr($file2->getMimeType(), 0, 5), 'image', 'A MIME type was set.');
// Load both files using File::loadMultiple().
$files = File::loadMultiple([$file1->id(), $file2->id()]);
diff --git a/core/modules/file/src/Tests/Update/FileUpdateTest.php b/core/modules/file/src/Tests/Update/FileUpdateTest.php
index dbdb531..bd724f4 100644
--- a/core/modules/file/src/Tests/Update/FileUpdateTest.php
+++ b/core/modules/file/src/Tests/Update/FileUpdateTest.php
@@ -48,12 +48,12 @@ public function testPostUpdate8001() {
// Check that field_file_generic formatter has a
// use_description_as_link_text setting which value is TRUE.
$formatter_settings = $this->config($view)->get('content.field_file_generic_2677990.settings');
- $this->assertEquals($formatter_settings, ['use_description_as_link_text' => TRUE]);
+ $this->assertEqual($formatter_settings, ['use_description_as_link_text' => TRUE]);
// Check that field_file_table formatter has a use_description_as_link_text
// setting which value is FALSE.
$formatter_settings = $this->config($view)->get('content.field_file_table_2677990.settings');
- $this->assertEquals($formatter_settings, ['use_description_as_link_text' => FALSE]);
+ $this->assertEqual($formatter_settings, ['use_description_as_link_text' => FALSE]);
}
}
diff --git a/core/modules/file/tests/src/Kernel/FileManagedUnitTestBase.php b/core/modules/file/tests/src/Kernel/FileManagedUnitTestBase.php
index 95ea546..5aadd3a 100644
--- a/core/modules/file/tests/src/Kernel/FileManagedUnitTestBase.php
+++ b/core/modules/file/tests/src/Kernel/FileManagedUnitTestBase.php
@@ -107,13 +107,13 @@ public function assertFileHookCalled($hook, $expected_count = 1, $message = NULL
* File object to compare.
*/
public function assertFileUnchanged(FileInterface $before, FileInterface $after) {
- $this->assertEquals($before->id(), $after->id(), t('File id is the same: %file1 == %file2.', ['%file1' => $before->id(), '%file2' => $after->id()]), 'File unchanged');
- $this->assertEquals($before->getOwner()->id(), $after->getOwner()->id(), t('File owner is the same: %file1 == %file2.', ['%file1' => $before->getOwner()->id(), '%file2' => $after->getOwner()->id()]), 'File unchanged');
- $this->assertEquals($before->getFilename(), $after->getFilename(), t('File name is the same: %file1 == %file2.', ['%file1' => $before->getFilename(), '%file2' => $after->getFilename()]), 'File unchanged');
- $this->assertEquals($before->getFileUri(), $after->getFileUri(), t('File path is the same: %file1 == %file2.', ['%file1' => $before->getFileUri(), '%file2' => $after->getFileUri()]), 'File unchanged');
- $this->assertEquals($before->getMimeType(), $after->getMimeType(), t('File MIME type is the same: %file1 == %file2.', ['%file1' => $before->getMimeType(), '%file2' => $after->getMimeType()]), 'File unchanged');
- $this->assertEquals($before->getSize(), $after->getSize(), t('File size is the same: %file1 == %file2.', ['%file1' => $before->getSize(), '%file2' => $after->getSize()]), 'File unchanged');
- $this->assertEquals($before->isPermanent(), $after->isPermanent(), t('File status is the same: %file1 == %file2.', ['%file1' => $before->isPermanent(), '%file2' => $after->isPermanent()]), 'File unchanged');
+ $this->assertEquals($before->id(), $after->id(), t('File id is the same: %file1 == %file2.', ['%file1' => $before->id(), '%file2' => $after->id()]));
+ $this->assertEquals($before->getOwner()->id(), $after->getOwner()->id(), t('File owner is the same: %file1 == %file2.', ['%file1' => $before->getOwner()->id(), '%file2' => $after->getOwner()->id()]));
+ $this->assertEquals($before->getFilename(), $after->getFilename(), t('File name is the same: %file1 == %file2.', ['%file1' => $before->getFilename(), '%file2' => $after->getFilename()]));
+ $this->assertEquals($before->getFileUri(), $after->getFileUri(), t('File path is the same: %file1 == %file2.', ['%file1' => $before->getFileUri(), '%file2' => $after->getFileUri()]));
+ $this->assertEquals($before->getMimeType(), $after->getMimeType(), t('File MIME type is the same: %file1 == %file2.', ['%file1' => $before->getMimeType(), '%file2' => $after->getMimeType()]));
+ $this->assertEquals($before->getSize(), $after->getSize(), t('File size is the same: %file1 == %file2.', ['%file1' => $before->getSize(), '%file2' => $after->getSize()]));
+ $this->assertEquals($before->isPermanent(), $after->isPermanent(), t('File status is the same: %file1 == %file2.', ['%file1' => $before->isPermanent(), '%file2' => $after->isPermanent()]));
}
/**
@@ -138,8 +138,8 @@ public function assertDifferentFile(FileInterface $file1, FileInterface $file2)
* File object to compare.
*/
public function assertSameFile(FileInterface $file1, FileInterface $file2) {
- $this->assertEquals($file1->id(), $file2->id(), t('Files have the same ids: %file1 == %file2.', ['%file1' => $file1->id(), '%file2-fid' => $file2->id()]), 'Same file');
- $this->assertEquals($file1->getFileUri(), $file2->getFileUri(), t('Files have the same path: %file1 == %file2.', ['%file1' => $file1->getFileUri(), '%file2' => $file2->getFileUri()]), 'Same file');
+ $this->assertEquals($file1->id(), $file2->id(), t('Files have the same ids: %file1 == %file2.', ['%file1' => $file1->id(), '%file2-fid' => $file2->id()]));
+ $this->assertEquals($file1->getFileUri(), $file2->getFileUri(), t('Files have the same path: %file1 == %file2.', ['%file1' => $file1->getFileUri(), '%file2' => $file2->getFileUri()]));
}
/**
diff --git a/core/modules/file/tests/src/Kernel/LoadTest.php b/core/modules/file/tests/src/Kernel/LoadTest.php
index 71312ce..d842def 100644
--- a/core/modules/file/tests/src/Kernel/LoadTest.php
+++ b/core/modules/file/tests/src/Kernel/LoadTest.php
@@ -45,11 +45,11 @@ public function testSingleValues() {
$by_fid_file = File::load($file->id());
$this->assertFileHookCalled('load');
$this->assertTrue(is_object($by_fid_file), '\Drupal\file\Entity\File::load() returned an object.');
- $this->assertEquals($by_fid_file->id(), $file->id(), 'Loading by fid got the same fid.', 'File');
- $this->assertEquals($by_fid_file->getFileUri(), $file->getFileUri(), 'Loading by fid got the correct filepath.', 'File');
- $this->assertEquals($by_fid_file->getFilename(), $file->getFilename(), 'Loading by fid got the correct filename.', 'File');
- $this->assertEquals($by_fid_file->getMimeType(), $file->getMimeType(), 'Loading by fid got the correct MIME type.', 'File');
- $this->assertEquals($by_fid_file->isPermanent(), $file->isPermanent(), 'Loading by fid got the correct status.', 'File');
+ $this->assertEquals($by_fid_file->id(), $file->id(), 'Loading by fid got the same fid.');
+ $this->assertEquals($by_fid_file->getFileUri(), $file->getFileUri(), 'Loading by fid got the correct filepath.');
+ $this->assertEquals($by_fid_file->getFilename(), $file->getFilename(), 'Loading by fid got the correct filename.');
+ $this->assertEquals($by_fid_file->getMimeType(), $file->getMimeType(), 'Loading by fid got the correct MIME type.');
+ $this->assertEquals($by_fid_file->isPermanent(), $file->isPermanent(), 'Loading by fid got the correct status.');
$this->assertTrue($by_fid_file->file_test['loaded'], 'file_test_file_load() was able to modify the file during load.');
}
@@ -67,7 +67,7 @@ public function testMultiple() {
$this->assertEquals(1, count($by_path_files), 'entity_load_multiple_by_properties() returned an array of the correct size.');
$by_path_file = reset($by_path_files);
$this->assertTrue($by_path_file->file_test['loaded'], 'file_test_file_load() was able to modify the file during load.');
- $this->assertEquals($by_path_file->id(), $file->id(), 'Loading by filepath got the correct fid.', 'File');
+ $this->assertEquals($by_path_file->id(), $file->id(), 'Loading by filepath got the correct fid.');
// Load by fid.
file_test_reset();
@@ -76,7 +76,7 @@ public function testMultiple() {
$this->assertEquals(1, count($by_fid_files), '\Drupal\file\Entity\File::loadMultiple() returned an array of the correct size.');
$by_fid_file = reset($by_fid_files);
$this->assertTrue($by_fid_file->file_test['loaded'], 'file_test_file_load() was able to modify the file during load.');
- $this->assertEquals($by_fid_file->getFileUri(), $file->getFileUri(), 'Loading by fid got the correct filepath.', 'File');
+ $this->assertEquals($by_fid_file->getFileUri(), $file->getFileUri(), 'Loading by fid got the correct filepath.');
}
/**
@@ -92,7 +92,7 @@ public function testUuidValues() {
$this->assertFileHookCalled('load');
$this->assertTrue(is_object($by_uuid_file), '\Drupal::entityManager()->loadEntityByUuid() returned a file object.');
if (is_object($by_uuid_file)) {
- $this->assertEquals($by_uuid_file->id(), $file->id(), 'Loading by UUID got the same fid.', 'File');
+ $this->assertEquals($by_uuid_file->id(), $file->id(), 'Loading by UUID got the same fid.');
$this->assertTrue($by_uuid_file->file_test['loaded'], 'file_test_file_load() was able to modify the file during load.');
}
}
diff --git a/core/modules/file/tests/src/Kernel/SaveTest.php b/core/modules/file/tests/src/Kernel/SaveTest.php
index cc34160..a0e5a31 100644
--- a/core/modules/file/tests/src/Kernel/SaveTest.php
+++ b/core/modules/file/tests/src/Kernel/SaveTest.php
@@ -31,7 +31,7 @@ public function testFileSave() {
$loaded_file = File::load($file->id());
$this->assertNotNull($loaded_file, 'Record exists in the database.');
$this->assertEquals($loaded_file->isPermanent(), $file->isPermanent(), 'Status was saved correctly.');
- $this->assertEquals($file->getSize(), filesize($file->getFileUri()), 'File size was set correctly.', 'File');
+ $this->assertEquals($file->getSize(), filesize($file->getFileUri()), 'File size was set correctly.');
$this->assertTrue($file->getChangedTime() > 1, 'File size was set correctly.', 'File');
$this->assertEquals($loaded_file->langcode->value, 'en', 'Langcode was defaulted correctly.');
@@ -43,7 +43,7 @@ public function testFileSave() {
// Check that the correct hooks were called.
$this->assertFileHooksCalled(['load', 'update']);
- $this->assertEquals($file->id(), $file->id(), 'The file ID of an existing file is not changed when updating the database.', 'File');
+ $this->assertEquals($file->id(), $file->id(), 'The file ID of an existing file is not changed when updating the database.');
$this->assertTrue($file->getChangedTime() >= $file->getChangedTime(), "Timestamp didn't go backwards.", 'File');
$loaded_file = File::load($file->id());
$this->assertNotNull($loaded_file, 'Record still exists in the database.', 'File');
diff --git a/core/modules/file/tests/src/Kernel/ValidatorTest.php b/core/modules/file/tests/src/Kernel/ValidatorTest.php
index 0647ac3..7b356e8 100644
--- a/core/modules/file/tests/src/Kernel/ValidatorTest.php
+++ b/core/modules/file/tests/src/Kernel/ValidatorTest.php
@@ -43,11 +43,11 @@ protected function setUp() {
public function testFileValidateExtensions() {
$file = File::create(['filename' => 'asdf.txt']);
$errors = file_validate_extensions($file, 'asdf txt pork');
- $this->assertEquals(count($errors), 0, 'Valid extension accepted.', 'File');
+ $this->assertEquals(count($errors), 0, 'Valid extension accepted.');
$file->setFilename('asdf.txt');
$errors = file_validate_extensions($file, 'exe png');
- $this->assertEquals(count($errors), 1, 'Invalid extension blocked.', 'File');
+ $this->assertEquals(count($errors), 1, 'Invalid extension blocked.');
}
/**
@@ -56,11 +56,11 @@ public function testFileValidateExtensions() {
public function testFileValidateIsImage() {
$this->assertTrue(file_exists($this->image->getFileUri()), 'The image being tested exists.', 'File');
$errors = file_validate_is_image($this->image);
- $this->assertEquals(count($errors), 0, 'No error reported for our image file.', 'File');
+ $this->assertEquals(count($errors), 0, 'No error reported for our image file.');
$this->assertTrue(file_exists($this->nonImage->getFileUri()), 'The non-image being tested exists.', 'File');
$errors = file_validate_is_image($this->nonImage);
- $this->assertEquals(count($errors), 1, 'An error reported for our non-image file.', 'File');
+ $this->assertEquals(count($errors), 1, 'An error reported for our non-image file.');
}
/**
@@ -71,19 +71,19 @@ public function testFileValidateIsImage() {
public function testFileValidateImageResolution() {
// Non-images.
$errors = file_validate_image_resolution($this->nonImage);
- $this->assertEquals(count($errors), 0, 'Should not get any errors for a non-image file.', 'File');
+ $this->assertEquals(count($errors), 0, 'Should not get any errors for a non-image file.');
$errors = file_validate_image_resolution($this->nonImage, '50x50', '100x100');
- $this->assertEquals(count($errors), 0, 'Do not check the resolution on non files.', 'File');
+ $this->assertEquals(count($errors), 0, 'Do not check the resolution on non files.');
// Minimum size.
$errors = file_validate_image_resolution($this->image);
- $this->assertEquals(count($errors), 0, 'No errors for an image when there is no minimum or maximum resolution.', 'File');
+ $this->assertEquals(count($errors), 0, 'No errors for an image when there is no minimum or maximum resolution.');
$errors = file_validate_image_resolution($this->image, 0, '200x1');
- $this->assertEquals(count($errors), 1, 'Got an error for an image that was not wide enough.', 'File');
+ $this->assertEquals(count($errors), 1, 'Got an error for an image that was not wide enough.');
$errors = file_validate_image_resolution($this->image, 0, '1x200');
- $this->assertEquals(count($errors), 1, 'Got an error for an image that was not tall enough.', 'File');
+ $this->assertEquals(count($errors), 1, 'Got an error for an image that was not tall enough.');
$errors = file_validate_image_resolution($this->image, 0, '200x200');
- $this->assertEquals(count($errors), 1, 'Small images report an error.', 'File');
+ $this->assertEquals(count($errors), 1, 'Small images report an error.');
// Maximum size.
if ($this->container->get('image.factory')->getToolkitId()) {
@@ -92,24 +92,24 @@ public function testFileValidateImageResolution() {
$this->image->setFileUri('temporary://druplicon.png');
$errors = file_validate_image_resolution($this->image, '10x5');
- $this->assertEquals(count($errors), 0, 'No errors should be reported when an oversized image can be scaled down.', 'File');
+ $this->assertEquals(count($errors), 0, 'No errors should be reported when an oversized image can be scaled down.');
$image = $this->container->get('image.factory')->get($this->image->getFileUri());
- $this->assertTrue($image->getWidth() <= 10, 'Image scaled to correct width.', 'File');
- $this->assertTrue($image->getHeight() <= 5, 'Image scaled to correct height.', 'File');
+ $this->assertTrue($image->getWidth() <= 10, 'Image scaled to correct width.');
+ $this->assertTrue($image->getHeight() <= 5, 'Image scaled to correct height.');
// Once again, now with negative width and height to force an error.
copy('core/misc/druplicon.png', 'temporary://druplicon.png');
$this->image->setFileUri('temporary://druplicon.png');
$errors = file_validate_image_resolution($this->image, '-10x-5');
- $this->assertEquals(count($errors), 1, 'An error reported for an oversized image that can not be scaled down.', 'File');
+ $this->assertEquals(count($errors), 1, 'An error reported for an oversized image that can not be scaled down.');
drupal_unlink('temporary://druplicon.png');
}
else {
// TODO: should check that the error is returned if no toolkit is available.
$errors = file_validate_image_resolution($this->image, '5x10');
- $this->assertEquals(count($errors), 1, 'Oversize images that cannot be scaled get an error.', 'File');
+ $this->assertEquals(count($errors), 1, 'Oversize images that cannot be scaled get an error.');
}
}
@@ -124,17 +124,17 @@ public function testFileValidateNameLength() {
$file->setFilename(str_repeat('x', 240));
$this->assertEquals(strlen($file->getFilename()), 240);
$errors = file_validate_name_length($file);
- $this->assertEquals(count($errors), 0, 'No errors reported for 240 length filename.', 'File');
+ $this->assertEquals(count($errors), 0, 'No errors reported for 240 length filename.');
// Add a filename with a length too long and test it.
$file->setFilename(str_repeat('x', 241));
$errors = file_validate_name_length($file);
- $this->assertEquals(count($errors), 1, 'An error reported for 241 length filename.', 'File');
+ $this->assertEquals(count($errors), 1, 'An error reported for 241 length filename.');
// Add a filename with an empty string and test it.
$file->setFilename('');
$errors = file_validate_name_length($file);
- $this->assertEquals(count($errors), 1, 'An error reported for 0 length filename.', 'File');
+ $this->assertEquals(count($errors), 1, 'An error reported for 0 length filename.');
}
@@ -145,13 +145,13 @@ public function testFileValidateSize() {
// Create a file with a size of 1000 bytes, and quotas of only 1 byte.
$file = File::create(['filesize' => 1000]);
$errors = file_validate_size($file, 0, 0);
- $this->assertEquals(count($errors), 0, 'No limits means no errors.', 'File');
+ $this->assertEquals(count($errors), 0, 'No limits means no errors.');
$errors = file_validate_size($file, 1, 0);
- $this->assertEquals(count($errors), 1, 'Error for the file being over the limit.', 'File');
+ $this->assertEquals(count($errors), 1, 'Error for the file being over the limit.');
$errors = file_validate_size($file, 0, 1);
- $this->assertEquals(count($errors), 1, 'Error for the user being over their limit.', 'File');
+ $this->assertEquals(count($errors), 1, 'Error for the user being over their limit.');
$errors = file_validate_size($file, 1, 1);
- $this->assertEquals(count($errors), 2, 'Errors for both the file and their limit.', 'File');
+ $this->assertEquals(count($errors), 2, 'Errors for both the file and their limit.');
}
}
diff --git a/core/modules/image/src/Tests/ImageAdminStylesTest.php b/core/modules/image/src/Tests/ImageAdminStylesTest.php
index 67f66e5..38fd984 100644
--- a/core/modules/image/src/Tests/ImageAdminStylesTest.php
+++ b/core/modules/image/src/Tests/ImageAdminStylesTest.php
@@ -132,7 +132,7 @@ public function testStyle() {
// Ensure that third party settings were added to the config entity.
// These are added by a hook_image_style_presave() implemented in
// image_module_test module.
- $this->assertEquals('bar', $style->getThirdPartySetting('image_module_test', 'foo'), 'Third party settings were added to the image style.');
+ $this->assertEqual('bar', $style->getThirdPartySetting('image_module_test', 'foo'), 'Third party settings were added to the image style.');
// Ensure that the image style URI matches our expected path.
$style_uri_path = $style->url();
@@ -146,7 +146,7 @@ public function testStyle() {
$uuids[$effect->getPluginId()] = $uuid;
$effect_configuration = $effect->getConfiguration();
foreach ($effect_edits[$effect->getPluginId()] as $field => $value) {
- $this->assertEquals($value, $effect_configuration['data'][$field], SafeMarkup::format('The %field field in the %effect effect has the correct value of %value.', ['%field' => $field, '%effect' => $effect->getPluginId(), '%value' => $value]));
+ $this->assertEqual($value, $effect_configuration['data'][$field], SafeMarkup::format('The %field field in the %effect effect has the correct value of %value.', ['%field' => $field, '%effect' => $effect->getPluginId(), '%value' => $value]));
}
}
@@ -191,7 +191,7 @@ public function testStyle() {
// Create an image to make sure it gets flushed after saving.
$image_path = $this->createSampleImage($style);
- $this->assertEquals($this->getImageCount($style), 1, format_string('Image style %style image %file successfully generated.', ['%style' => $style->label(), '%file' => $image_path]));
+ $this->assertEqual($this->getImageCount($style), 1, format_string('Image style %style image %file successfully generated.', ['%style' => $style->label(), '%file' => $image_path]));
$this->drupalPostForm($style_path, $edit, t('Update style'));
@@ -210,7 +210,7 @@ public function testStyle() {
// Check that the image was flushed after updating the style.
// This is especially important when renaming the style. Make sure that
// the old image directory has been deleted.
- $this->assertEquals($this->getImageCount($style), 0, format_string('Image style %style was flushed after renaming the style and updating the order of effects.', ['%style' => $style->label()]));
+ $this->assertEqual($this->getImageCount($style), 0, format_string('Image style %style was flushed after renaming the style and updating the order of effects.', ['%style' => $style->label()]));
// Load the style by the new name with the new weights.
$style = ImageStyle::load($style_name);
@@ -231,7 +231,7 @@ public function testStyle() {
// Create an image to make sure it gets flushed after deleting an effect.
$image_path = $this->createSampleImage($style);
- $this->assertEquals($this->getImageCount($style), 1, format_string('Image style %style image %file successfully generated.', ['%style' => $style->label(), '%file' => $image_path]));
+ $this->assertEqual($this->getImageCount($style), 1, format_string('Image style %style image %file successfully generated.', ['%style' => $style->label(), '%file' => $image_path]));
// Delete the 'image_crop' effect from the style.
$this->drupalPostForm($style_path . '/effects/' . $uuids['image_crop'] . '/delete', [], t('Delete'));
@@ -262,7 +262,7 @@ public function testStyle() {
$this->drupalPostForm(NULL, $edit, t('Add effect'));
$entity_type_manager = $this->container->get('entity_type.manager');
$style = $entity_type_manager->getStorage('image_style')->loadUnchanged($style_name);
- $this->assertEquals(count($style->getEffects()), 6, 'Rotate effect with transparent background was added.');
+ $this->assertEqual(count($style->getEffects()), 6, 'Rotate effect with transparent background was added.');
// Style deletion form.
@@ -451,7 +451,7 @@ public function testFlushUserInterface() {
$image_uri = $files[0]->uri;
$derivative_uri = $style->buildUri($image_uri);
$this->assertTrue($style->createDerivative($image_uri, $derivative_uri));
- $this->assertEquals($this->getImageCount($style), 1);
+ $this->assertEqual($this->getImageCount($style), 1);
// Go to image styles list page and check if the flush operation link
// exists.
@@ -463,7 +463,7 @@ public function testFlushUserInterface() {
$this->drupalPostForm($flush_path, [], t('Flush'));
// The derivative image file should have been deleted.
- $this->assertEquals($this->getImageCount($style), 0);
+ $this->assertEqual($this->getImageCount($style), 0);
}
/**
@@ -512,7 +512,7 @@ public function testConfigImport() {
$this->configImporter()->import();
$this->assertFalse(ImageStyle::load($style_name), 'Style deleted after config import.');
- $this->assertEquals($this->getImageCount($style), 0, 'Image style was flushed after being deleted by config import.');
+ $this->assertEqual($this->getImageCount($style), 0, 'Image style was flushed after being deleted by config import.');
}
/**
diff --git a/core/modules/image/src/Tests/ImageDimensionsTest.php b/core/modules/image/src/Tests/ImageDimensionsTest.php
index f59b063..136b0f1 100644
--- a/core/modules/image/src/Tests/ImageDimensionsTest.php
+++ b/core/modules/image/src/Tests/ImageDimensionsTest.php
@@ -47,8 +47,8 @@ public function testImageDimensions() {
];
// Verify that the original image matches the hard-coded values.
$image_file = $image_factory->get($original_uri);
- $this->assertEquals($image_file->getWidth(), $variables['#width']);
- $this->assertEquals($image_file->getHeight(), $variables['#height']);
+ $this->assertEqual($image_file->getWidth(), $variables['#width']);
+ $this->assertEqual($image_file->getHeight(), $variables['#height']);
// Scale an image that is wider than it is high.
$effect = [
@@ -63,14 +63,14 @@ public function testImageDimensions() {
$style->addImageEffect($effect);
$style->save();
- $this->assertEquals($this->getImageTag($variables), '
');
+ $this->assertEqual($this->getImageTag($variables), '
');
$this->assertFalse(file_exists($generated_uri), 'Generated file does not exist.');
$this->drupalGet($this->getAbsoluteUrl($url));
$this->assertResponse(200, 'Image was generated at the URL.');
$this->assertTrue(file_exists($generated_uri), 'Generated file does exist after we accessed it.');
$image_file = $image_factory->get($generated_uri);
- $this->assertEquals($image_file->getWidth(), 120);
- $this->assertEquals($image_file->getHeight(), 60);
+ $this->assertEqual($image_file->getWidth(), 120);
+ $this->assertEqual($image_file->getHeight(), 60);
// Rotate 90 degrees anticlockwise.
$effect = [
@@ -84,14 +84,14 @@ public function testImageDimensions() {
$style->addImageEffect($effect);
$style->save();
- $this->assertEquals($this->getImageTag($variables), '
');
+ $this->assertEqual($this->getImageTag($variables), '
');
$this->assertFalse(file_exists($generated_uri), 'Generated file does not exist.');
$this->drupalGet($this->getAbsoluteUrl($url));
$this->assertResponse(200, 'Image was generated at the URL.');
$this->assertTrue(file_exists($generated_uri), 'Generated file does exist after we accessed it.');
$image_file = $image_factory->get($generated_uri);
- $this->assertEquals($image_file->getWidth(), 60);
- $this->assertEquals($image_file->getHeight(), 120);
+ $this->assertEqual($image_file->getWidth(), 60);
+ $this->assertEqual($image_file->getHeight(), 120);
// Scale an image that is higher than it is wide (rotated by previous effect).
$effect = [
@@ -106,14 +106,14 @@ public function testImageDimensions() {
$style->addImageEffect($effect);
$style->save();
- $this->assertEquals($this->getImageTag($variables), '
');
+ $this->assertEqual($this->getImageTag($variables), '
');
$this->assertFalse(file_exists($generated_uri), 'Generated file does not exist.');
$this->drupalGet($this->getAbsoluteUrl($url));
$this->assertResponse(200, 'Image was generated at the URL.');
$this->assertTrue(file_exists($generated_uri), 'Generated file does exist after we accessed it.');
$image_file = $image_factory->get($generated_uri);
- $this->assertEquals($image_file->getWidth(), 45);
- $this->assertEquals($image_file->getHeight(), 90);
+ $this->assertEqual($image_file->getWidth(), 45);
+ $this->assertEqual($image_file->getHeight(), 90);
// Test upscale disabled.
$effect = [
@@ -128,14 +128,14 @@ public function testImageDimensions() {
$style->addImageEffect($effect);
$style->save();
- $this->assertEquals($this->getImageTag($variables), '
');
+ $this->assertEqual($this->getImageTag($variables), '
');
$this->assertFalse(file_exists($generated_uri), 'Generated file does not exist.');
$this->drupalGet($this->getAbsoluteUrl($url));
$this->assertResponse(200, 'Image was generated at the URL.');
$this->assertTrue(file_exists($generated_uri), 'Generated file does exist after we accessed it.');
$image_file = $image_factory->get($generated_uri);
- $this->assertEquals($image_file->getWidth(), 45);
- $this->assertEquals($image_file->getHeight(), 90);
+ $this->assertEqual($image_file->getWidth(), 45);
+ $this->assertEqual($image_file->getHeight(), 90);
// Add a desaturate effect.
$effect = [
@@ -146,14 +146,14 @@ public function testImageDimensions() {
$style->addImageEffect($effect);
$style->save();
- $this->assertEquals($this->getImageTag($variables), '
');
+ $this->assertEqual($this->getImageTag($variables), '
');
$this->assertFalse(file_exists($generated_uri), 'Generated file does not exist.');
$this->drupalGet($this->getAbsoluteUrl($url));
$this->assertResponse(200, 'Image was generated at the URL.');
$this->assertTrue(file_exists($generated_uri), 'Generated file does exist after we accessed it.');
$image_file = $image_factory->get($generated_uri);
- $this->assertEquals($image_file->getWidth(), 45);
- $this->assertEquals($image_file->getHeight(), 90);
+ $this->assertEqual($image_file->getWidth(), 45);
+ $this->assertEqual($image_file->getHeight(), 90);
// Add a random rotate effect.
$effect = [
@@ -167,7 +167,7 @@ public function testImageDimensions() {
$style->addImageEffect($effect);
$style->save();
- $this->assertEquals($this->getImageTag($variables), '
');
+ $this->assertEqual($this->getImageTag($variables), '
');
$this->assertFalse(file_exists($generated_uri), 'Generated file does not exist.');
$this->drupalGet($this->getAbsoluteUrl($url));
$this->assertResponse(200, 'Image was generated at the URL.');
@@ -186,14 +186,14 @@ public function testImageDimensions() {
$style->addImageEffect($effect);
$style->save();
- $this->assertEquals($this->getImageTag($variables), '
');
+ $this->assertEqual($this->getImageTag($variables), '
');
$this->assertFalse(file_exists($generated_uri), 'Generated file does not exist.');
$this->drupalGet($this->getAbsoluteUrl($url));
$this->assertResponse(200, 'Image was generated at the URL.');
$this->assertTrue(file_exists($generated_uri), 'Generated file does exist after we accessed it.');
$image_file = $image_factory->get($generated_uri);
- $this->assertEquals($image_file->getWidth(), 30);
- $this->assertEquals($image_file->getHeight(), 30);
+ $this->assertEqual($image_file->getWidth(), 30);
+ $this->assertEqual($image_file->getHeight(), 30);
// Rotate to a non-multiple of 90 degrees.
$effect = [
@@ -209,7 +209,7 @@ public function testImageDimensions() {
$style->save();
// @todo Uncomment this once
// https://www.drupal.org/project/drupal/issues/2670966 is resolved.
- // $this->assertEquals($this->getImageTag($variables), '
');
+ // $this->assertEqual($this->getImageTag($variables), '
');
$this->assertFalse(file_exists($generated_uri), 'Generated file does not exist.');
$this->drupalGet($this->getAbsoluteUrl($url));
$this->assertResponse(200, 'Image was generated at the URL.');
@@ -217,8 +217,8 @@ public function testImageDimensions() {
$image_file = $image_factory->get($generated_uri);
// @todo Uncomment this once
// https://www.drupal.org/project/drupal/issues/2670966 is resolved.
- // $this->assertEquals($image_file->getWidth(), 41);
- // $this->assertEquals($image_file->getHeight(), 41);
+ // $this->assertEqual($image_file->getWidth(), 41);
+ // $this->assertEqual($image_file->getHeight(), 41);
$effect_plugin = $style->getEffect($effect_id);
$style->deleteImageEffect($effect_plugin);
@@ -232,7 +232,7 @@ public function testImageDimensions() {
$style->addImageEffect($effect);
$style->save();
- $this->assertEquals($this->getImageTag($variables), '
');
+ $this->assertEqual($this->getImageTag($variables), '
');
// Test URI dependent image effect.
$style = ImageStyle::create(['name' => 'test_uri', 'label' => 'Test URI']);
@@ -253,28 +253,28 @@ public function testImageDimensions() {
// PNG original image. Should be resized to 100x100.
$generated_uri = 'public://styles/test_uri/public/' . \Drupal::service('file_system')->basename($original_uri);
$url = file_url_transform_relative($style->buildUrl($original_uri));
- $this->assertEquals($this->getImageTag($variables), '
');
+ $this->assertEqual($this->getImageTag($variables), '
');
$this->assertFalse(file_exists($generated_uri), 'Generated file does not exist.');
$this->drupalGet($this->getAbsoluteUrl($url));
$this->assertResponse(200, 'Image was generated at the URL.');
$this->assertTrue(file_exists($generated_uri), 'Generated file does exist after we accessed it.');
$image_file = $image_factory->get($generated_uri);
- $this->assertEquals($image_file->getWidth(), 100);
- $this->assertEquals($image_file->getHeight(), 100);
+ $this->assertEqual($image_file->getWidth(), 100);
+ $this->assertEqual($image_file->getHeight(), 100);
// GIF original image. Should be resized to 50x50.
$file = $files[1];
$original_uri = file_unmanaged_copy($file->uri, 'public://', FILE_EXISTS_RENAME);
$generated_uri = 'public://styles/test_uri/public/' . \Drupal::service('file_system')->basename($original_uri);
$url = file_url_transform_relative($style->buildUrl($original_uri));
$variables['#uri'] = $original_uri;
- $this->assertEquals($this->getImageTag($variables), '
');
+ $this->assertEqual($this->getImageTag($variables), '
');
$this->assertFalse(file_exists($generated_uri), 'Generated file does not exist.');
$this->drupalGet($this->getAbsoluteUrl($url));
$this->assertResponse(200, 'Image was generated at the URL.');
$this->assertTrue(file_exists($generated_uri), 'Generated file does exist after we accessed it.');
$image_file = $image_factory->get($generated_uri);
- $this->assertEquals($image_file->getWidth(), 50);
- $this->assertEquals($image_file->getHeight(), 50);
+ $this->assertEqual($image_file->getWidth(), 50);
+ $this->assertEqual($image_file->getHeight(), 50);
}
/**
diff --git a/core/modules/image/src/Tests/ImageFieldDefaultImagesTest.php b/core/modules/image/src/Tests/ImageFieldDefaultImagesTest.php
index d7da0ae..b82348e 100644
--- a/core/modules/image/src/Tests/ImageFieldDefaultImagesTest.php
+++ b/core/modules/image/src/Tests/ImageFieldDefaultImagesTest.php
@@ -67,18 +67,18 @@ public function testDefaultImages() {
$field = $this->createImageField($field_name, 'article', $storage_settings, $field_settings, $widget_settings);
// The field default image id should be 2.
- $this->assertEquals($field->getSetting('default_image')['uuid'], $default_images['field']->uuid());
+ $this->assertEqual($field->getSetting('default_image')['uuid'], $default_images['field']->uuid());
// Also test \Drupal\field\Entity\FieldConfig::getSettings().
- $this->assertEquals($field->getSettings()['default_image']['uuid'], $default_images['field']->uuid());
+ $this->assertEqual($field->getSettings()['default_image']['uuid'], $default_images['field']->uuid());
$field_storage = $field->getFieldStorageDefinition();
// The field storage default image id should be 1.
- $this->assertEquals($field_storage->getSetting('default_image')['uuid'], $default_images['field_storage']->uuid());
+ $this->assertEqual($field_storage->getSetting('default_image')['uuid'], $default_images['field_storage']->uuid());
// Also test \Drupal\field\Entity\FieldStorageConfig::getSettings().
- $this->assertEquals($field_storage->getSettings()['default_image']['uuid'], $default_images['field_storage']->uuid());
+ $this->assertEqual($field_storage->getSettings()['default_image']['uuid'], $default_images['field_storage']->uuid());
// Add another field with another default image to the page content type.
$field2 = FieldConfig::create([
@@ -154,7 +154,7 @@ public function testDefaultImages() {
// Confirm that the image default is shown for a new article node.
$article = $this->drupalCreateNode(['type' => 'article']);
$article_built = $this->drupalBuildEntityView($article);
- $this->assertEquals(
+ $this->assertEqual(
$article_built[$field_name][0]['#item']->target_id,
$default_images['field']->id(),
format_string(
@@ -173,7 +173,7 @@ public function testDefaultImages() {
// Confirm that the image default is shown for a new page node.
$page = $this->drupalCreateNode(['type' => 'page']);
$page_built = $this->drupalBuildEntityView($page);
- $this->assertEquals(
+ $this->assertEqual(
$page_built[$field_name][0]['#item']->target_id,
$default_images['field2']->id(),
format_string(
@@ -204,7 +204,7 @@ public function testDefaultImages() {
$node_storage->resetCache([$article->id(), $page->id()]);
$article_built = $this->drupalBuildEntityView($article = $node_storage->load($article->id()));
$page_built = $this->drupalBuildEntityView($page = $node_storage->load($page->id()));
- $this->assertEquals(
+ $this->assertEqual(
$article_built[$field_name][0]['#item']->target_id,
$default_images['field']->id(),
format_string(
@@ -212,7 +212,7 @@ public function testDefaultImages() {
['@fid' => $default_images['field']->id()]
)
);
- $this->assertEquals(
+ $this->assertEqual(
$page_built[$field_name][0]['#item']->target_id,
$default_images['field2']->id(),
format_string(
@@ -244,7 +244,7 @@ public function testDefaultImages() {
$page_built = $this->drupalBuildEntityView($page = $node_storage->load($page->id()));
// Confirm the article uses the new default.
- $this->assertEquals(
+ $this->assertEqual(
$article_built[$field_name][0]['#item']->target_id,
$default_images['field_new']->id(),
format_string(
@@ -253,7 +253,7 @@ public function testDefaultImages() {
)
);
// Confirm the page remains unchanged.
- $this->assertEquals(
+ $this->assertEqual(
$page_built[$field_name][0]['#item']->target_id,
$default_images['field2']->id(),
format_string(
@@ -286,7 +286,7 @@ public function testDefaultImages() {
$article_built = $this->drupalBuildEntityView($article = $node_storage->load($article->id()));
$page_built = $this->drupalBuildEntityView($page = $node_storage->load($page->id()));
// Confirm the article uses the new field storage (not field) default.
- $this->assertEquals(
+ $this->assertEqual(
$article_built[$field_name][0]['#item']->target_id,
$default_images['field_storage_new']->id(),
format_string(
@@ -295,7 +295,7 @@ public function testDefaultImages() {
)
);
// Confirm the page remains unchanged.
- $this->assertEquals(
+ $this->assertEqual(
$page_built[$field_name][0]['#item']->target_id,
$default_images['field2']->id(),
format_string(
diff --git a/core/modules/image/src/Tests/ImageFieldDisplayTest.php b/core/modules/image/src/Tests/ImageFieldDisplayTest.php
index 98e3fe3..05d716c 100644
--- a/core/modules/image/src/Tests/ImageFieldDisplayTest.php
+++ b/core/modules/image/src/Tests/ImageFieldDisplayTest.php
@@ -128,11 +128,11 @@ public function _testImageFieldFormatters($scheme) {
$this->assertTrue(!preg_match('/ image_style\:/', $cache_tags_header), 'No image style cache tag found.');
$this->assertRaw($default_output, 'Image linked to file formatter displaying correctly on full node view.');
// Verify that the image can be downloaded.
- $this->assertEquals(file_get_contents($test_image->uri), $this->drupalGet(file_create_url($image_uri)), 'File was downloaded successfully.');
+ $this->assertEqual(file_get_contents($test_image->uri), $this->drupalGet(file_create_url($image_uri)), 'File was downloaded successfully.');
if ($scheme == 'private') {
// Only verify HTTP headers when using private scheme and the headers are
// sent by Drupal.
- $this->assertEquals($this->drupalGetHeader('Content-Type'), 'image/png', 'Content-Type header was sent.');
+ $this->assertEqual($this->drupalGetHeader('Content-Type'), 'image/png', 'Content-Type header was sent.');
$this->assertTrue(strstr($this->drupalGetHeader('Cache-Control'), 'private') !== FALSE, 'Cache-Control header was sent.');
// Log out and try to access the file.
@@ -168,7 +168,7 @@ public function _testImageFieldFormatters($scheme) {
':alt' => $alt,
]
);
- $this->assertEquals(count($elements), 1, 'Image linked to content formatter displaying correctly on full node view.');
+ $this->assertEqual(count($elements), 1, 'Image linked to content formatter displaying correctly on full node view.');
// Test the image style 'thumbnail' formatter.
$display_options['settings']['image_link'] = '';
@@ -206,12 +206,12 @@ public function _testImageFieldFormatters($scheme) {
'settings' => ['image_style' => ''],
];
$expected_url = file_url_transform_relative(file_create_url($image_uri));
- $this->assertEquals($expected_url, $node->{$field_name}->view($display_options)[0]['#markup']);
+ $this->assertEqual($expected_url, $node->{$field_name}->view($display_options)[0]['#markup']);
// Test the image URL formatter with an image style.
$display_options['settings']['image_style'] = 'thumbnail';
$expected_url = file_url_transform_relative(ImageStyle::load('thumbnail')->buildUrl($image_uri));
- $this->assertEquals($expected_url, $node->{$field_name}->view($display_options)[0]['#markup']);
+ $this->assertEqual($expected_url, $node->{$field_name}->view($display_options)[0]['#markup']);
}
/**
@@ -437,7 +437,7 @@ public function testImageFieldDefaultImage() {
$private_field_storage = FieldStorageConfig::loadByName('node', $private_field_name);
$default_image = $private_field_storage->getSetting('default_image');
$file = \Drupal::entityManager()->loadEntityByUuid('file', $default_image['uuid']);
- $this->assertEquals('private', file_uri_scheme($file->getFileUri()), 'Default image uses private:// scheme.');
+ $this->assertEqual('private', file_uri_scheme($file->getFileUri()), 'Default image uses private:// scheme.');
$this->assertTrue($file->isPermanent(), 'The default image status is permanent.');
// Create a new node with no image attached and ensure that default private
// image is displayed.
diff --git a/core/modules/image/src/Tests/ImageFieldValidateTest.php b/core/modules/image/src/Tests/ImageFieldValidateTest.php
index 0e2c04f..98210d6 100644
--- a/core/modules/image/src/Tests/ImageFieldValidateTest.php
+++ b/core/modules/image/src/Tests/ImageFieldValidateTest.php
@@ -180,7 +180,7 @@ public function testAJAXValidationMessage() {
$elements = $this->xpath('//div[contains(@class, :class)]', [
':class' => 'messages--error',
]);
- $this->assertEquals(count($elements), 1, 'Ajax validation messages are displayed once.');
+ $this->assertEqual(count($elements), 1, 'Ajax validation messages are displayed once.');
}
}
diff --git a/core/modules/image/src/Tests/ImageStyleFlushTest.php b/core/modules/image/src/Tests/ImageStyleFlushTest.php
index 20d5495..4e8cd2c 100644
--- a/core/modules/image/src/Tests/ImageStyleFlushTest.php
+++ b/core/modules/image/src/Tests/ImageStyleFlushTest.php
@@ -82,11 +82,11 @@ public function testFlush() {
$image_path = $this->createSampleImage($style, 'public');
// Expecting to find 2 images, one is the sample.png image shown in
// image style preview.
- $this->assertEquals($this->getImageCount($style, 'public'), 2, format_string('Image style %style image %file successfully generated.', ['%style' => $style->label(), '%file' => $image_path]));
+ $this->assertEqual($this->getImageCount($style, 'public'), 2, format_string('Image style %style image %file successfully generated.', ['%style' => $style->label(), '%file' => $image_path]));
// Create an image for the 'private' wrapper.
$image_path = $this->createSampleImage($style, 'private');
- $this->assertEquals($this->getImageCount($style, 'private'), 1, format_string('Image style %style image %file successfully generated.', ['%style' => $style->label(), '%file' => $image_path]));
+ $this->assertEqual($this->getImageCount($style, 'private'), 1, format_string('Image style %style image %file successfully generated.', ['%style' => $style->label(), '%file' => $image_path]));
// Remove the 'image_scale' effect and updates the style, which in turn
// forces an image style flush.
@@ -101,10 +101,10 @@ public function testFlush() {
$this->assertResponse(200);
// Post flush, expected 1 image in the 'public' wrapper (sample.png).
- $this->assertEquals($this->getImageCount($style, 'public'), 1, format_string('Image style %style flushed correctly for %wrapper wrapper.', ['%style' => $style->label(), '%wrapper' => 'public']));
+ $this->assertEqual($this->getImageCount($style, 'public'), 1, format_string('Image style %style flushed correctly for %wrapper wrapper.', ['%style' => $style->label(), '%wrapper' => 'public']));
// Post flush, expected no image in the 'private' wrapper.
- $this->assertEquals($this->getImageCount($style, 'private'), 0, format_string('Image style %style flushed correctly for %wrapper wrapper.', ['%style' => $style->label(), '%wrapper' => 'private']));
+ $this->assertEqual($this->getImageCount($style, 'private'), 0, format_string('Image style %style flushed correctly for %wrapper wrapper.', ['%style' => $style->label(), '%wrapper' => 'private']));
}
}
diff --git a/core/modules/image/src/Tests/ImageStylesPathAndUrlTest.php b/core/modules/image/src/Tests/ImageStylesPathAndUrlTest.php
index 25403dd..baa4e7f 100644
--- a/core/modules/image/src/Tests/ImageStylesPathAndUrlTest.php
+++ b/core/modules/image/src/Tests/ImageStylesPathAndUrlTest.php
@@ -38,11 +38,11 @@ public function testImageStylePath() {
$scheme = 'public';
$actual = $this->style->buildUri("$scheme://foo/bar.gif");
$expected = "$scheme://styles/" . $this->style->id() . "/$scheme/foo/bar.gif";
- $this->assertEquals($actual, $expected, 'Got the path for a file URI.');
+ $this->assertEqual($actual, $expected, 'Got the path for a file URI.');
$actual = $this->style->buildUri('foo/bar.gif');
$expected = "$scheme://styles/" . $this->style->id() . "/$scheme/foo/bar.gif";
- $this->assertEquals($actual, $expected, 'Got the path for a relative file path.');
+ $this->assertEqual($actual, $expected, 'Got the path for a relative file path.');
}
/**
@@ -144,7 +144,7 @@ public function doImageStyleUrlAndPathTests($scheme, $clean_url = TRUE, $extra_s
$this->config('system.file')->set('default_scheme', $scheme)->save();
$relative_path = file_uri_target($original_uri);
$generate_url_from_relative_path = $this->style->buildUrl($relative_path, $clean_url);
- $this->assertEquals($generate_url, $generate_url_from_relative_path);
+ $this->assertEqual($generate_url, $generate_url_from_relative_path);
$this->config('system.file')->set('default_scheme', 'temporary')->save();
// Fetch the URL that generates the file.
@@ -153,17 +153,17 @@ public function doImageStyleUrlAndPathTests($scheme, $clean_url = TRUE, $extra_s
$this->assertTrue(file_exists($generated_uri), 'Generated file does exist after we accessed it.');
$this->assertRaw(file_get_contents($generated_uri), 'URL returns expected file.');
$image = $this->container->get('image.factory')->get($generated_uri);
- $this->assertEquals($this->drupalGetHeader('Content-Type'), $image->getMimeType(), 'Expected Content-Type was reported.');
- $this->assertEquals($this->drupalGetHeader('Content-Length'), $image->getFileSize(), 'Expected Content-Length was reported.');
+ $this->assertEqual($this->drupalGetHeader('Content-Type'), $image->getMimeType(), 'Expected Content-Type was reported.');
+ $this->assertEqual($this->drupalGetHeader('Content-Length'), $image->getFileSize(), 'Expected Content-Length was reported.');
// Check that we did not download the original file.
$original_image = $this->container->get('image.factory')->get($original_uri);
$this->assertNotEqual($this->drupalGetHeader('Content-Length'), $original_image->getFileSize());
if ($scheme == 'private') {
- $this->assertEquals($this->drupalGetHeader('Expires'), 'Sun, 19 Nov 1978 05:00:00 GMT', 'Expires header was sent.');
+ $this->assertEqual($this->drupalGetHeader('Expires'), 'Sun, 19 Nov 1978 05:00:00 GMT', 'Expires header was sent.');
$this->assertNotEqual(strpos($this->drupalGetHeader('Cache-Control'), 'no-cache'), FALSE, 'Cache-Control header contains \'no-cache\' to prevent caching.');
- $this->assertEquals($this->drupalGetHeader('X-Image-Owned-By'), 'image_module_test', 'Expected custom header has been added.');
+ $this->assertEqual($this->drupalGetHeader('X-Image-Owned-By'), 'image_module_test', 'Expected custom header has been added.');
// Make sure that a second request to the already existing derivative
// works too.
@@ -171,7 +171,7 @@ public function doImageStyleUrlAndPathTests($scheme, $clean_url = TRUE, $extra_s
$this->assertResponse(200, 'Image was generated at the URL.');
// Check that the second request also returned the generated image.
- $this->assertEquals($this->drupalGetHeader('Content-Length'), $image->getFileSize());
+ $this->assertEqual($this->drupalGetHeader('Content-Length'), $image->getFileSize());
// Check that we did not download the original file.
$this->assertNotEqual($this->drupalGetHeader('Content-Length'), $original_image->getFileSize());
@@ -203,8 +203,8 @@ public function doImageStyleUrlAndPathTests($scheme, $clean_url = TRUE, $extra_s
}
}
else {
- $this->assertEquals($this->drupalGetHeader('Expires'), 'Sun, 19 Nov 1978 05:00:00 GMT', 'Expires header was sent.');
- $this->assertEquals(strpos($this->drupalGetHeader('Cache-Control'), 'no-cache'), FALSE, 'Cache-Control header contains \'no-cache\' to prevent caching.');
+ $this->assertEqual($this->drupalGetHeader('Expires'), 'Sun, 19 Nov 1978 05:00:00 GMT', 'Expires header was sent.');
+ $this->assertEqual(strpos($this->drupalGetHeader('Cache-Control'), 'no-cache'), FALSE, 'Cache-Control header contains \'no-cache\' to prevent caching.');
if ($clean_url) {
// Add some extra chars to the token.
@@ -239,7 +239,7 @@ public function doImageStyleUrlAndPathTests($scheme, $clean_url = TRUE, $extra_s
// Stop supressing the security token in the URL.
$this->config('image.settings')->set('suppress_itok_output', FALSE)->save();
// Ensure allow_insecure_derivatives is enabled.
- $this->assertEquals($this->config('image.settings')->get('allow_insecure_derivatives'), TRUE);
+ $this->assertEqual($this->config('image.settings')->get('allow_insecure_derivatives'), TRUE);
// Check that a security token is still required when generating a second
// image derivative using the first one as a source.
$nested_url = $this->style->buildUrl($generated_uri, $clean_url);
diff --git a/core/modules/image/src/Tests/ImageThemeFunctionTest.php b/core/modules/image/src/Tests/ImageThemeFunctionTest.php
index d6485d8..54c5c64 100644
--- a/core/modules/image/src/Tests/ImageThemeFunctionTest.php
+++ b/core/modules/image/src/Tests/ImageThemeFunctionTest.php
@@ -97,7 +97,7 @@ public function testImageFormatterTheme() {
$element = $base_element;
$this->setRawContent($renderer->renderRoot($element));
$elements = $this->xpath('//a[@href=:path]/img[@class="image-style-test" and @src=:url and @width=:width and @height=:height]', [':path' => base_path() . $path, ':url' => $url, ':width' => $image->getWidth(), ':height' => $image->getHeight()]);
- $this->assertEquals(count($elements), 1, 'theme_image_formatter() correctly renders with a NULL value for the alt option.');
+ $this->assertEqual(count($elements), 1, 'theme_image_formatter() correctly renders with a NULL value for the alt option.');
// Test using theme_image_formatter() without an image title, alt text, or
// link options.
@@ -105,7 +105,7 @@ public function testImageFormatterTheme() {
$element['#item']->alt = '';
$this->setRawContent($renderer->renderRoot($element));
$elements = $this->xpath('//a[@href=:path]/img[@class="image-style-test" and @src=:url and @width=:width and @height=:height and @alt=""]', [':path' => base_path() . $path, ':url' => $url, ':width' => $image->getWidth(), ':height' => $image->getHeight()]);
- $this->assertEquals(count($elements), 1, 'theme_image_formatter() correctly renders without title, alt, or path options.');
+ $this->assertEqual(count($elements), 1, 'theme_image_formatter() correctly renders without title, alt, or path options.');
// Link the image to a fragment on the page, and not a full URL.
$fragment = $this->randomMachineName();
@@ -118,7 +118,7 @@ public function testImageFormatterTheme() {
':width' => $image->getWidth(),
':height' => $image->getHeight()
]);
- $this->assertEquals(count($elements), 1, 'theme_image_formatter() correctly renders a link fragment.');
+ $this->assertEqual(count($elements), 1, 'theme_image_formatter() correctly renders a link fragment.');
}
/**
@@ -148,14 +148,14 @@ public function testImageStyleTheme() {
$element = $base_element;
$this->setRawContent($renderer->renderRoot($element));
$elements = $this->xpath('//img[@class="image-style-image-test" and @src=:url and @alt=""]', [':url' => $url]);
- $this->assertEquals(count($elements), 1, 'theme_image_style() renders an image correctly.');
+ $this->assertEqual(count($elements), 1, 'theme_image_style() renders an image correctly.');
// Test using theme_image_style() with a NULL value for the alt option.
$element = $base_element;
$element['#alt'] = NULL;
$this->setRawContent($renderer->renderRoot($element));
$elements = $this->xpath('//img[@class="image-style-image-test" and @src=:url]', [':url' => $url]);
- $this->assertEquals(count($elements), 1, 'theme_image_style() renders an image correctly with a NULL value for the alt option.');
+ $this->assertEqual(count($elements), 1, 'theme_image_style() renders an image correctly with a NULL value for the alt option.');
}
/**
@@ -178,7 +178,7 @@ public function testImageAltFunctionality() {
$this->setRawContent($renderer->renderRoot($image_with_alt_property));
$elements = $this->xpath('//img[contains(@class, class) and contains(@alt, :alt)]', [":class" => "image-with-regular-alt", ":alt" => "Regular alt"]);
- $this->assertEquals(count($elements), 1, 'Regular alt displays correctly');
+ $this->assertEqual(count($elements), 1, 'Regular alt displays correctly');
// Test using alt attribute inside attributes.
$image_with_alt_attribute_alt_attribute = [
@@ -196,7 +196,7 @@ public function testImageAltFunctionality() {
$this->setRawContent($renderer->renderRoot($image_with_alt_attribute_alt_attribute));
$elements = $this->xpath('//img[contains(@class, class) and contains(@alt, :alt)]', [":class" => "image-with-attribute-alt", ":alt" => "Attribute alt"]);
- $this->assertEquals(count($elements), 1, 'Attribute alt displays correctly');
+ $this->assertEqual(count($elements), 1, 'Attribute alt displays correctly');
// Test using alt attribute as property and inside attributes.
$image_with_alt_attribute_both = [
@@ -215,7 +215,7 @@ public function testImageAltFunctionality() {
$this->setRawContent($renderer->renderRoot($image_with_alt_attribute_both));
$elements = $this->xpath('//img[contains(@class, class) and contains(@alt, :alt)]', [":class" => "image-with-attribute-alt", ":alt" => "Attribute alt"]);
- $this->assertEquals(count($elements), 1, 'Attribute alt overrides alt property if both set.');
+ $this->assertEqual(count($elements), 1, 'Attribute alt overrides alt property if both set.');
}
}
diff --git a/core/modules/menu_ui/src/Tests/MenuNodeTest.php b/core/modules/menu_ui/src/Tests/MenuNodeTest.php
index abfcca3..9990095 100644
--- a/core/modules/menu_ui/src/Tests/MenuNodeTest.php
+++ b/core/modules/menu_ui/src/Tests/MenuNodeTest.php
@@ -84,7 +84,7 @@ public function testMenuNodeFormWidget() {
];
$this->drupalPostForm(NULL, $edit, t('Save'));
$node = $this->drupalGetNodeByTitle($node_title);
- $this->assertEquals($node->getTitle(), $edit['title[0][value]']);
+ $this->assertEqual($node->getTitle(), $edit['title[0][value]']);
// Test that we cannot set a menu item from a menu that is not set as
// available.
diff --git a/core/modules/menu_ui/src/Tests/MenuTest.php b/core/modules/menu_ui/src/Tests/MenuTest.php
index 898ae1c..dde9502 100644
--- a/core/modules/menu_ui/src/Tests/MenuTest.php
+++ b/core/modules/menu_ui/src/Tests/MenuTest.php
@@ -141,7 +141,7 @@ public function testMenu() {
$menu_link_manager->resetDefinitions();
$instance = $menu_link_manager->createInstance($instance->getPluginId());
- $this->assertEquals($edit['weight'], $instance->getWeight(), 'Saving an existing link updates the weight.');
+ $this->assertEqual($edit['weight'], $instance->getWeight(), 'Saving an existing link updates the weight.');
$this->resetMenuLink($instance, $old_weight);
}
@@ -786,7 +786,7 @@ public function resetMenuLink(MenuLinkInterface $menu_link, $old_weight) {
// Verify menu link.
$instance = \Drupal::service('plugin.manager.menu.link')->createInstance($menu_link->getPluginId());
- $this->assertEquals($old_weight, $instance->getWeight(), 'Resets to the old weight.');
+ $this->assertEqual($old_weight, $instance->getWeight(), 'Resets to the old weight.');
}
/**
@@ -951,8 +951,8 @@ protected function doTestMenuBlock() {
], t('Save block'));
$block = Block::load($block_id);
$settings = $block->getPlugin()->getConfiguration();
- $this->assertEquals($settings['depth'], 3);
- $this->assertEquals($settings['level'], 2);
+ $this->assertEqual($settings['depth'], 3);
+ $this->assertEqual($settings['level'], 2);
// Reset settings.
$block->getPlugin()->setConfigurationValue('depth', 0);
$block->getPlugin()->setConfigurationValue('level', 1);
diff --git a/core/modules/menu_ui/src/Tests/MenuWebTestBase.php b/core/modules/menu_ui/src/Tests/MenuWebTestBase.php
index a9bc4f0..e0ee98f 100644
--- a/core/modules/menu_ui/src/Tests/MenuWebTestBase.php
+++ b/core/modules/menu_ui/src/Tests/MenuWebTestBase.php
@@ -48,29 +48,29 @@ public function assertMenuLink($menu_plugin_id, array $expected_item) {
if ($child_ids) {
sort($child_ids);
}
- $this->assertEquals($expected_item['children'], $child_ids);
+ $this->assertEqual($expected_item['children'], $child_ids);
unset($expected_item['children']);
}
if (isset($expected_item['parents'])) {
$parent_ids = array_values($menu_link_manager->getParentIds($menu_plugin_id));
- $this->assertEquals($expected_item['parents'], $parent_ids);
+ $this->assertEqual($expected_item['parents'], $parent_ids);
unset($expected_item['parents']);
}
if (isset($expected_item['langcode']) && $entity) {
- $this->assertEquals($entity->langcode->value, $expected_item['langcode']);
+ $this->assertEqual($entity->langcode->value, $expected_item['langcode']);
unset($expected_item['langcode']);
}
if (isset($expected_item['enabled']) && $entity) {
- $this->assertEquals($entity->enabled->value, $expected_item['enabled']);
+ $this->assertEqual($entity->enabled->value, $expected_item['enabled']);
unset($expected_item['enabled']);
}
foreach ($expected_item as $key => $value) {
$this->assertTrue(isset($definition[$key]));
- $this->assertEquals($definition[$key], $value);
+ $this->assertEqual($definition[$key], $value);
}
}
diff --git a/core/modules/migrate_drupal_ui/src/Tests/MigrateUpgradeTestBase.php b/core/modules/migrate_drupal_ui/src/Tests/MigrateUpgradeTestBase.php
index a9f478b..0e01c23 100644
--- a/core/modules/migrate_drupal_ui/src/Tests/MigrateUpgradeTestBase.php
+++ b/core/modules/migrate_drupal_ui/src/Tests/MigrateUpgradeTestBase.php
@@ -188,7 +188,7 @@ public function testMigrateUpgrade() {
->getDefinitions()) as $entity_type) {
$real_count = \Drupal::entityQuery($entity_type)->count()->execute();
$expected_count = isset($expected_counts[$entity_type]) ? $expected_counts[$entity_type] : 0;
- $this->assertEquals($expected_count, $real_count, "Found $real_count $entity_type entities, expected $expected_count.");
+ $this->assertEqual($expected_count, $real_count, "Found $real_count $entity_type entities, expected $expected_count.");
}
$version_tag = 'Drupal ' . $this->getLegacyDrupalVersion($this->sourceDatabase);
diff --git a/core/modules/node/src/Tests/AssertButtonsTrait.php b/core/modules/node/src/Tests/AssertButtonsTrait.php
index 4d84977..97016dc 100644
--- a/core/modules/node/src/Tests/AssertButtonsTrait.php
+++ b/core/modules/node/src/Tests/AssertButtonsTrait.php
@@ -36,10 +36,10 @@ public function assertButtons($buttons, $dropbutton = TRUE) {
// Dropbutton elements.
$elements = $this->xpath('//div[@class="dropbutton-wrapper"]//input[@type="submit"]');
- $this->assertEquals($count, count($elements));
+ $this->assertEqual($count, count($elements));
foreach ($elements as $element) {
$value = isset($element['value']) ? (string) $element['value'] : '';
- $this->assertEquals($buttons[$i], $value);
+ $this->assertEqual($buttons[$i], $value);
$i++;
}
}
diff --git a/core/modules/node/src/Tests/NodeRevisionsTest.php b/core/modules/node/src/Tests/NodeRevisionsTest.php
index 2c27079..da5b260 100644
--- a/core/modules/node/src/Tests/NodeRevisionsTest.php
+++ b/core/modules/node/src/Tests/NodeRevisionsTest.php
@@ -323,7 +323,7 @@ public function testNodeRevisionWithoutLogMessage() {
$this->assertText($new_title, 'New node title appears on the page.');
$node_storage->resetCache([$node->id()]);
$node_revision = $node_storage->load($node->id());
- $this->assertEquals($node_revision->revision_log->value, $revision_log, 'After an existing node revision is re-saved without a log message, the original log message is preserved.');
+ $this->assertEqual($node_revision->revision_log->value, $revision_log, 'After an existing node revision is re-saved without a log message, the original log message is preserved.');
// Create another node with an initial revision log message.
$node = $this->drupalCreateNode(['revision_log' => $revision_log]);
@@ -408,8 +408,8 @@ public function testRevisionTranslationRevert() {
/** @var \Drupal\node\NodeInterface $node */
$node = $node_storage->load($node->id());
$this->assertTrue($node->getRevisionId() > $translation_revision_id);
- $this->assertEquals($node->label(), $default_translation_title);
- $this->assertEquals($node->getTranslation('it')->label(), $translated_title);
+ $this->assertEqual($node->label(), $default_translation_title);
+ $this->assertEqual($node->getTranslation('it')->label(), $translated_title);
$this->assertNotEqual($node->untranslatable_string_field->value, $untranslatable_string);
$latest_revision_id = $translation->getRevisionId();
@@ -423,9 +423,9 @@ public function testRevisionTranslationRevert() {
/** @var \Drupal\node\NodeInterface $node */
$node = $node_storage->load($node->id());
$this->assertTrue($node->getRevisionId() > $latest_revision_id);
- $this->assertEquals($node->label(), $default_translation_title);
- $this->assertEquals($node->getTranslation('it')->label(), $translated_title);
- $this->assertEquals($node->untranslatable_string_field->value, $untranslatable_string);
+ $this->assertEqual($node->label(), $default_translation_title);
+ $this->assertEqual($node->getTranslation('it')->label(), $translated_title);
+ $this->assertEqual($node->untranslatable_string_field->value, $untranslatable_string);
$latest_revision_id = $translation->getRevisionId();
@@ -440,7 +440,7 @@ public function testRevisionTranslationRevert() {
/** @var \Drupal\node\NodeInterface $node */
$node = $node_storage->load($node->id());
$this->assertTrue($node->getRevisionId() > $latest_revision_id);
- $this->assertEquals($node->label(), $initial_title);
+ $this->assertEqual($node->label(), $initial_title);
$this->assertFalse($node->hasTranslation('it'));
}
diff --git a/core/modules/node/src/Tests/NodeTestBase.php b/core/modules/node/src/Tests/NodeTestBase.php
index 2e3c8ff..2dcaba5 100644
--- a/core/modules/node/src/Tests/NodeTestBase.php
+++ b/core/modules/node/src/Tests/NodeTestBase.php
@@ -61,7 +61,7 @@ protected function setUp() {
*/
public function assertNodeAccess(array $ops, NodeInterface $node, AccountInterface $account) {
foreach ($ops as $op => $result) {
- $this->assertEquals($result, $this->accessHandler->access($node, $op, $account), $this->nodeAccessAssertMessage($op, $result, $node->language()->getId()));
+ $this->assertEqual($result, $this->accessHandler->access($node, $op, $account), $this->nodeAccessAssertMessage($op, $result, $node->language()->getId()));
}
}
@@ -79,7 +79,7 @@ public function assertNodeAccess(array $ops, NodeInterface $node, AccountInterfa
* to check. If NULL, the untranslated (fallback) access is checked.
*/
public function assertNodeCreateAccess($bundle, $result, AccountInterface $account, $langcode = NULL) {
- $this->assertEquals($result, $this->accessHandler->createAccess($bundle, $account, [
+ $this->assertEqual($result, $this->accessHandler->createAccess($bundle, $account, [
'langcode' => $langcode,
]), $this->nodeAccessAssertMessage('create', $result, $langcode));
}
diff --git a/core/modules/node/src/Tests/NodeTypeTest.php b/core/modules/node/src/Tests/NodeTypeTest.php
index e9c1b20..70d3ac4 100644
--- a/core/modules/node/src/Tests/NodeTypeTest.php
+++ b/core/modules/node/src/Tests/NodeTypeTest.php
@@ -35,11 +35,11 @@ public function testNodeTypeGetFunctions() {
$this->assertTrue(isset($node_types['article']), 'Node type article is available.');
$this->assertTrue(isset($node_types['page']), 'Node type basic page is available.');
- $this->assertEquals($node_types['article']->label(), $node_names['article'], 'Correct node type base has been returned.');
+ $this->assertEqual($node_types['article']->label(), $node_names['article'], 'Correct node type base has been returned.');
$article = NodeType::load('article');
- $this->assertEquals($node_types['article'], $article, 'Correct node type has been returned.');
- $this->assertEquals($node_types['article']->label(), $article->label(), 'Correct node type name has been returned.');
+ $this->assertEqual($node_types['article'], $article, 'Correct node type has been returned.');
+ $this->assertEqual($node_types['article']->label(), $article->label(), 'Correct node type name has been returned.');
}
/**
@@ -67,7 +67,7 @@ public function testNodeTypeCreation() {
$this->assertCacheTag('config:node_type_list');
$this->assertCacheContext('user.permissions');
$elements = $this->cssSelect('dl.node-type-list dt');
- $this->assertEquals(3, count($elements));
+ $this->assertEqual(3, count($elements));
$edit = [
'name' => 'foo',
@@ -80,7 +80,7 @@ public function testNodeTypeCreation() {
$this->drupalGet('node/add');
$elements = $this->cssSelect('dl.node-type-list dt');
- $this->assertEquals(4, count($elements));
+ $this->assertEqual(4, count($elements));
}
/**
@@ -92,7 +92,7 @@ public function testNodeTypeEditing() {
$this->drupalLogin($web_user);
$field = FieldConfig::loadByName('node', 'page', 'body');
- $this->assertEquals($field->getLabel(), 'Body', 'Body field was found.');
+ $this->assertEqual($field->getLabel(), 'Body', 'Body field was found.');
// Verify that title and body fields are displayed.
$this->drupalGet('node/add/page');
@@ -132,7 +132,7 @@ public function testNodeTypeEditing() {
/** @var \Drupal\Core\Entity\EntityTypeBundleInfoInterface $bundle_info */
$bundle_info = \Drupal::service('entity_type.bundle.info');
$node_bundles = $bundle_info->getBundleInfo('node');
- $this->assertEquals($node_bundles['page']['label'], 'NewBar', 'Node type bundle cache is updated');
+ $this->assertEqual($node_bundles['page']['label'], 'NewBar', 'Node type bundle cache is updated');
// Remove the body field.
$this->drupalPostForm('admin/structure/types/manage/page/fields/node.page.body/delete', [], t('Delete'));
@@ -237,7 +237,7 @@ public function testNodeTypeFieldUiPermissions() {
public function testNodeTypeNoContentType() {
/** @var \Drupal\Core\Entity\EntityTypeBundleInfoInterface $bundle_info */
$bundle_info = \Drupal::service('entity_type.bundle.info');
- $this->assertEquals(2, count($bundle_info->getBundleInfo('node')), 'The bundle information service has 2 bundles for the Node entity type.');
+ $this->assertEqual(2, count($bundle_info->getBundleInfo('node')), 'The bundle information service has 2 bundles for the Node entity type.');
$web_user = $this->drupalCreateUser(['administer content types']);
$this->drupalLogin($web_user);
@@ -253,7 +253,7 @@ public function testNodeTypeNoContentType() {
]), 'Empty text when there are no content types in the system is correct.');
$bundle_info->clearCachedBundles();
- $this->assertEquals(0, count($bundle_info->getBundleInfo('node')), 'The bundle information service has 0 bundles for the Node entity type.');
+ $this->assertEqual(0, count($bundle_info->getBundleInfo('node')), 'The bundle information service has 0 bundles for the Node entity type.');
}
}
diff --git a/core/modules/node/tests/src/Functional/NodeTitleTest.php b/core/modules/node/tests/src/Functional/NodeTitleTest.php
index e690be7..0c37b12 100644
--- a/core/modules/node/tests/src/Functional/NodeTitleTest.php
+++ b/core/modules/node/tests/src/Functional/NodeTitleTest.php
@@ -56,15 +56,15 @@ public function testNodeTitle() {
// Test tag.
$this->drupalGet('node/' . $node->id());
$xpath = '//title';
- $this->assertEquals($this->xpath($xpath)[0]->getText(), $node->label() . ' | Drupal', 'Page title is equal to node title.', 'Node');
+ $this->assertEquals($this->xpath($xpath)[0]->getText(), $node->label() . ' | Drupal', 'Page title is equal to node title.');
// Test breadcrumb in comment preview.
$this->drupalGet('comment/reply/node/' . $node->id() . '/comment');
$xpath = '//nav[@class="breadcrumb"]/ol/li[last()]/a';
- $this->assertEquals($this->xpath($xpath)[0]->getText(), $node->label(), 'Node breadcrumb is equal to node title.', 'Node');
+ $this->assertEquals($this->xpath($xpath)[0]->getText(), $node->label(), 'Node breadcrumb is equal to node title.');
// Test node title in comment preview.
- $this->assertEquals($this->xpath('//article[contains(concat(" ", normalize-space(@class), " "), :node-class)]/h2/a/span', [':node-class' => ' node--type-' . $node->bundle() . ' '])[0]->getText(), $node->label(), 'Node preview title is equal to node title.', 'Node');
+ $this->assertEquals($this->xpath('//article[contains(concat(" ", normalize-space(@class), " "), :node-class)]/h2/a/span', [':node-class' => ' node--type-' . $node->bundle() . ' '])[0]->getText(), $node->label(), 'Node preview title is equal to node title.');
// Test node title is clickable on teaser list (/node).
$this->drupalGet('node');
@@ -80,7 +80,7 @@ public function testNodeTitle() {
$this->assertTitle(0 . ' | Drupal', 'Page title is equal to 0.', 'Node');
// Test that 0 appears in the template