Commit 055a35af authored by amateescu's avatar amateescu Committed by Berdir
Browse files

Issue #3034757 by Sahana _N, shubham.prakash, amateescu, Shruthi Shetty M,...

Issue #3034757 by Sahana _N, shubham.prakash, amateescu, Shruthi Shetty M, Berdir: Remove calls to deprecated method assertEqual() and replace with assertEquals()
parent 236ef204
......@@ -59,8 +59,8 @@ class PathautoEnablingEntityTypesTest extends BrowserTestBase {
// Verify that the comment entity type is not available when trying to add
// a new pattern, nor "broken".
$this->drupalGet('/admin/config/search/path/patterns/add');
$this->assertEqual(count($this->cssSelect('option[value = "canonical_entities:comment"]:contains(Comment)')), 0);
$this->assertEqual(count($this->cssSelect('option:contains(Broken)')), 0);
$this->assertCount(0, $this->cssSelect('option[value = "canonical_entities:comment"]:contains(Comment)'));
$this->assertCount(0, $this->cssSelect('option:contains(Broken)'));
// Enable the entity type and create a pattern for it.
$this->drupalGet('/admin/config/search/path/settings');
......@@ -82,7 +82,7 @@ class PathautoEnablingEntityTypesTest extends BrowserTestBase {
// be disabled.
$this->assertAliasExists(['alias' => '/comment/test-body']);
$this->drupalGet('/admin/config/search/path/settings');
$this->assertEqual(count($this->cssSelect('input[name = "enabled_entity_types[comment]"][disabled = "disabled"]')), 1);
$this->assertCount(1, $this->cssSelect('input[name = "enabled_entity_types[comment]"][disabled = "disabled"]'));
}
}
......@@ -84,7 +84,7 @@ class PathautoMassDeleteTest extends BrowserTestBase {
// Make sure that all of them are actually deleted.
$aliases = \Drupal::database()->select('url_alias', 'ua')->fields('ua', [])->execute()->fetchAll();
$this->assertEqual($aliases, [], "All the aliases have been deleted.");
$this->assertEmpty($aliases, "All the aliases have been deleted.");
// 2. Test deleting only specific (entity type) aliases.
$manager = $this->container->get('plugin.manager.alias_type');
......@@ -128,7 +128,7 @@ class PathautoMassDeleteTest extends BrowserTestBase {
// Make sure that only custom aliases and aliases with no information about
// their state still exist.
$aliases = \Drupal::database()->select('url_alias', 'ua')->fields('ua', ['source'])->execute()->fetchCol();
$this->assertEqual($aliases, ['/node/101', '/node/104', '/node/105'], 'Custom aliases still exist.');
$this->assertEquals(['/node/101', '/node/104', '/node/105'], $aliases, 'Custom aliases still exist.');
}
/**
......
......@@ -191,7 +191,7 @@ class PathautoLocaleTest extends WebDriverTestBase {
// Check that the generated alias has language Not Specified.
$alias = \Drupal::service('pathauto.alias_storage_helper')->loadBySource('/node/' . $node->id());
$this->assertEqual($alias['langcode'], LanguageInterface::LANGCODE_NOT_SPECIFIED, 'PathautoGenerator::createEntityAlias() adjusts the alias langcode from Not Applicable to Not Specified.');
$this->assertEquals(LanguageInterface::LANGCODE_NOT_SPECIFIED, $alias['langcode'], 'PathautoGenerator::createEntityAlias() adjusts the alias langcode from Not Applicable to Not Specified.');
// Check that the alias works.
$this->drupalGet('content/test-node');
......
......@@ -215,7 +215,7 @@ class PathautoKernelTest extends KernelTestBase {
foreach ($tests as $input => $expected) {
$output = \Drupal::service('pathauto.alias_cleaner')->cleanString($input);
$this->assertEquals($output, $expected, t("Drupal::service('pathauto.alias_cleaner')->cleanString('@input') expected '@expected', actual '@output'", [
$this->assertEquals($expected, $output, t("Drupal::service('pathauto.alias_cleaner')->cleanString('@input') expected '@expected', actual '@output'", [
'@input' => $input,
'@expected' => $expected,
'@output' => $output,
......@@ -236,7 +236,7 @@ class PathautoKernelTest extends KernelTestBase {
foreach ($tests as $input => $expected) {
$output = \Drupal::service('pathauto.alias_cleaner')->cleanAlias($input);
$this->assertEquals($output, $expected, t("Drupal::service('pathauto.generator')->cleanAlias('@input') expected '@expected', actual '@output'", [
$this->assertEquals($expected, $output, t("Drupal::service('pathauto.generator')->cleanAlias('@input') expected '@expected', actual '@output'", [
'@input' => $input,
'@expected' => $expected,
'@output' => $output,
......
......@@ -38,7 +38,7 @@ class PathautoTokenTest extends KernelTestBase {
/* @var \Drupal\pathauto\AliasCleanerInterface $alias_cleaner */
$alias_cleaner = \Drupal::service('pathauto.alias_cleaner');
$alias_cleaner->cleanTokenValues($replacements, $data, []);
$this->assertEqual($replacements['[array:join-path]'], 'test-first-arg/array-value');
$this->assertEquals('test-first-arg/array-value', $replacements['[array:join-path]']);
// Test additional token cleaning and its configuration.
$safe_tokens = $this->config('pathauto.settings')->get('safe_tokens');
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment