diff --git a/core/modules/action/tests/src/Kernel/Migrate/d6/MigrateActionConfigsTest.php b/core/modules/action/tests/src/Kernel/Migrate/d6/MigrateActionConfigsTest.php index 0ee1869..7e500fd 100644 --- a/core/modules/action/tests/src/Kernel/Migrate/d6/MigrateActionConfigsTest.php +++ b/core/modules/action/tests/src/Kernel/Migrate/d6/MigrateActionConfigsTest.php @@ -32,7 +32,7 @@ protected function setUp() { */ public function testActionSettings() { $config = $this->config('action.settings'); - $this->assertIdentical(35, $config->get('recursion_limit')); + $this->assertSame(35, $config->get('recursion_limit')); $this->assertConfigSchema(\Drupal::service('config.typed'), 'action.settings', $config->get()); } diff --git a/core/modules/action/tests/src/Kernel/Migrate/d6/MigrateActionsTest.php b/core/modules/action/tests/src/Kernel/Migrate/d6/MigrateActionsTest.php index 1737715..fff91bb 100644 --- a/core/modules/action/tests/src/Kernel/Migrate/d6/MigrateActionsTest.php +++ b/core/modules/action/tests/src/Kernel/Migrate/d6/MigrateActionsTest.php @@ -63,10 +63,10 @@ protected function assertEntity($id, $label, $type, $configuration) { $this->assertTrue($action instanceof Action); /** @var \Drupal\system\Entity\Action $action */ - $this->assertIdentical($id, $action->id()); - $this->assertIdentical($label, $action->label()); - $this->assertIdentical($type, $action->getType()); - $this->assertIdentical($configuration, $action->get('configuration')); + $this->assertSame($id, $action->id()); + $this->assertSame($label, $action->label()); + $this->assertSame($type, $action->getType()); + $this->assertSame($configuration, $action->get('configuration')); } } diff --git a/core/modules/action/tests/src/Kernel/Migrate/d7/MigrateActionsTest.php b/core/modules/action/tests/src/Kernel/Migrate/d7/MigrateActionsTest.php index 1601449..30de0c3 100644 --- a/core/modules/action/tests/src/Kernel/Migrate/d7/MigrateActionsTest.php +++ b/core/modules/action/tests/src/Kernel/Migrate/d7/MigrateActionsTest.php @@ -63,10 +63,10 @@ protected function assertEntity($id, $label, $type, $configuration) { $this->assertTrue($action instanceof Action); /** @var \Drupal\system\Entity\Action $action */ - $this->assertIdentical($id, $action->id()); - $this->assertIdentical($label, $action->label()); - $this->assertIdentical($type, $action->getType()); - $this->assertIdentical($configuration, $action->get('configuration')); + $this->assertSame($id, $action->id()); + $this->assertSame($label, $action->label()); + $this->assertSame($type, $action->getType()); + $this->assertSame($configuration, $action->get('configuration')); } } diff --git a/core/modules/aggregator/tests/src/Kernel/Migrate/MigrateAggregatorStubTest.php b/core/modules/aggregator/tests/src/Kernel/Migrate/MigrateAggregatorStubTest.php index 6d96aa1..7cedbc9 100644 --- a/core/modules/aggregator/tests/src/Kernel/Migrate/MigrateAggregatorStubTest.php +++ b/core/modules/aggregator/tests/src/Kernel/Migrate/MigrateAggregatorStubTest.php @@ -46,7 +46,7 @@ public function testItemStub() { $this->fail('Expected exception has not been thrown.'); } catch (MigrateException $e) { - $this->assertIdentical($e->getMessage(), + $this->assertSame($e->getMessage(), 'Stubbing failed, unable to generate value for field fid'); } diff --git a/core/modules/aggregator/tests/src/Kernel/Migrate/d6/MigrateAggregatorConfigsTest.php b/core/modules/aggregator/tests/src/Kernel/Migrate/d6/MigrateAggregatorConfigsTest.php index de6c87e..8fe03bb 100644 --- a/core/modules/aggregator/tests/src/Kernel/Migrate/d6/MigrateAggregatorConfigsTest.php +++ b/core/modules/aggregator/tests/src/Kernel/Migrate/d6/MigrateAggregatorConfigsTest.php @@ -32,13 +32,13 @@ protected function setUp() { */ public function testAggregatorSettings() { $config = $this->config('aggregator.settings'); - $this->assertIdentical('aggregator', $config->get('fetcher')); - $this->assertIdentical('aggregator', $config->get('parser')); - $this->assertIdentical(array('aggregator'), $config->get('processors')); - $this->assertIdentical(600, $config->get('items.teaser_length')); - $this->assertIdentical('
      • ', $config->get('items.allowed_html')); - $this->assertIdentical(9676800, $config->get('items.expire')); - $this->assertIdentical(3, $config->get('source.list_max')); + $this->assertSame('aggregator', $config->get('fetcher')); + $this->assertSame('aggregator', $config->get('parser')); + $this->assertSame(array('aggregator'), $config->get('processors')); + $this->assertSame(600, $config->get('items.teaser_length')); + $this->assertSame('
          • ', $config->get('items.allowed_html')); + $this->assertSame(9676800, $config->get('items.expire')); + $this->assertSame(3, $config->get('source.list_max')); $this->assertConfigSchema(\Drupal::service('config.typed'), 'aggregator.settings', $config->get()); } diff --git a/core/modules/aggregator/tests/src/Kernel/Migrate/d6/MigrateAggregatorFeedTest.php b/core/modules/aggregator/tests/src/Kernel/Migrate/d6/MigrateAggregatorFeedTest.php index 9dac60f..36c5600 100644 --- a/core/modules/aggregator/tests/src/Kernel/Migrate/d6/MigrateAggregatorFeedTest.php +++ b/core/modules/aggregator/tests/src/Kernel/Migrate/d6/MigrateAggregatorFeedTest.php @@ -32,17 +32,17 @@ protected function setUp() { public function testAggregatorFeedImport() { /** @var \Drupal\aggregator\Entity\Feed $feed */ $feed = Feed::load(5); - $this->assertIdentical('Know Your Meme', $feed->title->value); - $this->assertIdentical('en', $feed->language()->getId()); - $this->assertIdentical('http://knowyourmeme.com/newsfeed.rss', $feed->url->value); - $this->assertIdentical('900', $feed->refresh->value); - $this->assertIdentical('1387659487', $feed->checked->value); - $this->assertIdentical('0', $feed->queued->value); - $this->assertIdentical('http://knowyourmeme.com', $feed->link->value); - $this->assertIdentical('New items added to the News Feed', $feed->description->value); - $this->assertIdentical('http://b.thumbs.redditmedia.com/harEHsUUZVajabtC.png', $feed->image->value); - $this->assertIdentical('"213cc1365b96c310e92053c5551f0504"', $feed->etag->value); - $this->assertIdentical('0', $feed->modified->value); + $this->assertSame('Know Your Meme', $feed->title->value); + $this->assertSame('en', $feed->language()->getId()); + $this->assertSame('http://knowyourmeme.com/newsfeed.rss', $feed->url->value); + $this->assertSame('900', $feed->refresh->value); + $this->assertSame('1387659487', $feed->checked->value); + $this->assertSame('0', $feed->queued->value); + $this->assertSame('http://knowyourmeme.com', $feed->link->value); + $this->assertSame('New items added to the News Feed', $feed->description->value); + $this->assertSame('http://b.thumbs.redditmedia.com/harEHsUUZVajabtC.png', $feed->image->value); + $this->assertSame('"213cc1365b96c310e92053c5551f0504"', $feed->etag->value); + $this->assertSame('0', $feed->modified->value); } } diff --git a/core/modules/aggregator/tests/src/Kernel/Migrate/d6/MigrateAggregatorItemTest.php b/core/modules/aggregator/tests/src/Kernel/Migrate/d6/MigrateAggregatorItemTest.php index 5343d1e..b81cdd6 100644 --- a/core/modules/aggregator/tests/src/Kernel/Migrate/d6/MigrateAggregatorItemTest.php +++ b/core/modules/aggregator/tests/src/Kernel/Migrate/d6/MigrateAggregatorItemTest.php @@ -33,15 +33,15 @@ protected function setUp() { public function testAggregatorItem() { /** @var \Drupal\aggregator\Entity\Item $item */ $item = Item::load(1); - $this->assertIdentical('1', $item->id()); - $this->assertIdentical('5', $item->getFeedId()); - $this->assertIdentical('This (three) weeks in Drupal Core - January 10th 2014', $item->label()); - $this->assertIdentical('larowlan', $item->getAuthor()); - $this->assertIdentical("

            What's new with Drupal 8?

            ", $item->getDescription()); - $this->assertIdentical('https://groups.drupal.org/node/395218', $item->getLink()); - $this->assertIdentical('1389297196', $item->getPostedTime()); - $this->assertIdentical('en', $item->language()->getId()); - $this->assertIdentical('395218 at https://groups.drupal.org', $item->getGuid()); + $this->assertSame('1', $item->id()); + $this->assertSame('5', $item->getFeedId()); + $this->assertSame('This (three) weeks in Drupal Core - January 10th 2014', $item->label()); + $this->assertSame('larowlan', $item->getAuthor()); + $this->assertSame("

            What's new with Drupal 8?

            ", $item->getDescription()); + $this->assertSame('https://groups.drupal.org/node/395218', $item->getLink()); + $this->assertSame('1389297196', $item->getPostedTime()); + $this->assertSame('en', $item->language()->getId()); + $this->assertSame('395218 at https://groups.drupal.org', $item->getGuid()); } diff --git a/core/modules/aggregator/tests/src/Kernel/Migrate/d7/MigrateAggregatorFeedTest.php b/core/modules/aggregator/tests/src/Kernel/Migrate/d7/MigrateAggregatorFeedTest.php index fd20823..c00bf86 100644 --- a/core/modules/aggregator/tests/src/Kernel/Migrate/d7/MigrateAggregatorFeedTest.php +++ b/core/modules/aggregator/tests/src/Kernel/Migrate/d7/MigrateAggregatorFeedTest.php @@ -32,23 +32,23 @@ protected function setUp() { public function testAggregatorFeedImport() { /** @var \Drupal\aggregator\FeedInterface $feed */ $feed = Feed::load(1); - $this->assertIdentical('Know Your Meme', $feed->label()); - $this->assertIdentical('en', $feed->language()->getId()); - $this->assertIdentical('http://knowyourmeme.com/newsfeed.rss', $feed->getUrl()); - $this->assertIdentical('900', $feed->getRefreshRate()); + $this->assertSame('Know Your Meme', $feed->label()); + $this->assertSame('en', $feed->language()->getId()); + $this->assertSame('http://knowyourmeme.com/newsfeed.rss', $feed->getUrl()); + $this->assertSame('900', $feed->getRefreshRate()); // The feed's last checked time can change as the fixture is updated, so // assert that its format is correct. $checked_time = $feed->getLastCheckedTime(); $this->assertTrue(is_numeric($checked_time)); $this->assertTrue($checked_time > 1000000000); - $this->assertIdentical('0', $feed->getQueuedTime()); - $this->assertIdentical('http://knowyourmeme.com', $feed->link->value); - $this->assertIdentical('New items added to the News Feed', $feed->getDescription()); + $this->assertSame('0', $feed->getQueuedTime()); + $this->assertSame('http://knowyourmeme.com', $feed->link->value); + $this->assertSame('New items added to the News Feed', $feed->getDescription()); $this->assertNull($feed->getImage()); // As with getLastCheckedTime(), the etag can change as the fixture is // updated normally, so assert that its format is correct. $this->assertTrue(preg_match('/^"[a-z0-9]{32}"$/', $feed->getEtag())); - $this->assertIdentical('0', $feed->getLastModified()); + $this->assertSame('0', $feed->getLastModified()); } } diff --git a/core/modules/aggregator/tests/src/Kernel/Migrate/d7/MigrateAggregatorItemTest.php b/core/modules/aggregator/tests/src/Kernel/Migrate/d7/MigrateAggregatorItemTest.php index 83e59d9..84e42a1 100644 --- a/core/modules/aggregator/tests/src/Kernel/Migrate/d7/MigrateAggregatorItemTest.php +++ b/core/modules/aggregator/tests/src/Kernel/Migrate/d7/MigrateAggregatorItemTest.php @@ -42,16 +42,16 @@ public function testAggregatorItem() { foreach ($items as $original) { /** @var \Drupal\aggregator\ItemInterface $item */ $item = Item::load($original->iid); - $this->assertIdentical($original->fid, $item->getFeedId()); - $this->assertIdentical($original->title, $item->label()); + $this->assertSame($original->fid, $item->getFeedId()); + $this->assertSame($original->title, $item->label()); // If $original->author is an empty string, getAuthor() returns NULL so // we need to use assertEqual() here. $this->assertEqual($original->author, $item->getAuthor()); - $this->assertIdentical($original->description, $item->getDescription()); - $this->assertIdentical($original->link, $item->getLink()); - $this->assertIdentical($original->timestamp, $item->getPostedTime()); - $this->assertIdentical('en', $item->language()->getId()); - $this->assertIdentical($original->guid, $item->getGuid()); + $this->assertSame($original->description, $item->getDescription()); + $this->assertSame($original->link, $item->getLink()); + $this->assertSame($original->timestamp, $item->getPostedTime()); + $this->assertSame('en', $item->language()->getId()); + $this->assertSame($original->guid, $item->getGuid()); } } diff --git a/core/modules/aggregator/tests/src/Kernel/Migrate/d7/MigrateAggregatorSettingsTest.php b/core/modules/aggregator/tests/src/Kernel/Migrate/d7/MigrateAggregatorSettingsTest.php index 0fa8f63..9368267 100644 --- a/core/modules/aggregator/tests/src/Kernel/Migrate/d7/MigrateAggregatorSettingsTest.php +++ b/core/modules/aggregator/tests/src/Kernel/Migrate/d7/MigrateAggregatorSettingsTest.php @@ -27,13 +27,13 @@ protected function setUp() { */ public function testMigration() { $config = \Drupal::config('aggregator.settings')->get(); - $this->assertIdentical('aggregator', $config['fetcher']); - $this->assertIdentical('aggregator', $config['parser']); - $this->assertIdentical(['aggregator'], $config['processors']); - $this->assertIdentical('

            ', $config['items']['allowed_html']); - $this->assertIdentical(500, $config['items']['teaser_length']); - $this->assertIdentical(86400, $config['items']['expire']); - $this->assertIdentical(6, $config['source']['list_max']); + $this->assertSame('aggregator', $config['fetcher']); + $this->assertSame('aggregator', $config['parser']); + $this->assertSame(['aggregator'], $config['processors']); + $this->assertSame('

            ', $config['items']['allowed_html']); + $this->assertSame(500, $config['items']['teaser_length']); + $this->assertSame(86400, $config['items']['expire']); + $this->assertSame(6, $config['source']['list_max']); } } diff --git a/core/modules/basic_auth/src/Tests/Authentication/BasicAuthTest.php b/core/modules/basic_auth/src/Tests/Authentication/BasicAuthTest.php index 22bb9ca..eef8a1f 100644 --- a/core/modules/basic_auth/src/Tests/Authentication/BasicAuthTest.php +++ b/core/modules/basic_auth/src/Tests/Authentication/BasicAuthTest.php @@ -41,7 +41,7 @@ public function testBasicAuth() { $this->assertResponse('200', 'HTTP response is OK'); $this->curlClose(); $this->assertFalse($this->drupalGetHeader('X-Drupal-Cache')); - $this->assertIdentical(strpos($this->drupalGetHeader('Cache-Control'), 'public'), FALSE, 'Cache-Control is not set to public'); + $this->assertSame(strpos($this->drupalGetHeader('Cache-Control'), 'public'), FALSE, 'Cache-Control is not set to public'); $this->basicAuthGet($url, $account->getUsername(), $this->randomMachineName()); $this->assertNoText($account->getUsername(), 'Bad basic auth credentials do not authenticate the user.'); @@ -69,7 +69,7 @@ public function testBasicAuth() { $this->assertEqual($this->drupalGetHeader('X-Drupal-Cache'), 'MISS'); $this->basicAuthGet($url, $account->getUsername(), $account->pass_raw); $this->assertFalse($this->drupalGetHeader('X-Drupal-Cache')); - $this->assertIdentical(strpos($this->drupalGetHeader('Cache-Control'), 'public'), FALSE, 'No page cache response when requesting a cached page with basic auth credentials.'); + $this->assertSame(strpos($this->drupalGetHeader('Cache-Control'), 'public'), FALSE, 'No page cache response when requesting a cached page with basic auth credentials.'); } /** diff --git a/core/modules/big_pipe/src/Tests/BigPipeTest.php b/core/modules/big_pipe/src/Tests/BigPipeTest.php index a3f773e..823564e 100644 --- a/core/modules/big_pipe/src/Tests/BigPipeTest.php +++ b/core/modules/big_pipe/src/Tests/BigPipeTest.php @@ -456,7 +456,7 @@ protected function assertBigPipeNoJsMetaRefreshRedirect() { // First response: redirect. $this->assertEqual('HTTP/1.1 302 Found', $headers[0][':status'], 'The first response was a 302 (redirect).'); - $this->assertIdentical(0, strpos($headers[0]['set-cookie'], 'big_pipe_nojs=1'), 'The first response sets the big_pipe_nojs cookie.'); + $this->assertSame(0, strpos($headers[0]['set-cookie'], 'big_pipe_nojs=1'), 'The first response sets the big_pipe_nojs cookie.'); $this->assertEqual($original_url, $headers[0]['location'], 'The first response redirected back to the original page.'); $this->assertTrue(empty(array_diff(['cookies:big_pipe_nojs', 'session.exists'], explode(' ', $headers[0]['x-drupal-cache-contexts']))), 'The first response varies by the "cookies:big_pipe_nojs" and "session.exists" cache contexts.'); $this->assertFalse(isset($headers[0]['surrogate-control']), 'The first response has no "Surrogate-Control" header.'); diff --git a/core/modules/block/src/Tests/BlockTest.php b/core/modules/block/src/Tests/BlockTest.php index b13a912..e54587c 100644 --- a/core/modules/block/src/Tests/BlockTest.php +++ b/core/modules/block/src/Tests/BlockTest.php @@ -92,8 +92,8 @@ public function testBlockToggleVisibility() { /** @var \Drupal\block\BlockInterface $block */ $block = Block::load($block_id); $visibility_config = $block->getVisibilityConditions()->getConfiguration(); - $this->assertIdentical([], $visibility_config); - $this->assertIdentical([], $block->get('visibility')); + $this->assertSame([], $visibility_config); + $this->assertSame([], $block->get('visibility')); } /** @@ -432,7 +432,7 @@ public function testBlockCacheTags() { ); sort($expected_cache_tags); $keys = \Drupal::service('cache_contexts_manager')->convertTokensToKeys(['languages:language_interface', 'theme', 'user.permissions'])->getKeys(); - $this->assertIdentical($cache_entry->tags, $expected_cache_tags); + $this->assertSame($cache_entry->tags, $expected_cache_tags); $cache_entry = \Drupal::cache('render')->get('entity_view:block:powered:' . implode(':', $keys)); $expected_cache_tags = array( 'block_view', @@ -440,7 +440,7 @@ public function testBlockCacheTags() { 'rendered', ); sort($expected_cache_tags); - $this->assertIdentical($cache_entry->tags, $expected_cache_tags); + $this->assertSame($cache_entry->tags, $expected_cache_tags); // The "Powered by Drupal" block is modified; verify a cache miss. $block->setRegion('content'); @@ -481,7 +481,7 @@ public function testBlockCacheTags() { sort($expected_cache_tags); $keys = \Drupal::service('cache_contexts_manager')->convertTokensToKeys(['languages:language_interface', 'theme', 'user.permissions'])->getKeys(); $cache_entry = \Drupal::cache('render')->get('entity_view:block:powered:' . implode(':', $keys)); - $this->assertIdentical($cache_entry->tags, $expected_cache_tags); + $this->assertSame($cache_entry->tags, $expected_cache_tags); $expected_cache_tags = array( 'block_view', 'config:block.block.powered-2', @@ -490,7 +490,7 @@ public function testBlockCacheTags() { sort($expected_cache_tags); $keys = \Drupal::service('cache_contexts_manager')->convertTokensToKeys(['languages:language_interface', 'theme', 'user.permissions'])->getKeys(); $cache_entry = \Drupal::cache('render')->get('entity_view:block:powered-2:' . implode(':', $keys)); - $this->assertIdentical($cache_entry->tags, $expected_cache_tags); + $this->assertSame($cache_entry->tags, $expected_cache_tags); // Now we should have a cache hit again. $this->drupalGet(''); @@ -535,7 +535,7 @@ public function testUninstallTheme() { $theme_handler->uninstall(['seven']); // Ensure that the block configuration does not exist anymore. - $this->assertIdentical(NULL, Block::load($block->id())); + $this->assertSame(NULL, Block::load($block->id())); } /** diff --git a/core/modules/block/src/Tests/Views/DisplayBlockTest.php b/core/modules/block/src/Tests/Views/DisplayBlockTest.php index 368af68..6ceb884 100644 --- a/core/modules/block/src/Tests/Views/DisplayBlockTest.php +++ b/core/modules/block/src/Tests/Views/DisplayBlockTest.php @@ -366,8 +366,8 @@ public function testBlockContextualLinks() { $response = $this->drupalPostWithFormat('contextual/render', 'json', $post, array('query' => array('destination' => 'test-page'))); $this->assertResponse(200); $json = Json::decode($response); - $this->assertIdentical($json[$id], ''); - $this->assertIdentical($json[$cached_id], ''); + $this->assertSame($json[$id], ''); + $this->assertSame($json[$cached_id], ''); } } diff --git a/core/modules/block/tests/src/Kernel/BlockInterfaceTest.php b/core/modules/block/tests/src/Kernel/BlockInterfaceTest.php index 9216d49..f6d4383 100644 --- a/core/modules/block/tests/src/Kernel/BlockInterfaceTest.php +++ b/core/modules/block/tests/src/Kernel/BlockInterfaceTest.php @@ -44,12 +44,12 @@ public function testBlockInterface() { // Initial configuration of the block at construction time. /** @var $display_block \Drupal\Core\Block\BlockPluginInterface */ $display_block = $manager->createInstance('test_block_instantiation', $configuration); - $this->assertIdentical($display_block->getConfiguration(), $expected_configuration, 'The block was configured correctly.'); + $this->assertSame($display_block->getConfiguration(), $expected_configuration, 'The block was configured correctly.'); // Updating an element of the configuration. $display_block->setConfigurationValue('display_message', 'My custom display message.'); $expected_configuration['display_message'] = 'My custom display message.'; - $this->assertIdentical($display_block->getConfiguration(), $expected_configuration, 'The block configuration was updated correctly.'); + $this->assertSame($display_block->getConfiguration(), $expected_configuration, 'The block configuration was updated correctly.'); $definition = $display_block->getPluginDefinition(); $expected_form = array( @@ -87,17 +87,17 @@ public function testBlockInterface() { $actual_form = $display_block->buildConfigurationForm(array(), $form_state); // Remove the visibility sections, as that just tests condition plugins. unset($actual_form['visibility'], $actual_form['visibility_tabs']); - $this->assertIdentical($this->castSafeStrings($actual_form), $this->castSafeStrings($expected_form), 'Only the expected form elements were present.'); + $this->assertSame($this->castSafeStrings($actual_form), $this->castSafeStrings($expected_form), 'Only the expected form elements were present.'); $expected_build = array( '#children' => 'My custom display message.', ); // Ensure the build array is proper. - $this->assertIdentical($display_block->build(), $expected_build, 'The plugin returned the appropriate build array.'); + $this->assertSame($display_block->build(), $expected_build, 'The plugin returned the appropriate build array.'); // Ensure the machine name suggestion is correct. In truth, this is actually // testing BlockBase's implementation, not the interface itself. - $this->assertIdentical($display_block->getMachineNameSuggestion(), 'displaymessage', 'The plugin returned the expected machine name suggestion.'); + $this->assertSame($display_block->getMachineNameSuggestion(), 'displaymessage', 'The plugin returned the expected machine name suggestion.'); } } diff --git a/core/modules/block/tests/src/Kernel/BlockStorageUnitTest.php b/core/modules/block/tests/src/Kernel/BlockStorageUnitTest.php index 5704476..51e2360 100644 --- a/core/modules/block/tests/src/Kernel/BlockStorageUnitTest.php +++ b/core/modules/block/tests/src/Kernel/BlockStorageUnitTest.php @@ -100,7 +100,7 @@ protected function createTests() { 'visibility' => array(), ); - $this->assertIdentical($actual_properties, $expected_properties); + $this->assertSame($actual_properties, $expected_properties); $this->assertTrue($entity->getPlugin() instanceof TestHtmlBlock, 'The entity has an instance of the correct block plugin.'); } diff --git a/core/modules/block/tests/src/Kernel/BlockViewBuilderTest.php b/core/modules/block/tests/src/Kernel/BlockViewBuilderTest.php index 64b2109..cf61e7e 100644 --- a/core/modules/block/tests/src/Kernel/BlockViewBuilderTest.php +++ b/core/modules/block/tests/src/Kernel/BlockViewBuilderTest.php @@ -187,14 +187,14 @@ public function testBlockViewBuilderViewAlter() { // Establish baseline. $build = $this->getBlockRenderArray(); $this->setRawContent((string) $this->renderer->renderRoot($build)); - $this->assertIdentical(trim((string) $this->cssSelect('div')[0]), 'Llamas > unicorns!'); + $this->assertSame(trim((string) $this->cssSelect('div')[0]), 'Llamas > unicorns!'); // Enable the block view alter hook that adds a foo=bar attribute. \Drupal::state()->set('block_test_view_alter_suffix', TRUE); Cache::invalidateTags($this->block->getCacheTagsToInvalidate()); $build = $this->getBlockRenderArray(); $this->setRawContent((string) $this->renderer->renderRoot($build)); - $this->assertIdentical(trim((string) $this->cssSelect('[foo=bar]')[0]), 'Llamas > unicorns!'); + $this->assertSame(trim((string) $this->cssSelect('[foo=bar]')[0]), 'Llamas > unicorns!'); \Drupal::state()->set('block_test_view_alter_suffix', FALSE); \Drupal::state()->set('block_test.content', NULL); @@ -205,7 +205,7 @@ public function testBlockViewBuilderViewAlter() { \Drupal::state()->set('block_test_view_alter_append_pre_render_prefix', TRUE); $build = $this->getBlockRenderArray(); $this->assertFalse(isset($build['#prefix']), 'The appended #pre_render callback has not yet run before rendering.'); - $this->assertIdentical((string) $this->renderer->renderRoot($build), 'Hiya!
            '); + $this->assertSame((string) $this->renderer->renderRoot($build), 'Hiya!
            '); $this->assertTrue(isset($build['#prefix']) && $build['#prefix'] === 'Hiya!
            ', 'A cached block without content is altered.'); } @@ -266,7 +266,7 @@ public function testBlockViewBuilderBuildAlter() { \Drupal::state()->set('block_test_block_alter_create_placeholder', $value); $build = $this->getBlockRenderArray(); $this->assertTrue(isset($build['#create_placeholder'])); - $this->assertIdentical($value, $build['#create_placeholder']); + $this->assertSame($value, $build['#create_placeholder']); } \Drupal::state()->set('block_test_block_alter_create_placeholder', NULL); @@ -293,10 +293,10 @@ protected function assertBlockRenderedWithExpectedCacheability(array $expected_k // - the built render array; $this->pass('Built render array'); $build = $this->getBlockRenderArray(); - $this->assertIdentical($expected_keys, $build['#cache']['keys']); - $this->assertIdentical($expected_contexts, $build['#cache']['contexts']); - $this->assertIdentical($expected_tags, $build['#cache']['tags']); - $this->assertIdentical($expected_max_age, $build['#cache']['max-age']); + $this->assertSame($expected_keys, $build['#cache']['keys']); + $this->assertSame($expected_contexts, $build['#cache']['contexts']); + $this->assertSame($expected_tags, $build['#cache']['tags']); + $this->assertSame($expected_max_age, $build['#cache']['max-age']); $this->assertFalse(isset($build['#create_placeholder'])); // - the rendered render array; $this->pass('Rendered render array'); @@ -307,10 +307,10 @@ protected function assertBlockRenderedWithExpectedCacheability(array $expected_k $cid = implode(':', $expected_keys) . ':' . implode(':', \Drupal::service('cache_contexts_manager')->convertTokensToKeys($final_cache_contexts)->getKeys()); $cache_item = $this->container->get('cache.render')->get($cid); $this->assertTrue($cache_item, 'The block render element has been cached with the expected cache ID.'); - $this->assertIdentical(Cache::mergeTags($expected_tags, ['rendered']), $cache_item->tags); - $this->assertIdentical($final_cache_contexts, $cache_item->data['#cache']['contexts']); - $this->assertIdentical($expected_tags, $cache_item->data['#cache']['tags']); - $this->assertIdentical($expected_max_age, $cache_item->data['#cache']['max-age']); + $this->assertSame(Cache::mergeTags($expected_tags, ['rendered']), $cache_item->tags); + $this->assertSame($final_cache_contexts, $cache_item->data['#cache']['contexts']); + $this->assertSame($expected_tags, $cache_item->data['#cache']['tags']); + $this->assertSame($expected_max_age, $cache_item->data['#cache']['max-age']); $this->container->get('cache.render')->delete($cid); } diff --git a/core/modules/block/tests/src/Kernel/Migrate/d6/MigrateBlockTest.php b/core/modules/block/tests/src/Kernel/Migrate/d6/MigrateBlockTest.php index c5dfba2..fe8867b 100644 --- a/core/modules/block/tests/src/Kernel/Migrate/d6/MigrateBlockTest.php +++ b/core/modules/block/tests/src/Kernel/Migrate/d6/MigrateBlockTest.php @@ -92,7 +92,7 @@ public function assertEntity($id, $visibility, $region, $theme, $weight, $label, */ public function testBlockMigration() { $blocks = Block::loadMultiple(); - $this->assertIdentical(9, count($blocks)); + $this->assertSame(9, count($blocks)); // User blocks $visibility = []; diff --git a/core/modules/block_content/src/Tests/BlockContentListTest.php b/core/modules/block_content/src/Tests/BlockContentListTest.php index be8ea5e..94fdc1e 100644 --- a/core/modules/block_content/src/Tests/BlockContentListTest.php +++ b/core/modules/block_content/src/Tests/BlockContentListTest.php @@ -66,7 +66,7 @@ public function testListing() { // Check the contents of each row cell. The first cell contains the label, // the second contains the machine name, and the third contains the // operations list. - $this->assertIdentical((string) $elements[0], $label); + $this->assertSame((string) $elements[0], $label); // Edit the entity using the operations link. $blocks = $this->container diff --git a/core/modules/block_content/src/Tests/BlockContentListViewsTest.php b/core/modules/block_content/src/Tests/BlockContentListViewsTest.php index de0ff3b..7287028 100644 --- a/core/modules/block_content/src/Tests/BlockContentListViewsTest.php +++ b/core/modules/block_content/src/Tests/BlockContentListViewsTest.php @@ -44,10 +44,10 @@ public function testListing() { $expected_items = ['Block description', 'Block type', 'Updated', 'Operations']; foreach ($elements as $key => $element) { if ($element->xpath('a')) { - $this->assertIdentical(trim((string) $element->xpath('a')[0]), $expected_items[$key]); + $this->assertSame(trim((string) $element->xpath('a')[0]), $expected_items[$key]); } else { - $this->assertIdentical(trim((string) $element[0]), $expected_items[$key]); + $this->assertSame(trim((string) $element[0]), $expected_items[$key]); } } @@ -73,7 +73,7 @@ public function testListing() { // Check the contents of each row cell. The first cell contains the label, // the second contains the machine name, and the third contains the // operations list. - $this->assertIdentical((string) $elements[0]->xpath('a')[0], $label); + $this->assertSame((string) $elements[0]->xpath('a')[0], $label); // Edit the entity using the operations link. $blocks = $this->container diff --git a/core/modules/block_content/src/Tests/BlockContentSaveTest.php b/core/modules/block_content/src/Tests/BlockContentSaveTest.php index aabf7b6..fca0dbc 100644 --- a/core/modules/block_content/src/Tests/BlockContentSaveTest.php +++ b/core/modules/block_content/src/Tests/BlockContentSaveTest.php @@ -51,7 +51,7 @@ public function testImport() { // Test the import saved. $block_by_id = BlockContent::load($test_id); $this->assertTrue($block_by_id, 'Custom block load by block ID.'); - $this->assertIdentical($block_by_id->body->value, $block_array['body']['value']); + $this->assertSame($block_by_id->body->value, $block_array['body']['value']); } /** diff --git a/core/modules/block_content/tests/src/Kernel/Migrate/MigrateBlockContentBodyFieldTest.php b/core/modules/block_content/tests/src/Kernel/Migrate/MigrateBlockContentBodyFieldTest.php index 0bf29fd..ce8d8b6 100644 --- a/core/modules/block_content/tests/src/Kernel/Migrate/MigrateBlockContentBodyFieldTest.php +++ b/core/modules/block_content/tests/src/Kernel/Migrate/MigrateBlockContentBodyFieldTest.php @@ -37,17 +37,17 @@ public function testBlockContentBodyFieldMigration() { /** @var \Drupal\field\FieldStorageConfigInterface $storage */ $storage = FieldStorageConfig::load('block_content.body'); $this->assertTrue($storage instanceof FieldStorageConfigInterface); - $this->assertIdentical('block_content', $storage->getTargetEntityTypeId()); - $this->assertIdentical(['basic'], array_values($storage->getBundles())); - $this->assertIdentical('body', $storage->getName()); + $this->assertSame('block_content', $storage->getTargetEntityTypeId()); + $this->assertSame(['basic'], array_values($storage->getBundles())); + $this->assertSame('body', $storage->getName()); /** @var \Drupal\field\FieldConfigInterface $field */ $field = FieldConfig::load('block_content.basic.body'); $this->assertTrue($field instanceof FieldConfigInterface); - $this->assertIdentical('block_content', $field->getTargetEntityTypeId()); - $this->assertIdentical('basic', $field->getTargetBundle()); - $this->assertIdentical('body', $field->getName()); - $this->assertIdentical('Body', $field->getLabel()); + $this->assertSame('block_content', $field->getTargetEntityTypeId()); + $this->assertSame('basic', $field->getTargetBundle()); + $this->assertSame('body', $field->getName()); + $this->assertSame('Body', $field->getLabel()); } } diff --git a/core/modules/block_content/tests/src/Kernel/Migrate/MigrateBlockContentTypeTest.php b/core/modules/block_content/tests/src/Kernel/Migrate/MigrateBlockContentTypeTest.php index 9a3cbf0..e54c5b9 100644 --- a/core/modules/block_content/tests/src/Kernel/Migrate/MigrateBlockContentTypeTest.php +++ b/core/modules/block_content/tests/src/Kernel/Migrate/MigrateBlockContentTypeTest.php @@ -32,7 +32,7 @@ public function testBlockContentTypeMigration() { /** @var \Drupal\block_content\BlockContentTypeInterface $entity */ $entity = BlockContentType::load('basic'); $this->assertTrue($entity instanceof BlockContentTypeInterface); - $this->assertIdentical('Basic', $entity->label()); + $this->assertSame('Basic', $entity->label()); } } diff --git a/core/modules/block_content/tests/src/Kernel/Migrate/d6/MigrateBlockContentTest.php b/core/modules/block_content/tests/src/Kernel/Migrate/d6/MigrateBlockContentTest.php index bb5ba89..b7e5b6d 100644 --- a/core/modules/block_content/tests/src/Kernel/Migrate/d6/MigrateBlockContentTest.php +++ b/core/modules/block_content/tests/src/Kernel/Migrate/d6/MigrateBlockContentTest.php @@ -39,18 +39,18 @@ protected function setUp() { public function testBlockMigration() { /** @var BlockContent $block */ $block = BlockContent::load(1); - $this->assertIdentical('My block 1', $block->label()); + $this->assertSame('My block 1', $block->label()); $this->assertTrue(REQUEST_TIME <= $block->getChangedTime() && $block->getChangedTime() <= time()); - $this->assertIdentical('en', $block->language()->getId()); - $this->assertIdentical('

            My first custom block body

            ', $block->body->value); - $this->assertIdentical('full_html', $block->body->format); + $this->assertSame('en', $block->language()->getId()); + $this->assertSame('

            My first custom block body

            ', $block->body->value); + $this->assertSame('full_html', $block->body->format); $block = BlockContent::load(2); - $this->assertIdentical('My block 2', $block->label()); + $this->assertSame('My block 2', $block->label()); $this->assertTrue(REQUEST_TIME <= $block->getChangedTime() && $block->getChangedTime() <= time()); - $this->assertIdentical('en', $block->language()->getId()); - $this->assertIdentical('

            My second custom block body

            ', $block->body->value); - $this->assertIdentical('full_html', $block->body->format); + $this->assertSame('en', $block->language()->getId()); + $this->assertSame('

            My second custom block body

            ', $block->body->value); + $this->assertSame('full_html', $block->body->format); } } diff --git a/core/modules/block_content/tests/src/Kernel/Migrate/d7/MigrateCustomBlockTest.php b/core/modules/block_content/tests/src/Kernel/Migrate/d7/MigrateCustomBlockTest.php index 42990db..062d5f9 100644 --- a/core/modules/block_content/tests/src/Kernel/Migrate/d7/MigrateCustomBlockTest.php +++ b/core/modules/block_content/tests/src/Kernel/Migrate/d7/MigrateCustomBlockTest.php @@ -42,11 +42,11 @@ public function testCustomBlockMigration() { $block = BlockContent::load(1); $this->assertTrue($block instanceof BlockContentInterface); /** @var \Drupal\block_content\BlockContentInterface $block */ - $this->assertIdentical('Limerick', $block->label()); + $this->assertSame('Limerick', $block->label()); $expected_body = "A fellow jumped off a high wall\r\nAnd had a most terrible fall\r\nHe went back to bed\r\nWith a bump on his head\r\nThat's why you don't jump off a wall"; - $this->assertIdentical($expected_body, $block->body->value); - $this->assertIdentical('filtered_html', $block->body->format); + $this->assertSame($expected_body, $block->body->value); + $this->assertSame('filtered_html', $block->body->format); } } diff --git a/core/modules/book/src/Tests/BookTest.php b/core/modules/book/src/Tests/BookTest.php index e5367a2..0f4a940 100644 --- a/core/modules/book/src/Tests/BookTest.php +++ b/core/modules/book/src/Tests/BookTest.php @@ -300,7 +300,7 @@ function checkBookNode(EntityInterface $node, $nodes, $previous = FALSE, $up = F } // Compare expected and got breadcrumbs. - $this->assertIdentical($expected_breadcrumb, $got_breadcrumb, 'The breadcrumb is correctly displayed on the page.'); + $this->assertSame($expected_breadcrumb, $got_breadcrumb, 'The breadcrumb is correctly displayed on the page.'); // Check printer friendly version. $this->drupalGet('book/export/html/' . $node->id()); diff --git a/core/modules/book/tests/src/Kernel/Migrate/d6/MigrateBookConfigsTest.php b/core/modules/book/tests/src/Kernel/Migrate/d6/MigrateBookConfigsTest.php index a372e3a..e80395b 100644 --- a/core/modules/book/tests/src/Kernel/Migrate/d6/MigrateBookConfigsTest.php +++ b/core/modules/book/tests/src/Kernel/Migrate/d6/MigrateBookConfigsTest.php @@ -32,9 +32,9 @@ protected function setUp() { */ public function testBookSettings() { $config = $this->config('book.settings'); - $this->assertIdentical('book', $config->get('child_type')); - $this->assertIdentical('all pages', $config->get('block.navigation.mode')); - $this->assertIdentical(array('book'), $config->get('allowed_types')); + $this->assertSame('book', $config->get('child_type')); + $this->assertSame('all pages', $config->get('block.navigation.mode')); + $this->assertSame(array('book'), $config->get('allowed_types')); $this->assertConfigSchema(\Drupal::service('config.typed'), 'book.settings', $config->get()); } diff --git a/core/modules/book/tests/src/Kernel/Migrate/d6/MigrateBookTest.php b/core/modules/book/tests/src/Kernel/Migrate/d6/MigrateBookTest.php index ffcc3fe..60e5f4d 100644 --- a/core/modules/book/tests/src/Kernel/Migrate/d6/MigrateBookTest.php +++ b/core/modules/book/tests/src/Kernel/Migrate/d6/MigrateBookTest.php @@ -33,28 +33,28 @@ protected function setUp() { */ public function testBook() { $nodes = Node::loadMultiple(array(4, 5, 6, 7, 8)); - $this->assertIdentical('4', $nodes[4]->book['bid']); - $this->assertIdentical('0', $nodes[4]->book['pid']); + $this->assertSame('4', $nodes[4]->book['bid']); + $this->assertSame('0', $nodes[4]->book['pid']); - $this->assertIdentical('4', $nodes[5]->book['bid']); - $this->assertIdentical('4', $nodes[5]->book['pid']); + $this->assertSame('4', $nodes[5]->book['bid']); + $this->assertSame('4', $nodes[5]->book['pid']); - $this->assertIdentical('4', $nodes[6]->book['bid']); - $this->assertIdentical('5', $nodes[6]->book['pid']); + $this->assertSame('4', $nodes[6]->book['bid']); + $this->assertSame('5', $nodes[6]->book['pid']); - $this->assertIdentical('4', $nodes[7]->book['bid']); - $this->assertIdentical('5', $nodes[7]->book['pid']); + $this->assertSame('4', $nodes[7]->book['bid']); + $this->assertSame('5', $nodes[7]->book['pid']); - $this->assertIdentical('8', $nodes[8]->book['bid']); - $this->assertIdentical('0', $nodes[8]->book['pid']); + $this->assertSame('8', $nodes[8]->book['bid']); + $this->assertSame('0', $nodes[8]->book['pid']); $tree = \Drupal::service('book.manager')->bookTreeAllData(4); - $this->assertIdentical('4', $tree['49990 Node 4 4']['link']['nid']); - $this->assertIdentical('5', $tree['49990 Node 4 4']['below']['50000 Node 5 5']['link']['nid']); - $this->assertIdentical('6', $tree['49990 Node 4 4']['below']['50000 Node 5 5']['below']['50000 Node 6 6']['link']['nid']); - $this->assertIdentical('7', $tree['49990 Node 4 4']['below']['50000 Node 5 5']['below']['50000 Node 7 7']['link']['nid']); - $this->assertIdentical(array(), $tree['49990 Node 4 4']['below']['50000 Node 5 5']['below']['50000 Node 6 6']['below']); - $this->assertIdentical(array(), $tree['49990 Node 4 4']['below']['50000 Node 5 5']['below']['50000 Node 7 7']['below']); + $this->assertSame('4', $tree['49990 Node 4 4']['link']['nid']); + $this->assertSame('5', $tree['49990 Node 4 4']['below']['50000 Node 5 5']['link']['nid']); + $this->assertSame('6', $tree['49990 Node 4 4']['below']['50000 Node 5 5']['below']['50000 Node 6 6']['link']['nid']); + $this->assertSame('7', $tree['49990 Node 4 4']['below']['50000 Node 5 5']['below']['50000 Node 7 7']['link']['nid']); + $this->assertSame(array(), $tree['49990 Node 4 4']['below']['50000 Node 5 5']['below']['50000 Node 6 6']['below']); + $this->assertSame(array(), $tree['49990 Node 4 4']['below']['50000 Node 5 5']['below']['50000 Node 7 7']['below']); } } diff --git a/core/modules/breakpoint/tests/src/Kernel/BreakpointDiscoveryTest.php b/core/modules/breakpoint/tests/src/Kernel/BreakpointDiscoveryTest.php index 7683ea1..a21d05b 100644 --- a/core/modules/breakpoint/tests/src/Kernel/BreakpointDiscoveryTest.php +++ b/core/modules/breakpoint/tests/src/Kernel/BreakpointDiscoveryTest.php @@ -85,7 +85,7 @@ public function testThemeBreakpoints() { } // Test that the order is as expected. - $this->assertIdentical(array_keys($expected_breakpoints), array_keys($breakpoints)); + $this->assertSame(array_keys($expected_breakpoints), array_keys($breakpoints)); } /** @@ -188,7 +188,7 @@ public function testBreakpointGroups() { ); $breakpoint_groups = \Drupal::service('breakpoint.manager')->getGroups(); // Ensure the order is as expected. Should be sorted by label. - $this->assertIdentical($expected, $this->castSafeStrings($breakpoint_groups)); + $this->assertSame($expected, $this->castSafeStrings($breakpoint_groups)); $expected = array( 'breakpoint_theme_test' => 'theme', diff --git a/core/modules/ckeditor/src/Tests/CKEditorAdminTest.php b/core/modules/ckeditor/src/Tests/CKEditorAdminTest.php index d10180d..c58e10a 100644 --- a/core/modules/ckeditor/src/Tests/CKEditorAdminTest.php +++ b/core/modules/ckeditor/src/Tests/CKEditorAdminTest.php @@ -107,7 +107,7 @@ function testExistingFormat() { ), 'plugins' => ['language' => ['language_list' => 'un']], ); - $this->assertIdentical($this->castSafeStrings($ckeditor->getDefaultSettings()), $expected_default_settings); + $this->assertSame($this->castSafeStrings($ckeditor->getDefaultSettings()), $expected_default_settings); // Keep the "CKEditor" editor selected and click the "Configure" button. $this->drupalPostAjaxForm(NULL, $edit, 'editor_configure'); diff --git a/core/modules/ckeditor/src/Tests/CKEditorLoadingTest.php b/core/modules/ckeditor/src/Tests/CKEditorLoadingTest.php index 6efe647..5ebc68a 100644 --- a/core/modules/ckeditor/src/Tests/CKEditorLoadingTest.php +++ b/core/modules/ckeditor/src/Tests/CKEditorLoadingTest.php @@ -109,7 +109,7 @@ function testLoading() { 'isXssSafe' => FALSE, ))); $this->assertTrue($editor_settings_present, "Text Editor module's JavaScript settings are on the page."); - $this->assertIdentical($expected, $this->castSafeStrings($settings['editor']), "Text Editor module's JavaScript settings on the page are correct."); + $this->assertSame($expected, $this->castSafeStrings($settings['editor']), "Text Editor module's JavaScript settings on the page are correct."); $this->assertTrue($editor_js_present, 'Text Editor JavaScript is present.'); $this->assertTrue(count($body) === 1, 'A body field exists.'); $this->assertTrue(count($format_selector) === 1, 'A single text format selector exists on the page.'); @@ -140,7 +140,7 @@ function testLoading() { 'isXssSafe' => FALSE, ))); $this->assertTrue($editor_settings_present, "Text Editor module's JavaScript settings are on the page."); - $this->assertIdentical($expected, $this->castSafeStrings($settings['editor']), "Text Editor module's JavaScript settings on the page are correct."); + $this->assertSame($expected, $this->castSafeStrings($settings['editor']), "Text Editor module's JavaScript settings on the page are correct."); $this->assertTrue($editor_js_present, 'Text Editor JavaScript is present.'); $this->assertTrue(in_array('ckeditor/drupal.ckeditor', explode(',', $settings['ajaxPageState']['libraries'])), 'CKEditor glue library is present.'); @@ -148,11 +148,11 @@ function testLoading() { // comparing the setting sent with the page with the current query string. $settings = $this->getDrupalSettings(); $expected = $settings['ckeditor']['timestamp']; - $this->assertIdentical($expected, \Drupal::state()->get('system.css_js_query_string'), "CKEditor scripts cache-busting string is correct before flushing all caches."); + $this->assertSame($expected, \Drupal::state()->get('system.css_js_query_string'), "CKEditor scripts cache-busting string is correct before flushing all caches."); // Flush all caches then make sure that $settings['ckeditor']['timestamp'] // still matches. drupal_flush_all_caches(); - $this->assertIdentical($expected, \Drupal::state()->get('system.css_js_query_string'), "CKEditor scripts cache-busting string is correct after flushing all caches."); + $this->assertSame($expected, \Drupal::state()->get('system.css_js_query_string'), "CKEditor scripts cache-busting string is correct after flushing all caches."); } /** @@ -205,7 +205,7 @@ function testExternalStylesheets() { $expected = [ 'https://fonts.googleapis.com/css?family=Open+Sans', ]; - $this->assertIdentical($expected, _ckeditor_theme_css('test_ckeditor_stylesheets_external')); + $this->assertSame($expected, _ckeditor_theme_css('test_ckeditor_stylesheets_external')); // Case 2: Install theme which has an external protocol-relative CSS URL. $theme_handler->install(['test_ckeditor_stylesheets_protocol_relative']); @@ -213,7 +213,7 @@ function testExternalStylesheets() { $expected = [ '//fonts.googleapis.com/css?family=Open+Sans', ]; - $this->assertIdentical($expected, _ckeditor_theme_css('test_ckeditor_stylesheets_protocol_relative')); + $this->assertSame($expected, _ckeditor_theme_css('test_ckeditor_stylesheets_protocol_relative')); // Case 3: Install theme which has a relative CSS URL. $theme_handler->install(['test_ckeditor_stylesheets_relative']); @@ -221,7 +221,7 @@ function testExternalStylesheets() { $expected = [ 'core/modules/system/tests/themes/test_ckeditor_stylesheets_relative/css/yokotsoko.css', ]; - $this->assertIdentical($expected, _ckeditor_theme_css('test_ckeditor_stylesheets_relative')); + $this->assertSame($expected, _ckeditor_theme_css('test_ckeditor_stylesheets_relative')); } protected function getThingsToCheck() { diff --git a/core/modules/ckeditor/tests/modules/src/Kernel/CKEditorPluginManagerTest.php b/core/modules/ckeditor/tests/modules/src/Kernel/CKEditorPluginManagerTest.php index 92c448b..ea9537a 100644 --- a/core/modules/ckeditor/tests/modules/src/Kernel/CKEditorPluginManagerTest.php +++ b/core/modules/ckeditor/tests/modules/src/Kernel/CKEditorPluginManagerTest.php @@ -57,13 +57,13 @@ function testEnabledPlugins() { // Case 1: no CKEditor plugins. $definitions = array_keys($this->manager->getDefinitions()); sort($definitions); - $this->assertIdentical(array('drupalimage', 'drupalimagecaption', 'drupallink', 'internal', 'language', 'stylescombo'), $definitions, 'No CKEditor plugins found besides the built-in ones.'); + $this->assertSame(array('drupalimage', 'drupalimagecaption', 'drupallink', 'internal', 'language', 'stylescombo'), $definitions, 'No CKEditor plugins found besides the built-in ones.'); $enabled_plugins = array( 'drupalimage' => drupal_get_path('module', 'ckeditor') . '/js/plugins/drupalimage/plugin.js', 'drupallink' => drupal_get_path('module', 'ckeditor') . '/js/plugins/drupallink/plugin.js', ); - $this->assertIdentical($enabled_plugins, $this->manager->getEnabledPluginFiles($editor), 'Only built-in plugins are enabled.'); - $this->assertIdentical(array('internal' => NULL) + $enabled_plugins, $this->manager->getEnabledPluginFiles($editor, TRUE), 'Only the "internal" plugin is enabled.'); + $this->assertSame($enabled_plugins, $this->manager->getEnabledPluginFiles($editor), 'Only built-in plugins are enabled.'); + $this->assertSame(array('internal' => NULL) + $enabled_plugins, $this->manager->getEnabledPluginFiles($editor, TRUE), 'Only the "internal" plugin is enabled.'); // Enable the CKEditor Test module, which has the Llama plugin (plus four // variations of it, to cover all possible ways a plugin can be enabled) and @@ -75,9 +75,9 @@ function testEnabledPlugins() { // Case 2: CKEditor plugins are available. $plugin_ids = array_keys($this->manager->getDefinitions()); sort($plugin_ids); - $this->assertIdentical(array('drupalimage', 'drupalimagecaption', 'drupallink', 'internal', 'language', 'llama', 'llama_button', 'llama_contextual', 'llama_contextual_and_button', 'llama_css', 'stylescombo'), $plugin_ids, 'Additional CKEditor plugins found.'); - $this->assertIdentical($enabled_plugins, $this->manager->getEnabledPluginFiles($editor), 'Only the internal plugins are enabled.'); - $this->assertIdentical(array('internal' => NULL) + $enabled_plugins, $this->manager->getEnabledPluginFiles($editor, TRUE), 'Only the "internal" plugin is enabled.'); + $this->assertSame(array('drupalimage', 'drupalimagecaption', 'drupallink', 'internal', 'language', 'llama', 'llama_button', 'llama_contextual', 'llama_contextual_and_button', 'llama_css', 'stylescombo'), $plugin_ids, 'Additional CKEditor plugins found.'); + $this->assertSame($enabled_plugins, $this->manager->getEnabledPluginFiles($editor), 'Only the internal plugins are enabled.'); + $this->assertSame(array('internal' => NULL) + $enabled_plugins, $this->manager->getEnabledPluginFiles($editor, TRUE), 'Only the "internal" plugin is enabled.'); // Case 3: enable each of the newly available plugins, if possible: // a. Llama: cannot be enabled, since it does not implement @@ -106,27 +106,27 @@ function testEnabledPlugins() { $file['cb'] = drupal_get_path('module', 'ckeditor_test') . '/js/llama_contextual_and_button.js'; $file['css'] = drupal_get_path('module', 'ckeditor_test') . '/js/llama_css.js'; $expected = $enabled_plugins + array('llama_button' => $file['b'], 'llama_contextual_and_button' => $file['cb']); - $this->assertIdentical($expected, $this->manager->getEnabledPluginFiles($editor), 'The LlamaButton and LlamaContextualAndButton plugins are enabled.'); - $this->assertIdentical(array('internal' => NULL) + $expected, $this->manager->getEnabledPluginFiles($editor, TRUE), 'The LlamaButton and LlamaContextualAndButton plugins are enabled.'); + $this->assertSame($expected, $this->manager->getEnabledPluginFiles($editor), 'The LlamaButton and LlamaContextualAndButton plugins are enabled.'); + $this->assertSame(array('internal' => NULL) + $expected, $this->manager->getEnabledPluginFiles($editor, TRUE), 'The LlamaButton and LlamaContextualAndButton plugins are enabled.'); $settings['toolbar'] = $original_toolbar; $settings['toolbar']['rows'][0][0]['items'][] = 'Strike'; $editor->setSettings($settings); $editor->save(); $expected = $enabled_plugins + array('llama_contextual' => $file['c'], 'llama_contextual_and_button' => $file['cb']); - $this->assertIdentical($expected, $this->manager->getEnabledPluginFiles($editor), 'The LLamaContextual and LlamaContextualAndButton plugins are enabled.'); - $this->assertIdentical(array('internal' => NULL) + $expected, $this->manager->getEnabledPluginFiles($editor, TRUE), 'The LlamaContextual and LlamaContextualAndButton plugins are enabled.'); + $this->assertSame($expected, $this->manager->getEnabledPluginFiles($editor), 'The LLamaContextual and LlamaContextualAndButton plugins are enabled.'); + $this->assertSame(array('internal' => NULL) + $expected, $this->manager->getEnabledPluginFiles($editor, TRUE), 'The LlamaContextual and LlamaContextualAndButton plugins are enabled.'); $settings['toolbar']['rows'][0][0]['items'][] = 'Llama'; $editor->setSettings($settings); $editor->save(); $expected = $enabled_plugins + array('llama_button' => $file['b'], 'llama_contextual' => $file['c'], 'llama_contextual_and_button' => $file['cb']); - $this->assertIdentical($expected, $this->manager->getEnabledPluginFiles($editor), 'The LlamaButton, LlamaContextual and LlamaContextualAndButton plugins are enabled.'); - $this->assertIdentical(array('internal' => NULL) + $expected, $this->manager->getEnabledPluginFiles($editor, TRUE), 'The LLamaButton, LlamaContextual and LlamaContextualAndButton plugins are enabled.'); + $this->assertSame($expected, $this->manager->getEnabledPluginFiles($editor), 'The LlamaButton, LlamaContextual and LlamaContextualAndButton plugins are enabled.'); + $this->assertSame(array('internal' => NULL) + $expected, $this->manager->getEnabledPluginFiles($editor, TRUE), 'The LLamaButton, LlamaContextual and LlamaContextualAndButton plugins are enabled.'); $settings['toolbar']['rows'][0][0]['items'][] = 'LlamaCSS'; $editor->setSettings($settings); $editor->save(); $expected = $enabled_plugins + array('llama_button' => $file['b'], 'llama_contextual' => $file['c'], 'llama_contextual_and_button' => $file['cb'], 'llama_css' => $file['css']); - $this->assertIdentical($expected, $this->manager->getEnabledPluginFiles($editor), 'The LlamaButton, LlamaContextual, LlamaContextualAndButton and LlamaCSS plugins are enabled.'); - $this->assertIdentical(array('internal' => NULL) + $expected, $this->manager->getEnabledPluginFiles($editor, TRUE), 'The LLamaButton, LlamaContextual, LlamaContextualAndButton and LlamaCSS plugins are enabled.'); + $this->assertSame($expected, $this->manager->getEnabledPluginFiles($editor), 'The LlamaButton, LlamaContextual, LlamaContextualAndButton and LlamaCSS plugins are enabled.'); + $this->assertSame(array('internal' => NULL) + $expected, $this->manager->getEnabledPluginFiles($editor, TRUE), 'The LLamaButton, LlamaContextual, LlamaContextualAndButton and LlamaCSS plugins are enabled.'); } /** @@ -137,7 +137,7 @@ function testCssFiles() { $editor = Editor::load('filtered_html'); // Case 1: no CKEditor iframe instance CSS file. - $this->assertIdentical(array(), $this->manager->getCssFiles($editor), 'No iframe instance CSS file found.'); + $this->assertSame(array(), $this->manager->getCssFiles($editor), 'No iframe instance CSS file found.'); // Enable the CKEditor Test module, which has the LlamaCss plugin and // clear the editor manager's cache so it is picked up. @@ -153,7 +153,7 @@ function testCssFiles() { $expected = array( 'llama_css' => array(drupal_get_path('module', 'ckeditor_test') . '/css/llama.css') ); - $this->assertIdentical($expected, $this->manager->getCssFiles($editor), 'Iframe instance CSS file found.'); + $this->assertSame($expected, $this->manager->getCssFiles($editor), 'Iframe instance CSS file found.'); } } diff --git a/core/modules/ckeditor/tests/modules/src/Kernel/CKEditorTest.php b/core/modules/ckeditor/tests/modules/src/Kernel/CKEditorTest.php index 3711a54..c70f705 100644 --- a/core/modules/ckeditor/tests/modules/src/Kernel/CKEditorTest.php +++ b/core/modules/ckeditor/tests/modules/src/Kernel/CKEditorTest.php @@ -92,7 +92,7 @@ function testGetJSSettings() { $expected_config = $this->castSafeStrings($expected_config); ksort($expected_config); ksort($expected_config['allowedContent']); - $this->assertIdentical($expected_config, $this->castSafeStrings($this->ckeditor->getJSSettings($editor)), 'Generated JS settings are correct for default configuration.'); + $this->assertSame($expected_config, $this->castSafeStrings($this->ckeditor->getJSSettings($editor)), 'Generated JS settings are correct for default configuration.'); // Customize the configuration: add button, have two contextually enabled // buttons, and configure a CKEditor plugin setting. @@ -113,7 +113,7 @@ function testGetJSSettings() { $expected_config['drupalExternalPlugins']['llama_contextual_and_button'] = file_url_transform_relative(file_create_url('core/modules/ckeditor/tests/modules/js/llama_contextual_and_button.js')); $expected_config['contentsCss'][] = file_url_transform_relative(file_create_url('core/modules/ckeditor/tests/modules/ckeditor_test.css')); ksort($expected_config); - $this->assertIdentical($expected_config, $this->castSafeStrings($this->ckeditor->getJSSettings($editor)), 'Generated JS settings are correct for customized configuration.'); + $this->assertSame($expected_config, $this->castSafeStrings($this->ckeditor->getJSSettings($editor)), 'Generated JS settings are correct for customized configuration.'); // Change the allowed HTML tags; the "allowedContent" and "format_tags" // settings for CKEditor should automatically be updated as well. @@ -127,7 +127,7 @@ function testGetJSSettings() { $expected_config['allowedContent']['address'] = array('attributes' => 'class', 'styles' => FALSE, 'classes' => 'foo,bar-*'); $expected_config['format_tags'] = 'p;h1;h2;h3;h4;h5;h6;pre'; ksort($expected_config['allowedContent']); - $this->assertIdentical($expected_config, $this->castSafeStrings($this->ckeditor->getJSSettings($editor)), 'Generated JS settings are correct for customized configuration.'); + $this->assertSame($expected_config, $this->castSafeStrings($this->ckeditor->getJSSettings($editor)), 'Generated JS settings are correct for customized configuration.'); // Disable the filter_html filter: allow *all *tags. $format->setFilterConfig('filter_html', array('status' => 0)); @@ -136,7 +136,7 @@ function testGetJSSettings() { $expected_config['allowedContent'] = TRUE; $expected_config['disallowedContent'] = FALSE; $expected_config['format_tags'] = 'p;h1;h2;h3;h4;h5;h6;pre'; - $this->assertIdentical($expected_config, $this->castSafeStrings($this->ckeditor->getJSSettings($editor)), 'Generated JS settings are correct for customized configuration.'); + $this->assertSame($expected_config, $this->castSafeStrings($this->ckeditor->getJSSettings($editor)), 'Generated JS settings are correct for customized configuration.'); // Enable the filter_test_restrict_tags_and_attributes filter. $format->setFilterConfig('filter_test_restrict_tags_and_attributes', array( @@ -210,7 +210,7 @@ function testGetJSSettings() { ksort($expected_config); ksort($expected_config['allowedContent']); ksort($expected_config['disallowedContent']); - $this->assertIdentical($expected_config, $this->castSafeStrings($this->ckeditor->getJSSettings($editor)), 'Generated JS settings are correct for customized configuration.'); + $this->assertSame($expected_config, $this->castSafeStrings($this->ckeditor->getJSSettings($editor)), 'Generated JS settings are correct for customized configuration.'); } /** @@ -221,7 +221,7 @@ function testBuildToolbarJSSetting() { // Default toolbar. $expected = $this->getDefaultToolbarConfig(); - $this->assertIdentical($expected, $this->castSafeStrings($this->ckeditor->buildToolbarJSSetting($editor)), '"toolbar" configuration part of JS settings built correctly for default toolbar.'); + $this->assertSame($expected, $this->castSafeStrings($this->ckeditor->buildToolbarJSSetting($editor)), '"toolbar" configuration part of JS settings built correctly for default toolbar.'); // Customize the configuration. $settings = $editor->getSettings(); @@ -229,7 +229,7 @@ function testBuildToolbarJSSetting() { $editor->setSettings($settings); $editor->save(); $expected[0]['items'][] = 'Strike'; - $this->assertIdentical($expected, $this->castSafeStrings($this->ckeditor->buildToolbarJSSetting($editor)), '"toolbar" configuration part of JS settings built correctly for customized toolbar.'); + $this->assertSame($expected, $this->castSafeStrings($this->ckeditor->buildToolbarJSSetting($editor)), '"toolbar" configuration part of JS settings built correctly for customized toolbar.'); // Enable the editor_test module, customize further. $this->enableModules(array('ckeditor_test')); @@ -241,7 +241,7 @@ function testBuildToolbarJSSetting() { $editor->save(); $expected[0]['name'] = 'JunkScience'; $expected[0]['items'][] = 'Llama'; - $this->assertIdentical($expected, $this->castSafeStrings($this->ckeditor->buildToolbarJSSetting($editor)), '"toolbar" configuration part of JS settings built correctly for customized toolbar with contrib module-provided CKEditor plugin.'); + $this->assertSame($expected, $this->castSafeStrings($this->ckeditor->buildToolbarJSSetting($editor)), '"toolbar" configuration part of JS settings built correctly for customized toolbar with contrib module-provided CKEditor plugin.'); } /** @@ -252,12 +252,12 @@ function testBuildContentsCssJSSetting() { // Default toolbar. $expected = $this->getDefaultContentsCssConfig(); - $this->assertIdentical($expected, $this->ckeditor->buildContentsCssJSSetting($editor), '"contentsCss" configuration part of JS settings built correctly for default toolbar.'); + $this->assertSame($expected, $this->ckeditor->buildContentsCssJSSetting($editor), '"contentsCss" configuration part of JS settings built correctly for default toolbar.'); // Enable the editor_test module, which implements hook_ckeditor_css_alter(). $this->enableModules(array('ckeditor_test')); $expected[] = file_url_transform_relative(file_create_url(drupal_get_path('module', 'ckeditor_test') . '/ckeditor_test.css')); - $this->assertIdentical($expected, $this->ckeditor->buildContentsCssJSSetting($editor), '"contentsCss" configuration part of JS settings built correctly while a hook_ckeditor_css_alter() implementation exists.'); + $this->assertSame($expected, $this->ckeditor->buildContentsCssJSSetting($editor), '"contentsCss" configuration part of JS settings built correctly while a hook_ckeditor_css_alter() implementation exists.'); // Enable LlamaCss plugin, which adds an additional CKEditor stylesheet. $this->container->get('plugin.manager.editor')->clearCachedDefinitions(); @@ -269,7 +269,7 @@ function testBuildContentsCssJSSetting() { $editor->setSettings($settings); $editor->save(); $expected[] = file_url_transform_relative(file_create_url(drupal_get_path('module', 'ckeditor_test') . '/css/llama.css')); - $this->assertIdentical($expected, $this->ckeditor->buildContentsCssJSSetting($editor), '"contentsCss" configuration part of JS settings built correctly while a CKEditorPluginInterface implementation exists.'); + $this->assertSame($expected, $this->ckeditor->buildContentsCssJSSetting($editor), '"contentsCss" configuration part of JS settings built correctly while a CKEditorPluginInterface implementation exists.'); // Enable the Bartik theme, which specifies a CKEditor stylesheet. \Drupal::service('theme_handler')->install(['bartik']); @@ -278,7 +278,7 @@ function testBuildContentsCssJSSetting() { $expected[] = file_url_transform_relative(file_create_url('core/themes/bartik/css/components/captions.css')); $expected[] = file_url_transform_relative(file_create_url('core/themes/bartik/css/components/table.css')); $expected[] = file_url_transform_relative(file_create_url('core/themes/bartik/css/components/text-formatted.css')); - $this->assertIdentical($expected, $this->ckeditor->buildContentsCssJSSetting($editor), '"contentsCss" configuration part of JS settings built correctly while a theme providing a CKEditor stylesheet exists.'); + $this->assertSame($expected, $this->ckeditor->buildContentsCssJSSetting($editor), '"contentsCss" configuration part of JS settings built correctly while a theme providing a CKEditor stylesheet exists.'); } /** @@ -316,18 +316,18 @@ function testStylesComboGetConfig() { $editor->setSettings($settings); $editor->save(); $expected['stylesSet'] = array(); - $this->assertIdentical($expected, $stylescombo_plugin->getConfig($editor), '"StylesCombo" plugin configuration built correctly for customized toolbar.'); + $this->assertSame($expected, $stylescombo_plugin->getConfig($editor), '"StylesCombo" plugin configuration built correctly for customized toolbar.'); // Configure the optional "styles" setting in odd ways that shouldn't affect // the end result. $settings['plugins']['stylescombo']['styles'] = " \n"; $editor->setSettings($settings); $editor->save(); - $this->assertIdentical($expected, $stylescombo_plugin->getConfig($editor)); + $this->assertSame($expected, $stylescombo_plugin->getConfig($editor)); $settings['plugins']['stylescombo']['styles'] = "\r\n \n \r \n "; $editor->setSettings($settings); $editor->save(); - $this->assertIdentical($expected, $stylescombo_plugin->getConfig($editor), '"StylesCombo" plugin configuration built correctly for customized toolbar.'); + $this->assertSame($expected, $stylescombo_plugin->getConfig($editor), '"StylesCombo" plugin configuration built correctly for customized toolbar.'); // Now configure it properly, the end result should change. $settings['plugins']['stylescombo']['styles'] = "h1.title|Title\np.mAgical.Callout|Callout"; @@ -337,28 +337,28 @@ function testStylesComboGetConfig() { array('name' => 'Title', 'element' => 'h1', 'attributes' => array('class' => 'title')), array('name' => 'Callout', 'element' => 'p', 'attributes' => array('class' => 'mAgical Callout')), ); - $this->assertIdentical($expected, $stylescombo_plugin->getConfig($editor), '"StylesCombo" plugin configuration built correctly for customized toolbar.'); + $this->assertSame($expected, $stylescombo_plugin->getConfig($editor), '"StylesCombo" plugin configuration built correctly for customized toolbar.'); // Same configuration, but now interspersed with nonsense. Should yield the // same result. $settings['plugins']['stylescombo']['styles'] = " h1 .title | Title \r \n\r \np.mAgical .Callout|Callout\r"; $editor->setSettings($settings); $editor->save(); - $this->assertIdentical($expected, $stylescombo_plugin->getConfig($editor), '"StylesCombo" plugin configuration built correctly for customized toolbar.'); + $this->assertSame($expected, $stylescombo_plugin->getConfig($editor), '"StylesCombo" plugin configuration built correctly for customized toolbar.'); // Slightly different configuration: class names are optional. $settings['plugins']['stylescombo']['styles'] = " h1 | Title "; $editor->setSettings($settings); $editor->save(); $expected['stylesSet'] = array(array('name' => 'Title', 'element' => 'h1')); - $this->assertIdentical($expected, $stylescombo_plugin->getConfig($editor), '"StylesCombo" plugin configuration built correctly for customized toolbar.'); + $this->assertSame($expected, $stylescombo_plugin->getConfig($editor), '"StylesCombo" plugin configuration built correctly for customized toolbar.'); // Invalid syntax should cause stylesSet to be set to FALSE. $settings['plugins']['stylescombo']['styles'] = "h1"; $editor->setSettings($settings); $editor->save(); $expected['stylesSet'] = FALSE; - $this->assertIdentical($expected, $stylescombo_plugin->getConfig($editor), '"StylesCombo" plugin configuration built correctly for customized toolbar.'); + $this->assertSame($expected, $stylescombo_plugin->getConfig($editor), '"StylesCombo" plugin configuration built correctly for customized toolbar.'); } /** diff --git a/core/modules/color/tests/src/Functional/ColorTest.php b/core/modules/color/tests/src/Functional/ColorTest.php index dc44566..2b98246 100644 --- a/core/modules/color/tests/src/Functional/ColorTest.php +++ b/core/modules/color/tests/src/Functional/ColorTest.php @@ -186,7 +186,7 @@ function testLogoSettingOverride() { // Ensure that the overridden logo is present in Bartik, which is colorable. $this->drupalGet('admin/appearance/settings/bartik'); - $this->assertIdentical($GLOBALS['base_path'] . 'core/misc/druplicon.png', $this->getDrupalSettings()['color']['logo']); + $this->assertSame($GLOBALS['base_path'] . 'core/misc/druplicon.png', $this->getDrupalSettings()['color']['logo']); } /** diff --git a/core/modules/comment/src/Tests/CommentCSSTest.php b/core/modules/comment/src/Tests/CommentCSSTest.php index f015f3f..e65b33c 100644 --- a/core/modules/comment/src/Tests/CommentCSSTest.php +++ b/core/modules/comment/src/Tests/CommentCSSTest.php @@ -80,7 +80,7 @@ function testCommentClasses() { // Verify the data-history-node-id attribute, which is necessary for the // by-viewer class and the "new" indicator, see below. - $this->assertIdentical(1, count($this->xpath('//*[@data-history-node-id="' . $node->id() . '"]')), 'data-history-node-id attribute is set on node.'); + $this->assertSame(1, count($this->xpath('//*[@data-history-node-id="' . $node->id() . '"]')), 'data-history-node-id attribute is set on node.'); // Verify classes if the comment is visible for the current user. if ($case['comment_status'] == CommentInterface::PUBLISHED || $case['user'] == 'admin') { @@ -106,7 +106,7 @@ function testCommentClasses() { // drupal.comment-by-viewer library to add a by-viewer when the current // user (the viewer) was the author of the comment. We do this in Java- // Script to prevent breaking the render cache. - $this->assertIdentical(1, count($this->xpath('//*[contains(@class, "comment") and @data-comment-user-id="' . $case['comment_uid'] . '"]')), 'data-comment-user-id attribute is set on comment.'); + $this->assertSame(1, count($this->xpath('//*[contains(@class, "comment") and @data-comment-user-id="' . $case['comment_uid'] . '"]')), 'data-comment-user-id attribute is set on comment.'); $this->assertRaw(drupal_get_path('module', 'comment') . '/js/comment-by-viewer.js', 'drupal.comment-by-viewer library is present.'); } @@ -124,9 +124,9 @@ function testCommentClasses() { // comment that was created or changed after the last time the current // user read the corresponding node. if ($case['comment_status'] == CommentInterface::PUBLISHED || $case['user'] == 'admin') { - $this->assertIdentical(1, count($this->xpath('//*[contains(@class, "comment")]/*[@data-comment-timestamp="' . $comment->getChangedTime() . '"]')), 'data-comment-timestamp attribute is set on comment'); + $this->assertSame(1, count($this->xpath('//*[contains(@class, "comment")]/*[@data-comment-timestamp="' . $comment->getChangedTime() . '"]')), 'data-comment-timestamp attribute is set on comment'); $expectedJS = ($case['user'] !== 'anonymous'); - $this->assertIdentical($expectedJS, isset($settings['ajaxPageState']['libraries']) && in_array('comment/drupal.comment-new-indicator', explode(',', $settings['ajaxPageState']['libraries'])), 'drupal.comment-new-indicator library is present.'); + $this->assertSame($expectedJS, isset($settings['ajaxPageState']['libraries']) && in_array('comment/drupal.comment-new-indicator', explode(',', $settings['ajaxPageState']['libraries'])), 'drupal.comment-new-indicator library is present.'); } } } diff --git a/core/modules/comment/src/Tests/CommentFieldsTest.php b/core/modules/comment/src/Tests/CommentFieldsTest.php index 46de1be..843433e 100644 --- a/core/modules/comment/src/Tests/CommentFieldsTest.php +++ b/core/modules/comment/src/Tests/CommentFieldsTest.php @@ -134,8 +134,8 @@ public function testCommentFieldLinksNonDefaultName() { $this->drupalGet('node'); $link_info = $this->getDrupalSettings()['comment']['newCommentsLinks']['node']['comment2']['2']; - $this->assertIdentical($link_info['new_comment_count'], 1); - $this->assertIdentical($link_info['first_new_comment_link'], $node->url('canonical', ['fragment' => 'new'])); + $this->assertSame($link_info['new_comment_count'], 1); + $this->assertSame($link_info['first_new_comment_link'], $node->url('canonical', ['fragment' => 'new'])); } /** diff --git a/core/modules/comment/src/Tests/CommentLinksTest.php b/core/modules/comment/src/Tests/CommentLinksTest.php index 1115f57..abcc1b8 100644 --- a/core/modules/comment/src/Tests/CommentLinksTest.php +++ b/core/modules/comment/src/Tests/CommentLinksTest.php @@ -109,7 +109,7 @@ public function testCommentLinks() { $element = $this->cssSelect('article.js-comment > div'); // Get last child element. $element = end($element[0]); - $this->assertIdentical($element[0]->getName(), 'div', 'Last element is comment body.'); + $this->assertSame($element[0]->getName(), 'div', 'Last element is comment body.'); // Change weight to make links go after comment body. entity_get_display('comment', 'comment', 'default') @@ -119,7 +119,7 @@ public function testCommentLinks() { $element = $this->cssSelect('article.js-comment > div'); // Get last child element. $element = end($element[0]); - $this->assertIdentical($element[0]->getName(), 'ul', 'Last element is comment links.'); + $this->assertSame($element[0]->getName(), 'ul', 'Last element is comment links.'); // Make sure we can hide node links. entity_get_display('node', $this->node->bundle(), 'default') diff --git a/core/modules/comment/src/Tests/CommentNewIndicatorTest.php b/core/modules/comment/src/Tests/CommentNewIndicatorTest.php index 6d89d4a..5467481 100644 --- a/core/modules/comment/src/Tests/CommentNewIndicatorTest.php +++ b/core/modules/comment/src/Tests/CommentNewIndicatorTest.php @@ -76,7 +76,7 @@ public function testCommentNewCommentsIndicator() { // used by the drupal.node-new-comments-link library to determine whether // a "x new comments" link might be necessary or not. We do this in // JavaScript to prevent breaking the render cache. - $this->assertIdentical(0, count($this->xpath('//*[@data-history-node-last-comment-timestamp]')), 'data-history-node-last-comment-timestamp attribute is not set.'); + $this->assertSame(0, count($this->xpath('//*[@data-history-node-last-comment-timestamp]')), 'data-history-node-last-comment-timestamp attribute is not set.'); // Create a new comment. This helper function may be run with different // comment settings so use $comment->save() to avoid complex setup. @@ -104,8 +104,8 @@ public function testCommentNewCommentsIndicator() { // value, the drupal.node-new-comments-link library would determine that the // node received a comment after the user last viewed it, and hence it would // perform an HTTP request to render the "new comments" node link. - $this->assertIdentical(1, count($this->xpath('//*[@data-history-node-last-comment-timestamp="' . $comment->getChangedTime() . '"]')), 'data-history-node-last-comment-timestamp attribute is set to the correct value.'); - $this->assertIdentical(1, count($this->xpath('//*[@data-history-node-field-name="comment"]')), 'data-history-node-field-name attribute is set to the correct value.'); + $this->assertSame(1, count($this->xpath('//*[@data-history-node-last-comment-timestamp="' . $comment->getChangedTime() . '"]')), 'data-history-node-last-comment-timestamp attribute is set to the correct value.'); + $this->assertSame(1, count($this->xpath('//*[@data-history-node-field-name="comment"]')), 'data-history-node-field-name attribute is set to the correct value.'); // 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(); @@ -133,7 +133,7 @@ public function testCommentNewCommentsIndicator() { 'new_comment_count' => 1, 'first_new_comment_link' => $this->node->url('canonical', array('fragment' => 'new')), )); - $this->assertIdentical($expected, $json); + $this->assertSame($expected, $json); // Failing to specify node IDs for the endpoint should return a 404. $this->renderNewCommentsNodeLinks(array()); diff --git a/core/modules/comment/src/Tests/CommentPagerTest.php b/core/modules/comment/src/Tests/CommentPagerTest.php index aa7d099..411d987 100644 --- a/core/modules/comment/src/Tests/CommentPagerTest.php +++ b/core/modules/comment/src/Tests/CommentPagerTest.php @@ -278,7 +278,7 @@ 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->assertIdentical($expected_page, $returned_page, format_string('Flat mode, @new replies: expected page @expected, returned page @returned.', array('@new' => $new_replies, '@expected' => $expected_page, '@returned' => $returned_page))); + $this->assertSame($expected_page, $returned_page, format_string('Flat mode, @new replies: expected page @expected, returned page @returned.', array('@new' => $new_replies, '@expected' => $expected_page, '@returned' => $returned_page))); } $this->setCommentSettings('default_mode', CommentManagerInterface::COMMENT_MODE_THREADED, 'Switched to threaded mode.'); diff --git a/core/modules/comment/src/Tests/Update/CommentUpdateTest.php b/core/modules/comment/src/Tests/Update/CommentUpdateTest.php index 61d187d..633ac23 100644 --- a/core/modules/comment/src/Tests/Update/CommentUpdateTest.php +++ b/core/modules/comment/src/Tests/Update/CommentUpdateTest.php @@ -42,12 +42,12 @@ public function testCommentUpdate8101() { // Check that 'node.article.default' entity view display setting 'view_mode' // has the value 'default'. $config = $this->config('core.entity_view_display.node.article.default'); - $this->assertIdentical($config->get('content.comment.settings.view_mode'), 'default'); + $this->assertSame($config->get('content.comment.settings.view_mode'), 'default'); // Check that 'node.forum.default' entity view display setting 'view_mode' // has the value 'default'. $config = $this->config('core.entity_view_display.node.forum.default'); - $this->assertIdentical($config->get('content.comment_forum.settings.view_mode'), 'default'); + $this->assertSame($config->get('content.comment_forum.settings.view_mode'), 'default'); } } diff --git a/core/modules/comment/tests/src/Kernel/CommentDefaultFormatterCacheTagsTest.php b/core/modules/comment/tests/src/Kernel/CommentDefaultFormatterCacheTagsTest.php index a95088e..3d4e3d9 100644 --- a/core/modules/comment/tests/src/Kernel/CommentDefaultFormatterCacheTagsTest.php +++ b/core/modules/comment/tests/src/Kernel/CommentDefaultFormatterCacheTagsTest.php @@ -149,8 +149,8 @@ public function testCacheTags() { // The entity itself was cached but the top-level element is max-age 0 due // to the bubbled up max age due to the lazy-built comment form. - $this->assertIdentical(Cache::PERMANENT, $build['entity']['#cache']['max-age']); - $this->assertIdentical(0, $build['#cache']['max-age'], 'Top level render array has max-age 0'); + $this->assertSame(Cache::PERMANENT, $build['entity']['#cache']['max-age']); + $this->assertSame(0, $build['#cache']['max-age'], 'Top level render array has max-age 0'); // The children (fields) of the entity render array are only built in case // of a cache miss. diff --git a/core/modules/comment/tests/src/Kernel/Migrate/MigrateCommentStubTest.php b/core/modules/comment/tests/src/Kernel/Migrate/MigrateCommentStubTest.php index b5fc4fe..1a9b49a 100644 --- a/core/modules/comment/tests/src/Kernel/Migrate/MigrateCommentStubTest.php +++ b/core/modules/comment/tests/src/Kernel/Migrate/MigrateCommentStubTest.php @@ -61,7 +61,7 @@ public function testStub() { $this->fail('Expected exception has not been thrown.'); } catch (MigrateException $e) { - $this->assertIdentical($e->getMessage(), + $this->assertSame($e->getMessage(), 'Stubbing failed, unable to generate value for field entity_id'); } diff --git a/core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentTest.php b/core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentTest.php index 5330e94..89d73c8 100644 --- a/core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentTest.php +++ b/core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentTest.php @@ -53,22 +53,22 @@ public function testComments() { $comment_storage = $this->container->get('entity.manager')->getStorage('comment'); /** @var \Drupal\comment\CommentInterface $comment */ $comment = $comment_storage->load(1); - $this->assertIdentical('The first comment.', $comment->getSubject()); - $this->assertIdentical('The first comment body.', $comment->comment_body->value); - $this->assertIdentical('filtered_html', $comment->comment_body->format); - $this->assertIdentical(NULL, $comment->pid->target_id); - $this->assertIdentical('1', $comment->getCommentedEntityId()); - $this->assertIdentical('node', $comment->getCommentedEntityTypeId()); - $this->assertIdentical('en', $comment->language()->getId()); - $this->assertIdentical('comment_no_subject', $comment->getTypeId()); + $this->assertSame('The first comment.', $comment->getSubject()); + $this->assertSame('The first comment body.', $comment->comment_body->value); + $this->assertSame('filtered_html', $comment->comment_body->format); + $this->assertSame(NULL, $comment->pid->target_id); + $this->assertSame('1', $comment->getCommentedEntityId()); + $this->assertSame('node', $comment->getCommentedEntityTypeId()); + $this->assertSame('en', $comment->language()->getId()); + $this->assertSame('comment_no_subject', $comment->getTypeId()); $comment = $comment_storage->load(2); - $this->assertIdentical('The response to the second comment.', $comment->subject->value); - $this->assertIdentical('3', $comment->pid->target_id); + $this->assertSame('The response to the second comment.', $comment->subject->value); + $this->assertSame('3', $comment->pid->target_id); $comment = $comment_storage->load(3); - $this->assertIdentical('The second comment.', $comment->subject->value); - $this->assertIdentical(NULL, $comment->pid->target_id); + $this->assertSame('The second comment.', $comment->subject->value); + $this->assertSame(NULL, $comment->pid->target_id); } } diff --git a/core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentTypeTest.php b/core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentTypeTest.php index c28be63..b00e360 100644 --- a/core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentTypeTest.php +++ b/core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentTypeTest.php @@ -33,9 +33,9 @@ protected function setUp() { */ public function testCommentType() { $comment_type = CommentType::load('comment'); - $this->assertIdentical('node', $comment_type->getTargetEntityTypeId()); + $this->assertSame('node', $comment_type->getTargetEntityTypeId()); $comment_type = CommentType::load('comment_no_subject'); - $this->assertIdentical('node', $comment_type->getTargetEntityTypeId()); + $this->assertSame('node', $comment_type->getTargetEntityTypeId()); } } diff --git a/core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentVariableEntityDisplayTest.php b/core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentVariableEntityDisplayTest.php index a6f25f6..3c81a04 100644 --- a/core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentVariableEntityDisplayTest.php +++ b/core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentVariableEntityDisplayTest.php @@ -25,9 +25,9 @@ protected function setUp() { public function testCommentEntityDisplay() { foreach (['page', 'story', 'article'] as $type) { $component = EntityViewDisplay::load('node.' . $type . '.default')->getComponent('comment'); - $this->assertIdentical('hidden', $component['label']); - $this->assertIdentical('comment_default', $component['type']); - $this->assertIdentical(20, $component['weight']); + $this->assertSame('hidden', $component['label']); + $this->assertSame('comment_default', $component['type']); + $this->assertSame(20, $component['weight']); } } diff --git a/core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentVariableEntityFormDisplaySubjectTest.php b/core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentVariableEntityFormDisplaySubjectTest.php index 31e61e0..26b5144 100644 --- a/core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentVariableEntityFormDisplaySubjectTest.php +++ b/core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentVariableEntityFormDisplaySubjectTest.php @@ -35,8 +35,8 @@ protected function setUp() { public function testCommentEntityFormDisplay() { $component = EntityFormDisplay::load('comment.comment.default') ->getComponent('subject'); - $this->assertIdentical('string_textfield', $component['type']); - $this->assertIdentical(10, $component['weight']); + $this->assertSame('string_textfield', $component['type']); + $this->assertSame(10, $component['weight']); $component = EntityFormDisplay::load('comment.comment_no_subject.default') ->getComponent('subject'); $this->assertNull($component); diff --git a/core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentVariableEntityFormDisplayTest.php b/core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentVariableEntityFormDisplayTest.php index 92cb085..4688120 100644 --- a/core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentVariableEntityFormDisplayTest.php +++ b/core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentVariableEntityFormDisplayTest.php @@ -26,8 +26,8 @@ public function testCommentEntityFormDisplay() { foreach (['page', 'article', 'story'] as $type) { $component = EntityFormDisplay::load('node.' . $type . '.default') ->getComponent('comment'); - $this->assertIdentical('comment_default', $component['type']); - $this->assertIdentical(20, $component['weight']); + $this->assertSame('comment_default', $component['type']); + $this->assertSame(20, $component['weight']); } } diff --git a/core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentVariableInstanceTest.php b/core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentVariableInstanceTest.php index 280cad2..da0981a 100644 --- a/core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentVariableInstanceTest.php +++ b/core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentVariableInstanceTest.php @@ -37,21 +37,21 @@ protected function setUp() { */ public function testCommentFieldInstance() { $node = Node::create(['type' => 'page']); - $this->assertIdentical(0, $node->comment->status); - $this->assertIdentical('comment', $node->comment->getFieldDefinition()->getName()); + $this->assertSame(0, $node->comment->status); + $this->assertSame('comment', $node->comment->getFieldDefinition()->getName()); $settings = $node->comment->getFieldDefinition()->getSettings(); - $this->assertIdentical(CommentManagerInterface::COMMENT_MODE_THREADED, $settings['default_mode']); - $this->assertIdentical(50, $settings['per_page']); + $this->assertSame(CommentManagerInterface::COMMENT_MODE_THREADED, $settings['default_mode']); + $this->assertSame(50, $settings['per_page']); $this->assertFalse($settings['anonymous']); $this->assertFalse($settings['form_location']); $this->assertTrue($settings['preview']); $node = Node::create(['type' => 'story']); - $this->assertIdentical(2, $node->comment_no_subject->status); - $this->assertIdentical('comment_no_subject', $node->comment_no_subject->getFieldDefinition()->getName()); + $this->assertSame(2, $node->comment_no_subject->status); + $this->assertSame('comment_no_subject', $node->comment_no_subject->getFieldDefinition()->getName()); $settings = $node->comment_no_subject->getFieldDefinition()->getSettings(); - $this->assertIdentical(CommentManagerInterface::COMMENT_MODE_FLAT, $settings['default_mode']); - $this->assertIdentical(70, $settings['per_page']); + $this->assertSame(CommentManagerInterface::COMMENT_MODE_FLAT, $settings['default_mode']); + $this->assertSame(70, $settings['per_page']); $this->assertTrue($settings['anonymous']); $this->assertFalse($settings['form_location']); $this->assertFalse($settings['preview']); diff --git a/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentEntityDisplayTest.php b/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentEntityDisplayTest.php index e1edd3c..218006b 100644 --- a/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentEntityDisplayTest.php +++ b/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentEntityDisplayTest.php @@ -40,9 +40,9 @@ protected function setUp() { protected function assertDisplay($id, $component_id) { $component = EntityViewDisplay::load($id)->getComponent($component_id); $this->assertTrue(is_array($component)); - $this->assertIdentical('hidden', $component['label']); - $this->assertIdentical('comment_default', $component['type']); - $this->assertIdentical(20, $component['weight']); + $this->assertSame('hidden', $component['label']); + $this->assertSame('comment_default', $component['type']); + $this->assertSame(20, $component['weight']); } /** diff --git a/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentEntityFormDisplaySubjectTest.php b/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentEntityFormDisplaySubjectTest.php index f8c4a07..a09cb82 100644 --- a/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentEntityFormDisplaySubjectTest.php +++ b/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentEntityFormDisplaySubjectTest.php @@ -36,8 +36,8 @@ protected function setUp() { protected function assertDisplay($id) { $component = EntityFormDisplay::load($id)->getComponent('subject'); $this->assertTrue(is_array($component)); - $this->assertIdentical('string_textfield', $component['type']); - $this->assertIdentical(10, $component['weight']); + $this->assertSame('string_textfield', $component['type']); + $this->assertSame(10, $component['weight']); } /** diff --git a/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentEntityFormDisplayTest.php b/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentEntityFormDisplayTest.php index 1332a67..07286b7 100644 --- a/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentEntityFormDisplayTest.php +++ b/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentEntityFormDisplayTest.php @@ -40,8 +40,8 @@ protected function setUp() { protected function assertDisplay($id, $component_id) { $component = EntityFormDisplay::load($id)->getComponent($component_id); $this->assertTrue(is_array($component)); - $this->assertIdentical('comment_default', $component['type']); - $this->assertIdentical(20, $component['weight']); + $this->assertSame('comment_default', $component['type']); + $this->assertSame(20, $component['weight']); } /** diff --git a/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentFieldInstanceTest.php b/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentFieldInstanceTest.php index c7d8959..fdc323e 100644 --- a/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentFieldInstanceTest.php +++ b/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentFieldInstanceTest.php @@ -55,14 +55,14 @@ protected function assertEntity($id, $field_name, $bundle, $default_mode, $per_p $entity = FieldConfig::load($id); $this->assertTrue($entity instanceof FieldConfigInterface); /** @var \Drupal\field\FieldConfigInterface $entity */ - $this->assertIdentical('node', $entity->getTargetEntityTypeId()); - $this->assertIdentical('Comments', $entity->label()); + $this->assertSame('node', $entity->getTargetEntityTypeId()); + $this->assertSame('Comments', $entity->label()); $this->assertTrue($entity->isRequired()); - $this->assertIdentical($field_name, $entity->getFieldStorageDefinition()->getName()); - $this->assertIdentical($bundle, $entity->getTargetBundle()); + $this->assertSame($field_name, $entity->getFieldStorageDefinition()->getName()); + $this->assertSame($bundle, $entity->getTargetBundle()); $this->assertTrue($entity->get('default_value')[0]['status']); $this->assertEqual($default_mode, $entity->getSetting('default_mode')); - $this->assertIdentical($per_page, $entity->getSetting('per_page')); + $this->assertSame($per_page, $entity->getSetting('per_page')); $this->assertEqual($anonymous, $entity->getSetting('anonymous')); // This assertion fails because 1 !== TRUE. It's extremely strange that // the form_location setting is returning a boolean, but this appears to diff --git a/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentFieldTest.php b/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentFieldTest.php index e6f8e28..dcd1caf 100644 --- a/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentFieldTest.php +++ b/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentFieldTest.php @@ -41,9 +41,9 @@ protected function assertEntity($id, $comment_type) { $entity = FieldStorageConfig::load($id); $this->assertTrue($entity instanceof FieldStorageConfigInterface); /** @var \Drupal\field\FieldStorageConfigInterface $entity */ - $this->assertIdentical('node', $entity->getTargetEntityTypeId()); - $this->assertIdentical('comment', $entity->getType()); - $this->assertIdentical($comment_type, $entity->getSetting('comment_type')); + $this->assertSame('node', $entity->getTargetEntityTypeId()); + $this->assertSame('comment', $entity->getType()); + $this->assertSame($comment_type, $entity->getSetting('comment_type')); } /** diff --git a/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentTest.php b/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentTest.php index 4d4df03..d75584e 100644 --- a/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentTest.php +++ b/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentTest.php @@ -53,18 +53,18 @@ public function testCommentMigration() { $comment = Comment::load(1); $this->assertTrue($comment instanceof CommentInterface); /** @var \Drupal\comment\CommentInterface $comment */ - $this->assertIdentical('A comment', $comment->getSubject()); - $this->assertIdentical('1421727536', $comment->getCreatedTime()); - $this->assertIdentical('1421727536', $comment->getChangedTime()); + $this->assertSame('A comment', $comment->getSubject()); + $this->assertSame('1421727536', $comment->getCreatedTime()); + $this->assertSame('1421727536', $comment->getChangedTime()); $this->assertTrue($comment->getStatus()); - $this->assertIdentical('admin', $comment->getAuthorName()); - $this->assertIdentical('admin@local.host', $comment->getAuthorEmail()); - $this->assertIdentical('This is a comment', $comment->comment_body->value); - $this->assertIdentical('filtered_html', $comment->comment_body->format); + $this->assertSame('admin', $comment->getAuthorName()); + $this->assertSame('admin@local.host', $comment->getAuthorEmail()); + $this->assertSame('This is a comment', $comment->comment_body->value); + $this->assertSame('filtered_html', $comment->comment_body->format); $node = $comment->getCommentedEntity(); $this->assertTrue($node instanceof NodeInterface); - $this->assertIdentical('1', $node->id()); + $this->assertSame('1', $node->id()); } } diff --git a/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentTypeTest.php b/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentTypeTest.php index 3f8fe4c..35df721 100644 --- a/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentTypeTest.php +++ b/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentTypeTest.php @@ -39,8 +39,8 @@ protected function assertEntity($id, $label) { $entity = CommentType::load($id); $this->assertTrue($entity instanceof CommentTypeInterface); /** @var \Drupal\comment\CommentTypeInterface $entity */ - $this->assertIdentical($label, $entity->label()); - $this->assertIdentical('node', $entity->getTargetEntityTypeId()); + $this->assertSame($label, $entity->label()); + $this->assertSame('node', $entity->getTargetEntityTypeId()); } /** @@ -56,7 +56,7 @@ public function testMigration() { $migration = $this->getMigration('d7_comment_type'); // Validate that the source count and processed count match up. - $this->assertIdentical($migration->getSourcePlugin()->count(), $migration->getIdMap()->processedCount()); + $this->assertSame($migration->getSourcePlugin()->count(), $migration->getIdMap()->processedCount()); } } diff --git a/core/modules/config/src/Tests/ConfigEntityFormOverrideTest.php b/core/modules/config/src/Tests/ConfigEntityFormOverrideTest.php index 92693c4..49ed39b 100644 --- a/core/modules/config/src/Tests/ConfigEntityFormOverrideTest.php +++ b/core/modules/config/src/Tests/ConfigEntityFormOverrideTest.php @@ -46,7 +46,7 @@ public function testFormsWithOverrides() { // Test that the original label on the editing page is intact. $this->drupalGet('admin/structure/config_test/manage/dotted.default'); $elements = $this->xpath('//input[@name="label"]'); - $this->assertIdentical((string) $elements[0]['value'], $original_label); + $this->assertSame((string) $elements[0]['value'], $original_label); $this->assertNoText($overridden_label); // Change to a new label and test that the listing now has the edited label. @@ -61,7 +61,7 @@ public function testFormsWithOverrides() { // Test that the editing page now has the edited label. $this->drupalGet('admin/structure/config_test/manage/dotted.default'); $elements = $this->xpath('//input[@name="label"]'); - $this->assertIdentical((string) $elements[0]['value'], $edited_label); + $this->assertSame((string) $elements[0]['value'], $edited_label); // Test that the overridden label is still loaded with the entity. $this->assertEqual($config_test_storage->load('dotted.default')->label(), $overridden_label); diff --git a/core/modules/config/src/Tests/ConfigEntityListTest.php b/core/modules/config/src/Tests/ConfigEntityListTest.php index 9d31de0..07046ab 100644 --- a/core/modules/config/src/Tests/ConfigEntityListTest.php +++ b/core/modules/config/src/Tests/ConfigEntityListTest.php @@ -114,7 +114,7 @@ function testList() { )); $entity->save(); $list = $controller->load(); - $this->assertIdentical(array_keys($list), array('beta', 'dotted.default', 'alpha', 'omega')); + $this->assertSame(array_keys($list), array('beta', 'dotted.default', 'alpha', 'omega')); // Test that config entities that do not support status, do not have // enable/disable operations. @@ -168,7 +168,7 @@ function testListUI() { // Test the contents of each th cell. $expected_items = array('Label', 'Machine name', 'Operations'); foreach ($elements as $key => $element) { - $this->assertIdentical((string) $element[0], $expected_items[$key]); + $this->assertSame((string) $element[0], $expected_items[$key]); } // Check the number of table row cells. @@ -178,8 +178,8 @@ function testListUI() { // Check the contents of each row cell. The first cell contains the label, // the second contains the machine name, and the third contains the // operations list. - $this->assertIdentical((string) $elements[0], 'Default'); - $this->assertIdentical((string) $elements[1], 'dotted.default'); + $this->assertSame((string) $elements[0], 'Default'); + $this->assertSame((string) $elements[1], 'dotted.default'); $this->assertTrue($elements[2]->children()->xpath('//ul'), 'Operations list found.'); // Add a new entity using the operations link. diff --git a/core/modules/config/src/Tests/ConfigEntityTest.php b/core/modules/config/src/Tests/ConfigEntityTest.php index a8a8f0f..c74d676 100644 --- a/core/modules/config/src/Tests/ConfigEntityTest.php +++ b/core/modules/config/src/Tests/ConfigEntityTest.php @@ -37,26 +37,26 @@ function testCRUD() { // Verify default properties on a newly created empty entity. $empty = entity_create('config_test'); $this->assertTrue($empty->uuid()); - $this->assertIdentical($empty->label, NULL); - $this->assertIdentical($empty->style, NULL); - $this->assertIdentical($empty->language()->getId(), $default_langcode); + $this->assertSame($empty->label, NULL); + $this->assertSame($empty->style, NULL); + $this->assertSame($empty->language()->getId(), $default_langcode); // Verify ConfigEntity properties/methods on the newly created empty entity. - $this->assertIdentical($empty->isNew(), TRUE); - $this->assertIdentical($empty->getOriginalId(), NULL); - $this->assertIdentical($empty->bundle(), 'config_test'); - $this->assertIdentical($empty->id(), NULL); + $this->assertSame($empty->isNew(), TRUE); + $this->assertSame($empty->getOriginalId(), NULL); + $this->assertSame($empty->bundle(), 'config_test'); + $this->assertSame($empty->id(), NULL); $this->assertTrue($empty->uuid()); - $this->assertIdentical($empty->label(), NULL); + $this->assertSame($empty->label(), NULL); - $this->assertIdentical($empty->get('id'), NULL); + $this->assertSame($empty->get('id'), NULL); $this->assertTrue($empty->get('uuid')); - $this->assertIdentical($empty->get('label'), NULL); - $this->assertIdentical($empty->get('style'), NULL); - $this->assertIdentical($empty->language()->getId(), $default_langcode); + $this->assertSame($empty->get('label'), NULL); + $this->assertSame($empty->get('style'), NULL); + $this->assertSame($empty->language()->getId(), $default_langcode); // Verify Entity properties/methods on the newly created empty entity. - $this->assertIdentical($empty->getEntityTypeId(), 'config_test'); + $this->assertSame($empty->getEntityTypeId(), 'config_test'); // The URI can only be checked after saving. try { $empty->urlInfo(); @@ -79,7 +79,7 @@ function testCRUD() { $empty_id = entity_create('config_test', array( 'id' => '', )); - $this->assertIdentical($empty_id->isNew(), TRUE); + $this->assertSame($empty_id->isNew(), TRUE); try { $empty_id->save(); $this->fail('EntityMalformedException was thrown.'); @@ -96,17 +96,17 @@ function testCRUD() { )); $this->assertTrue($config_test->uuid()); $this->assertNotEqual($config_test->uuid(), $empty->uuid()); - $this->assertIdentical($config_test->label, $expected['label']); - $this->assertIdentical($config_test->style, $expected['style']); - $this->assertIdentical($config_test->language()->getId(), $default_langcode); + $this->assertSame($config_test->label, $expected['label']); + $this->assertSame($config_test->style, $expected['style']); + $this->assertSame($config_test->language()->getId(), $default_langcode); // Verify methods on the newly created entity. - $this->assertIdentical($config_test->isNew(), TRUE); - $this->assertIdentical($config_test->getOriginalId(), $expected['id']); - $this->assertIdentical($config_test->id(), $expected['id']); + $this->assertSame($config_test->isNew(), TRUE); + $this->assertSame($config_test->getOriginalId(), $expected['id']); + $this->assertSame($config_test->id(), $expected['id']); $this->assertTrue($config_test->uuid()); $expected['uuid'] = $config_test->uuid(); - $this->assertIdentical($config_test->label(), $expected['label']); + $this->assertSame($config_test->label(), $expected['label']); // Verify that the entity can be saved. try { @@ -118,24 +118,24 @@ function testCRUD() { } // The entity path can only be checked after saving. - $this->assertIdentical($config_test->url(), Url::fromRoute('entity.config_test.edit_form', ['config_test' => $expected['id']])->toString()); + $this->assertSame($config_test->url(), Url::fromRoute('entity.config_test.edit_form', ['config_test' => $expected['id']])->toString()); // Verify that the correct status is returned and properties did not change. - $this->assertIdentical($status, SAVED_NEW); - $this->assertIdentical($config_test->id(), $expected['id']); - $this->assertIdentical($config_test->uuid(), $expected['uuid']); - $this->assertIdentical($config_test->label(), $expected['label']); - $this->assertIdentical($config_test->isNew(), FALSE); - $this->assertIdentical($config_test->getOriginalId(), $expected['id']); + $this->assertSame($status, SAVED_NEW); + $this->assertSame($config_test->id(), $expected['id']); + $this->assertSame($config_test->uuid(), $expected['uuid']); + $this->assertSame($config_test->label(), $expected['label']); + $this->assertSame($config_test->isNew(), FALSE); + $this->assertSame($config_test->getOriginalId(), $expected['id']); // Save again, and verify correct status and properties again. $status = $config_test->save(); - $this->assertIdentical($status, SAVED_UPDATED); - $this->assertIdentical($config_test->id(), $expected['id']); - $this->assertIdentical($config_test->uuid(), $expected['uuid']); - $this->assertIdentical($config_test->label(), $expected['label']); - $this->assertIdentical($config_test->isNew(), FALSE); - $this->assertIdentical($config_test->getOriginalId(), $expected['id']); + $this->assertSame($status, SAVED_UPDATED); + $this->assertSame($config_test->id(), $expected['id']); + $this->assertSame($config_test->uuid(), $expected['uuid']); + $this->assertSame($config_test->label(), $expected['label']); + $this->assertSame($config_test->isNew(), FALSE); + $this->assertSame($config_test->getOriginalId(), $expected['id']); // Verify that a configuration entity can be saved with an ID of the // maximum allowed length, but not longer. @@ -191,7 +191,7 @@ function testCRUD() { $same_id = entity_create('config_test', array( 'id' => $config_test->id(), )); - $this->assertIdentical($same_id->isNew(), TRUE); + $this->assertSame($same_id->isNew(), TRUE); try { $same_id->save(); $this->fail('Not possible to overwrite an entity entity.'); @@ -206,19 +206,19 @@ function testCRUD() { $old_id = $ids[$i - 1]; $new_id = $ids[$i]; // Before renaming, everything should point to the current ID. - $this->assertIdentical($config_test->id(), $old_id); - $this->assertIdentical($config_test->getOriginalId(), $old_id); + $this->assertSame($config_test->id(), $old_id); + $this->assertSame($config_test->getOriginalId(), $old_id); // Rename. $config_test->set('id', $new_id); - $this->assertIdentical($config_test->id(), $new_id); + $this->assertSame($config_test->id(), $new_id); $status = $config_test->save(); - $this->assertIdentical($status, SAVED_UPDATED); - $this->assertIdentical($config_test->isNew(), FALSE); + $this->assertSame($status, SAVED_UPDATED); + $this->assertSame($config_test->isNew(), FALSE); // Verify that originalID points to new ID directly after renaming. - $this->assertIdentical($config_test->id(), $new_id); - $this->assertIdentical($config_test->getOriginalId(), $new_id); + $this->assertSame($config_test->id(), $new_id); + $this->assertSame($config_test->getOriginalId(), $new_id); } // Test config entity prepopulation. diff --git a/core/modules/config/src/Tests/ConfigExportUITest.php b/core/modules/config/src/Tests/ConfigExportUITest.php index d3133d8..5a32b0b 100644 --- a/core/modules/config/src/Tests/ConfigExportUITest.php +++ b/core/modules/config/src/Tests/ConfigExportUITest.php @@ -76,10 +76,10 @@ function testExport() { } // Assert that the downloaded archive file contents are the same as the test // site active store. - $this->assertIdentical($archive_contents, $config_files); + $this->assertSame($archive_contents, $config_files); // Ensure the test configuration override is in effect but was not exported. - $this->assertIdentical(\Drupal::config('system.maintenance')->get('message'), 'Foo'); + $this->assertSame(\Drupal::config('system.maintenance')->get('message'), 'Foo'); $archiver->extract(file_directory_temp(), array('system.maintenance.yml')); $file_contents = file_get_contents(file_directory_temp() . '/' . 'system.maintenance.yml'); $exported = Yaml::decode($file_contents); diff --git a/core/modules/config/src/Tests/ConfigFormOverrideTest.php b/core/modules/config/src/Tests/ConfigFormOverrideTest.php index ffd4428..d2e3ea4 100644 --- a/core/modules/config/src/Tests/ConfigFormOverrideTest.php +++ b/core/modules/config/src/Tests/ConfigFormOverrideTest.php @@ -32,7 +32,7 @@ public function testFormsWithOverrides() { $this->drupalGet('admin/config/system/site-information'); $this->assertTitle('Basic site settings | ' . $overridden_name); $elements = $this->xpath('//input[@name="site_name"]'); - $this->assertIdentical((string) $elements[0]['value'], 'Drupal'); + $this->assertSame((string) $elements[0]['value'], 'Drupal'); // Submit the form and ensure the site name is not changed. $edit = array( @@ -41,7 +41,7 @@ public function testFormsWithOverrides() { $this->drupalPostForm('admin/config/system/site-information', $edit, t('Save configuration')); $this->assertTitle('Basic site settings | ' . $overridden_name); $elements = $this->xpath('//input[@name="site_name"]'); - $this->assertIdentical((string) $elements[0]['value'], $edit['site_name']); + $this->assertSame((string) $elements[0]['value'], $edit['site_name']); } } diff --git a/core/modules/config/src/Tests/ConfigImportAllTest.php b/core/modules/config/src/Tests/ConfigImportAllTest.php index baeacb9..12093f2 100644 --- a/core/modules/config/src/Tests/ConfigImportAllTest.php +++ b/core/modules/config/src/Tests/ConfigImportAllTest.php @@ -129,7 +129,7 @@ public function testInstallUninstall() { $this->rebuildContainer(); // Check that there are no errors. - $this->assertIdentical($this->configImporter()->getErrors(), array()); + $this->assertSame($this->configImporter()->getErrors(), array()); // Check that all modules that were uninstalled are now reinstalled. $this->assertModules(array_keys($modules_to_uninstall), TRUE); @@ -144,7 +144,7 @@ public function testInstallUninstall() { $this->container->get('config.storage'), $this->container->get('config.manager') ); - $this->assertIdentical($storage_comparer->createChangelist()->getChangelist(), $storage_comparer->getEmptyChangelist()); + $this->assertSame($storage_comparer->createChangelist()->getChangelist(), $storage_comparer->getEmptyChangelist()); // Now we have all configuration imported, test all of them for schema // conformance. Ensures all imported default configuration is valid when diff --git a/core/modules/config/src/Tests/ConfigImportUITest.php b/core/modules/config/src/Tests/ConfigImportUITest.php index afa9b99..d59af57 100644 --- a/core/modules/config/src/Tests/ConfigImportUITest.php +++ b/core/modules/config/src/Tests/ConfigImportUITest.php @@ -52,7 +52,7 @@ function testImport() { // Create updated configuration object. $new_site_name = 'Config import test ' . $this->randomString(); $this->prepareSiteNameUpdate($new_site_name); - $this->assertIdentical($sync->exists($name), TRUE, $name . ' found.'); + $this->assertSame($sync->exists($name), TRUE, $name . ' found.'); // Create new config entity. $original_dynamic_data = array( @@ -69,7 +69,7 @@ function testImport() { 'protected_property' => '', ); $sync->write($dynamic_name, $original_dynamic_data); - $this->assertIdentical($sync->exists($dynamic_name), TRUE, $dynamic_name . ' found.'); + $this->assertSame($sync->exists($dynamic_name), TRUE, $dynamic_name . ' found.'); // Enable the Action and Ban modules during import. The Ban // module is used because it creates a table during the install. The Action @@ -131,10 +131,10 @@ function testImport() { $this->assertText(t('There are no configuration changes to import.')); // Verify site name has changed. - $this->assertIdentical($new_site_name, $this->config('system.site')->get('name')); + $this->assertSame($new_site_name, $this->config('system.site')->get('name')); // Verify that new config entity exists. - $this->assertIdentical($original_dynamic_data, $this->config($dynamic_name)->get()); + $this->assertSame($original_dynamic_data, $this->config($dynamic_name)->get()); // Verify the cache got cleared. $this->assertTrue(isset($GLOBALS['hook_cache_flush'])); @@ -153,7 +153,7 @@ function testImport() { $installed = \Drupal::state()->get('ConfigImportUITest.core.extension.modules_installed', array()); $uninstalled = \Drupal::state()->get('ConfigImportUITest.core.extension.modules_uninstalled', array()); $expected = array('action', 'ban', 'text', 'options'); - $this->assertIdentical($expected, $installed, 'Action, Ban, Text and Options modules installed in the correct order.'); + $this->assertSame($expected, $installed, 'Action, Ban, Text and Options modules installed in the correct order.'); $this->assertTrue(empty($uninstalled), 'No modules uninstalled during import'); // Verify that the action.settings configuration object was only written @@ -162,7 +162,7 @@ function testImport() { // used during configuration import and, additionally, that after installing // a module, that configuration is not synced twice. $recursion_limit_values = \Drupal::state()->get('ConfigImportUITest.action.settings.recursion_limit', array()); - $this->assertIdentical($recursion_limit_values, array(50)); + $this->assertSame($recursion_limit_values, array(50)); $core_extension = $this->config('core.extension')->get(); unset($core_extension['module']['action']); @@ -206,7 +206,7 @@ function testImport() { $installed = \Drupal::state()->get('ConfigImportUITest.core.extension.modules_installed', array()); $uninstalled = \Drupal::state()->get('ConfigImportUITest.core.extension.modules_uninstalled', array()); $expected = array('options', 'text', 'ban', 'action'); - $this->assertIdentical($expected, $uninstalled, 'Options, Text, Ban and Action modules uninstalled in the correct order.'); + $this->assertSame($expected, $uninstalled, 'Options, Text, Ban and Action modules uninstalled in the correct order.'); $this->assertTrue(empty($installed), 'No modules installed during import'); $theme_info = \Drupal::service('theme_handler')->listInfo(); @@ -215,7 +215,7 @@ function testImport() { // Verify that the action.settings configuration object was only deleted // once during the import process. $delete_called = \Drupal::state()->get('ConfigImportUITest.action.settings.delete', 0); - $this->assertIdentical($delete_called, 1, "The action.settings configuration was deleted once during configuration import."); + $this->assertSame($delete_called, 1, "The action.settings configuration was deleted once during configuration import."); } /** diff --git a/core/modules/config/src/Tests/ConfigInstallProfileOverrideTest.php b/core/modules/config/src/Tests/ConfigInstallProfileOverrideTest.php index c2cea6d..25b346b 100644 --- a/core/modules/config/src/Tests/ConfigInstallProfileOverrideTest.php +++ b/core/modules/config/src/Tests/ConfigInstallProfileOverrideTest.php @@ -53,12 +53,12 @@ function testInstallProfileConfigOverwrite() { $this->assertTrue(is_dir($config_dir)); $source_storage = new FileStorage($config_dir); $data = $source_storage->read($config_name); - $this->assertIdentical($data, $expected_original_data); + $this->assertSame($data, $expected_original_data); // Verify that active configuration matches the expected data, which was // created from the testing install profile's system.cron.yml file. $config = $this->config($config_name); - $this->assertIdentical($config->get(), $expected_profile_data); + $this->assertSame($config->get(), $expected_profile_data); // Ensure that the configuration entity has the expected dependencies and // overrides. diff --git a/core/modules/config/src/Tests/ConfigInstallWebTest.php b/core/modules/config/src/Tests/ConfigInstallWebTest.php index 7006997..a9c4fe3 100644 --- a/core/modules/config/src/Tests/ConfigInstallWebTest.php +++ b/core/modules/config/src/Tests/ConfigInstallWebTest.php @@ -45,9 +45,9 @@ function testIntegrationModuleReinstallation() { // Verify the configuration does not exist prior to installation. $config_static = $this->config($default_config); - $this->assertIdentical($config_static->isNew(), TRUE); + $this->assertSame($config_static->isNew(), TRUE); $config_entity = $this->config($default_configuration_entity); - $this->assertIdentical($config_entity->isNew(), TRUE); + $this->assertSame($config_entity->isNew(), TRUE); // Install the integration module. \Drupal::service('module_installer')->install(array('config_integration_test')); @@ -56,11 +56,11 @@ function testIntegrationModuleReinstallation() { \Drupal::configFactory()->reset($default_config); \Drupal::configFactory()->reset($default_configuration_entity); $config_static = $this->config($default_config); - $this->assertIdentical($config_static->isNew(), FALSE); - $this->assertIdentical($config_static->get('foo'), 'default setting'); + $this->assertSame($config_static->isNew(), FALSE); + $this->assertSame($config_static->get('foo'), 'default setting'); $config_entity = $this->config($default_configuration_entity); - $this->assertIdentical($config_entity->isNew(), FALSE); - $this->assertIdentical($config_entity->get('label'), 'Default integration config label'); + $this->assertSame($config_entity->isNew(), FALSE); + $this->assertSame($config_entity->get('label'), 'Default integration config label'); // Customize both configuration objects. $config_static->set('foo', 'customized setting')->save(); @@ -77,12 +77,12 @@ function testIntegrationModuleReinstallation() { // Verify the integration module's config was uninstalled. $config_static = $this->config($default_config); - $this->assertIdentical($config_static->isNew(), TRUE); + $this->assertSame($config_static->isNew(), TRUE); // Verify the integration config still exists. $config_entity = $this->config($default_configuration_entity); - $this->assertIdentical($config_entity->isNew(), FALSE); - $this->assertIdentical($config_entity->get('label'), 'Customized integration config label'); + $this->assertSame($config_entity->isNew(), FALSE); + $this->assertSame($config_entity->get('label'), 'Customized integration config label'); // Reinstall the integration module. try { @@ -103,13 +103,13 @@ function testIntegrationModuleReinstallation() { \Drupal::configFactory()->reset($default_config); \Drupal::configFactory()->reset($default_configuration_entity); $config_static = $this->config($default_config); - $this->assertIdentical($config_static->isNew(), FALSE); - $this->assertIdentical($config_static->get('foo'), 'default setting'); + $this->assertSame($config_static->isNew(), FALSE); + $this->assertSame($config_static->get('foo'), 'default setting'); // Verify the integration config is using the default. $config_entity = \Drupal::config($default_configuration_entity); - $this->assertIdentical($config_entity->isNew(), FALSE); - $this->assertIdentical($config_entity->get('label'), 'Default integration config label'); + $this->assertSame($config_entity->isNew(), FALSE); + $this->assertSame($config_entity->get('label'), 'Default integration config label'); } /** diff --git a/core/modules/config/src/Tests/ConfigSingleImportExportTest.php b/core/modules/config/src/Tests/ConfigSingleImportExportTest.php index 53f6164..a428afb 100644 --- a/core/modules/config/src/Tests/ConfigSingleImportExportTest.php +++ b/core/modules/config/src/Tests/ConfigSingleImportExportTest.php @@ -72,8 +72,8 @@ public function testImport() { $this->assertRaw(t('Are you sure you want to create a new %name @type?', array('%name' => 'first', '@type' => 'test configuration'))); $this->drupalPostForm(NULL, array(), t('Confirm')); $entity = $storage->load('first'); - $this->assertIdentical($entity->label(), 'First'); - $this->assertIdentical($entity->id(), 'first'); + $this->assertSame($entity->label(), 'First'); + $this->assertSame($entity->id(), 'first'); $this->assertTrue($entity->status()); $this->assertRaw(t('The configuration was imported successfully.')); @@ -112,10 +112,10 @@ public function testImport() { $this->drupalPostForm(NULL, array(), t('Confirm')); $entity = $storage->load('second'); $this->assertRaw(t('The configuration was imported successfully.')); - $this->assertIdentical($entity->label(), 'Second'); - $this->assertIdentical($entity->id(), 'second'); + $this->assertSame($entity->label(), 'Second'); + $this->assertSame($entity->id(), 'second'); $this->assertFalse($entity->status()); - $this->assertIdentical($entity->uuid(), $second_uuid); + $this->assertSame($entity->uuid(), $second_uuid); // Perform an update. $import = <<drupalPostForm(NULL, array(), t('Confirm')); $entity = $storage->load('second'); $this->assertRaw(t('The configuration was imported successfully.')); - $this->assertIdentical($entity->label(), 'Second updated'); + $this->assertSame($entity->label(), 'Second updated'); // Try to perform an update which adds missing dependencies. $import = <<assertIdentical($expected_options, array_intersect($expected_options, $options), 'The expected configuration files are listed.'); + $this->assertSame($expected_options, array_intersect($expected_options, $options), 'The expected configuration files are listed.'); $this->drupalGet('admin/config/development/configuration/single/export/system.simple/system.image'); $this->assertFieldByXPath('//textarea[@name="export"]', "toolkit: gd\n_core:\n default_config_hash: durWHaKeBaq4d9Wpi4RqwADj1OufDepcnJuhVLmKN24\n", 'The expected system configuration is displayed.'); diff --git a/core/modules/config_translation/src/Tests/ConfigTranslationOverviewTest.php b/core/modules/config_translation/src/Tests/ConfigTranslationOverviewTest.php index e7c58fd..9ca27a5 100644 --- a/core/modules/config_translation/src/Tests/ConfigTranslationOverviewTest.php +++ b/core/modules/config_translation/src/Tests/ConfigTranslationOverviewTest.php @@ -77,7 +77,7 @@ public function testMapperListPage() { // Make sure there is only a single operation for each dropbutton, either // 'List' or 'Translate'. foreach ($this->cssSelect('ul.dropbutton') as $i => $dropbutton) { - $this->assertIdentical(1, $dropbutton->count()); + $this->assertSame(1, $dropbutton->count()); foreach ($dropbutton->li as $link) { $this->assertTrue(((string) $link->a === 'Translate') || ((string) $link->a === 'List')); } @@ -104,9 +104,9 @@ public function testMapperListPage() { // Make sure there is only a single 'Translate' operation for each // dropbutton. foreach ($this->cssSelect('ul.dropbutton') as $i => $dropbutton) { - $this->assertIdentical(1, $dropbutton->count()); + $this->assertSame(1, $dropbutton->count()); foreach ($dropbutton->li as $link) { - $this->assertIdentical('Translate', (string) $link->a); + $this->assertSame('Translate', (string) $link->a); } } diff --git a/core/modules/config_translation/tests/src/Kernel/Migrate/d6/MigrateI18nSystemMaintenanceTest.php b/core/modules/config_translation/tests/src/Kernel/Migrate/d6/MigrateI18nSystemMaintenanceTest.php index d1c5867..4b31c1b 100644 --- a/core/modules/config_translation/tests/src/Kernel/Migrate/d6/MigrateI18nSystemMaintenanceTest.php +++ b/core/modules/config_translation/tests/src/Kernel/Migrate/d6/MigrateI18nSystemMaintenanceTest.php @@ -26,7 +26,7 @@ protected function setUp() { */ public function testSystemMaintenance() { $config = \Drupal::service('language_manager')->getLanguageConfigOverride('fr', 'system.maintenance'); - $this->assertIdentical('fr - Drupal is currently under maintenance. We should be back shortly. Thank you for your patience.', $config->get('message')); + $this->assertSame('fr - Drupal is currently under maintenance. We should be back shortly. Thank you for your patience.', $config->get('message')); } } diff --git a/core/modules/config_translation/tests/src/Kernel/Migrate/d6/MigrateI18nSystemSiteTest.php b/core/modules/config_translation/tests/src/Kernel/Migrate/d6/MigrateI18nSystemSiteTest.php index 770b33c..6f7a18b 100644 --- a/core/modules/config_translation/tests/src/Kernel/Migrate/d6/MigrateI18nSystemSiteTest.php +++ b/core/modules/config_translation/tests/src/Kernel/Migrate/d6/MigrateI18nSystemSiteTest.php @@ -26,22 +26,22 @@ protected function setUp() { */ public function testSystemSite() { $config_translation = \Drupal::service('language_manager')->getLanguageConfigOverride('fr', 'system.site'); - $this->assertIdentical('fr site name', $config_translation->get('name')); - $this->assertIdentical('fr_site_mail@example.com', $config_translation->get('mail')); - $this->assertIdentical('fr Migrate rocks', $config_translation->get('slogan')); - $this->assertIdentical('/fr-user', $config_translation->get('page.403')); - $this->assertIdentical('/fr-page-not-found', $config_translation->get('page.404')); - $this->assertIdentical('/node', $config_translation->get('page.front')); - $this->assertIdentical(NULL, $config_translation->get('admin_compact_mode')); + $this->assertSame('fr site name', $config_translation->get('name')); + $this->assertSame('fr_site_mail@example.com', $config_translation->get('mail')); + $this->assertSame('fr Migrate rocks', $config_translation->get('slogan')); + $this->assertSame('/fr-user', $config_translation->get('page.403')); + $this->assertSame('/fr-page-not-found', $config_translation->get('page.404')); + $this->assertSame('/node', $config_translation->get('page.front')); + $this->assertSame(NULL, $config_translation->get('admin_compact_mode')); $config_translation = \Drupal::service('language_manager')->getLanguageConfigOverride('zu', 'system.site'); - $this->assertIdentical('zu - site_name', $config_translation->get('name')); - $this->assertIdentical('site_mail@example.com', $config_translation->get('mail')); - $this->assertIdentical('Migrate rocks', $config_translation->get('slogan')); - $this->assertIdentical('/zu-user', $config_translation->get('page.403')); - $this->assertIdentical('/zu-page-not-found', $config_translation->get('page.404')); - $this->assertIdentical('/node', $config_translation->get('page.front')); - $this->assertIdentical(NULL, $config_translation->get('admin_compact_mode')); + $this->assertSame('zu - site_name', $config_translation->get('name')); + $this->assertSame('site_mail@example.com', $config_translation->get('mail')); + $this->assertSame('Migrate rocks', $config_translation->get('slogan')); + $this->assertSame('/zu-user', $config_translation->get('page.403')); + $this->assertSame('/zu-page-not-found', $config_translation->get('page.404')); + $this->assertSame('/node', $config_translation->get('page.front')); + $this->assertSame(NULL, $config_translation->get('admin_compact_mode')); } } diff --git a/core/modules/config_translation/tests/src/Kernel/Migrate/d6/MigrateI18nUserConfigsTest.php b/core/modules/config_translation/tests/src/Kernel/Migrate/d6/MigrateI18nUserConfigsTest.php index b36a547..0a80023 100644 --- a/core/modules/config_translation/tests/src/Kernel/Migrate/d6/MigrateI18nUserConfigsTest.php +++ b/core/modules/config_translation/tests/src/Kernel/Migrate/d6/MigrateI18nUserConfigsTest.php @@ -31,25 +31,25 @@ protected function setUp() { */ public function testUserMail() { $config = \Drupal::service('language_manager')->getLanguageConfigOverride('fr', 'user.mail'); - $this->assertIdentical('fr - Account details for [user:name] at [site:name] (approved)', $config->get('status_activated.subject')); - $this->assertIdentical("fr - [user:name],\r\n\r\nYour account at [site:name] has been activated.\r\n\r\nYou may now log in by clicking on this link or copying and pasting it in your browser:\r\n\r\n[user:one-time-login-url]\r\n\r\nThis is a one-time login, so it can be used only once.\r\n\r\nAfter logging in, you will be redirected to [user:edit-url] so you can change your password.\r\n\r\nOnce you have set your own password, you will be able to log in to [site:login-url] in the future using:\r\n\r\nusername: [user:name]\r\n", $config->get('status_activated.body')); - $this->assertIdentical('fr - Replacement login information for [user:name] at [site:name]', $config->get('password_reset.subject')); - $this->assertIdentical("fr - [user:name],\r\n\r\nA request to reset the password for your account has been made at [site:name].\r\n\r\nYou may now log in to [site:url-brief] by clicking on this link or copying and pasting it in your browser:\r\n\r\n[user:one-time-login-url]\r\n\r\nThis is a one-time login, so it can be used only once. It expires after one day and nothing will happen if it's not used.\r\n\r\nAfter logging in, you will be redirected to [user:edit-url] so you can change your password.", $config->get('password_reset.body')); - $this->assertIdentical('fr - Account details for [user:name] at [site:name] (deleted)', $config->get('cancel_confirm.subject')); - $this->assertIdentical("fr - [user:name],\r\n\r\nYour account on [site:name] has been deleted.", $config->get('cancel_confirm.body')); - $this->assertIdentical('fr - An administrator created an account for you at [site:name]', $config->get('register_admin_created.subject')); - $this->assertIdentical("fr - [user:name],\r\n\r\nA site administrator at [site:name] has created an account for you. You may now log in to [site:login-url] using the following username and password:\r\n\r\nusername: [user:name]\r\npassword: \r\n\r\nYou may also log in by clicking on this link or copying and pasting it in your browser:\r\n\r\n[user:one-time-login-url]\r\n\r\nThis is a one-time login, so it can be used only once.\r\n\r\nAfter logging in, you will be redirected to [user:edit-url] so you can change your password.\r\n\r\n\r\n-- [site:name] team", $config->get('register_admin_created.body')); - $this->assertIdentical('fr - Account details for [user:name] at [site:name]', $config->get('register_no_approval_required.subject')); - $this->assertIdentical("fr - [user:name],\r\n\r\nThank you for registering at [site:name]. You may now log in to [site:login-url] using the following username and password:\r\n\r\nusername: [user:name]\r\npassword: \r\n\r\nYou may also log in by clicking on this link or copying and pasting it in your browser:\r\n\r\n[user:one-time-login-url]\r\n\r\nThis is a one-time login, so it can be used only once.\r\n\r\nAfter logging in, you will be redirected to [user:edit-url] so you can change your password.\r\n\r\n\r\n-- [site:name] team", $config->get('register_no_approval_required.body')); - $this->assertIdentical('fr - Account details for [user:name] at [site:name] (pending admin approval)', $config->get('register_pending_approval.subject')); - $this->assertIdentical("fr - [user:name],\r\n\r\nThank you for registering at [site:name]. Your application for an account is currently pending approval. Once it has been approved, you will receive another email containing information about how to log in, set your password, and other details.\r\n\r\n\r\n-- [site:name] team", $config->get('register_pending_approval.body')); - $this->assertIdentical('fr - Account details for [user:name] at [site:name] (blocked)', $config->get('status_blocked.subject')); - $this->assertIdentical("fr - [user:name],\r\n\r\nYour account on [site:name] has been blocked.", $config->get('status_blocked.body')); + $this->assertSame('fr - Account details for [user:name] at [site:name] (approved)', $config->get('status_activated.subject')); + $this->assertSame("fr - [user:name],\r\n\r\nYour account at [site:name] has been activated.\r\n\r\nYou may now log in by clicking on this link or copying and pasting it in your browser:\r\n\r\n[user:one-time-login-url]\r\n\r\nThis is a one-time login, so it can be used only once.\r\n\r\nAfter logging in, you will be redirected to [user:edit-url] so you can change your password.\r\n\r\nOnce you have set your own password, you will be able to log in to [site:login-url] in the future using:\r\n\r\nusername: [user:name]\r\n", $config->get('status_activated.body')); + $this->assertSame('fr - Replacement login information for [user:name] at [site:name]', $config->get('password_reset.subject')); + $this->assertSame("fr - [user:name],\r\n\r\nA request to reset the password for your account has been made at [site:name].\r\n\r\nYou may now log in to [site:url-brief] by clicking on this link or copying and pasting it in your browser:\r\n\r\n[user:one-time-login-url]\r\n\r\nThis is a one-time login, so it can be used only once. It expires after one day and nothing will happen if it's not used.\r\n\r\nAfter logging in, you will be redirected to [user:edit-url] so you can change your password.", $config->get('password_reset.body')); + $this->assertSame('fr - Account details for [user:name] at [site:name] (deleted)', $config->get('cancel_confirm.subject')); + $this->assertSame("fr - [user:name],\r\n\r\nYour account on [site:name] has been deleted.", $config->get('cancel_confirm.body')); + $this->assertSame('fr - An administrator created an account for you at [site:name]', $config->get('register_admin_created.subject')); + $this->assertSame("fr - [user:name],\r\n\r\nA site administrator at [site:name] has created an account for you. You may now log in to [site:login-url] using the following username and password:\r\n\r\nusername: [user:name]\r\npassword: \r\n\r\nYou may also log in by clicking on this link or copying and pasting it in your browser:\r\n\r\n[user:one-time-login-url]\r\n\r\nThis is a one-time login, so it can be used only once.\r\n\r\nAfter logging in, you will be redirected to [user:edit-url] so you can change your password.\r\n\r\n\r\n-- [site:name] team", $config->get('register_admin_created.body')); + $this->assertSame('fr - Account details for [user:name] at [site:name]', $config->get('register_no_approval_required.subject')); + $this->assertSame("fr - [user:name],\r\n\r\nThank you for registering at [site:name]. You may now log in to [site:login-url] using the following username and password:\r\n\r\nusername: [user:name]\r\npassword: \r\n\r\nYou may also log in by clicking on this link or copying and pasting it in your browser:\r\n\r\n[user:one-time-login-url]\r\n\r\nThis is a one-time login, so it can be used only once.\r\n\r\nAfter logging in, you will be redirected to [user:edit-url] so you can change your password.\r\n\r\n\r\n-- [site:name] team", $config->get('register_no_approval_required.body')); + $this->assertSame('fr - Account details for [user:name] at [site:name] (pending admin approval)', $config->get('register_pending_approval.subject')); + $this->assertSame("fr - [user:name],\r\n\r\nThank you for registering at [site:name]. Your application for an account is currently pending approval. Once it has been approved, you will receive another email containing information about how to log in, set your password, and other details.\r\n\r\n\r\n-- [site:name] team", $config->get('register_pending_approval.body')); + $this->assertSame('fr - Account details for [user:name] at [site:name] (blocked)', $config->get('status_blocked.subject')); + $this->assertSame("fr - [user:name],\r\n\r\nYour account on [site:name] has been blocked.", $config->get('status_blocked.body')); $this->assertConfigSchema(\Drupal::service('config.typed'), 'user.mail', $config->get()); $config = \Drupal::service('language_manager')->getLanguageConfigOverride('zu', 'user.mail'); - $this->assertIdentical('zu - An administrator created an account for you at [site:name]', $config->get('register_admin_created.subject')); - $this->assertIdentical("zu - [user:name],\r\n\r\nA site administrator at [site:name] has created an account for you. You may now log in to [site:login-url] using the following username and password:\r\n\r\nusername: [user:name]\r\npassword: \r\n\r\nYou may also log in by clicking on this link or copying and pasting it in your browser:\r\n\r\n[user:one-time-login-url]\r\n\r\nThis is a one-time login, so it can be used only once.\r\n\r\nAfter logging in, you will be redirected to [user:edit-url] so you can change your password.\r\n\r\n\r\n-- [site:name] team", $config->get('register_admin_created.body')); + $this->assertSame('zu - An administrator created an account for you at [site:name]', $config->get('register_admin_created.subject')); + $this->assertSame("zu - [user:name],\r\n\r\nA site administrator at [site:name] has created an account for you. You may now log in to [site:login-url] using the following username and password:\r\n\r\nusername: [user:name]\r\npassword: \r\n\r\nYou may also log in by clicking on this link or copying and pasting it in your browser:\r\n\r\n[user:one-time-login-url]\r\n\r\nThis is a one-time login, so it can be used only once.\r\n\r\nAfter logging in, you will be redirected to [user:edit-url] so you can change your password.\r\n\r\n\r\n-- [site:name] team", $config->get('register_admin_created.body')); } /** @@ -57,18 +57,18 @@ public function testUserMail() { */ public function testUserSettings() { $config = \Drupal::service('language_manager')->getLanguageConfigOverride('fr', 'user.settings'); - $this->assertIdentical(1, $config->get('notify.status_blocked')); - $this->assertIdentical(0, $config->get('notify.status_activated')); - $this->assertIdentical(0, $config->get('verify_mail')); - $this->assertIdentical('admin_only', $config->get('register')); - $this->assertIdentical('fr Guest', $config->get('anonymous')); + $this->assertSame(1, $config->get('notify.status_blocked')); + $this->assertSame(0, $config->get('notify.status_activated')); + $this->assertSame(0, $config->get('verify_mail')); + $this->assertSame('admin_only', $config->get('register')); + $this->assertSame('fr Guest', $config->get('anonymous')); $config = \Drupal::service('language_manager')->getLanguageConfigOverride('zu', 'user.settings'); - $this->assertIdentical(1, $config->get('notify.status_blocked')); - $this->assertIdentical(0, $config->get('notify.status_activated')); - $this->assertIdentical(0, $config->get('verify_mail')); - $this->assertIdentical('admin_only', $config->get('register')); - $this->assertIdentical('Guest', $config->get('anonymous')); + $this->assertSame(1, $config->get('notify.status_blocked')); + $this->assertSame(0, $config->get('notify.status_activated')); + $this->assertSame(0, $config->get('verify_mail')); + $this->assertSame('admin_only', $config->get('register')); + $this->assertSame('Guest', $config->get('anonymous')); } } diff --git a/core/modules/contact/tests/src/Kernel/Migrate/MigrateContactCategoryTest.php b/core/modules/contact/tests/src/Kernel/Migrate/MigrateContactCategoryTest.php index 291826c..eb52cc7 100644 --- a/core/modules/contact/tests/src/Kernel/Migrate/MigrateContactCategoryTest.php +++ b/core/modules/contact/tests/src/Kernel/Migrate/MigrateContactCategoryTest.php @@ -46,10 +46,10 @@ protected function assertEntity($id, $expected_label, array $expected_recipients /** @var \Drupal\contact\ContactFormInterface $entity */ $entity = ContactForm::load($id); $this->assertTrue($entity instanceof ContactFormInterface); - $this->assertIdentical($expected_label, $entity->label()); - $this->assertIdentical($expected_recipients, $entity->getRecipients()); - $this->assertIdentical($expected_reply, $entity->getReply()); - $this->assertIdentical($expected_weight, $entity->getWeight()); + $this->assertSame($expected_label, $entity->label()); + $this->assertSame($expected_recipients, $entity->getRecipients()); + $this->assertSame($expected_reply, $entity->getReply()); + $this->assertSame($expected_weight, $entity->getWeight()); } /** diff --git a/core/modules/contact/tests/src/Kernel/Migrate/d6/MigrateContactCategoryTest.php b/core/modules/contact/tests/src/Kernel/Migrate/d6/MigrateContactCategoryTest.php index d613cac..2e71ce5 100644 --- a/core/modules/contact/tests/src/Kernel/Migrate/d6/MigrateContactCategoryTest.php +++ b/core/modules/contact/tests/src/Kernel/Migrate/d6/MigrateContactCategoryTest.php @@ -31,22 +31,22 @@ protected function setUp() { public function testContactCategory() { /** @var \Drupal\contact\Entity\ContactForm $contact_form */ $contact_form = ContactForm::load('website_feedback'); - $this->assertIdentical('Website feedback', $contact_form->label()); - $this->assertIdentical(array('admin@example.com'), $contact_form->getRecipients()); - $this->assertIdentical('', $contact_form->getReply()); - $this->assertIdentical(0, $contact_form->getWeight()); + $this->assertSame('Website feedback', $contact_form->label()); + $this->assertSame(array('admin@example.com'), $contact_form->getRecipients()); + $this->assertSame('', $contact_form->getReply()); + $this->assertSame(0, $contact_form->getWeight()); $contact_form = ContactForm::load('some_other_category'); - $this->assertIdentical('Some other category', $contact_form->label()); - $this->assertIdentical(array('test@example.com'), $contact_form->getRecipients()); - $this->assertIdentical('Thanks for contacting us, we will reply ASAP!', $contact_form->getReply()); - $this->assertIdentical(1, $contact_form->getWeight()); + $this->assertSame('Some other category', $contact_form->label()); + $this->assertSame(array('test@example.com'), $contact_form->getRecipients()); + $this->assertSame('Thanks for contacting us, we will reply ASAP!', $contact_form->getReply()); + $this->assertSame(1, $contact_form->getWeight()); $contact_form = ContactForm::load('a_category_much_longer_than_thir'); - $this->assertIdentical('A category much longer than thirty two characters', $contact_form->label()); - $this->assertIdentical(array('fortyninechars@example.com'), $contact_form->getRecipients()); - $this->assertIdentical('', $contact_form->getReply()); - $this->assertIdentical(2, $contact_form->getWeight()); + $this->assertSame('A category much longer than thirty two characters', $contact_form->label()); + $this->assertSame(array('fortyninechars@example.com'), $contact_form->getRecipients()); + $this->assertSame('', $contact_form->getReply()); + $this->assertSame(2, $contact_form->getWeight()); } } diff --git a/core/modules/contact/tests/src/Kernel/Migrate/d6/MigrateContactSettingsTest.php b/core/modules/contact/tests/src/Kernel/Migrate/d6/MigrateContactSettingsTest.php index 9efaae9..d871320 100644 --- a/core/modules/contact/tests/src/Kernel/Migrate/d6/MigrateContactSettingsTest.php +++ b/core/modules/contact/tests/src/Kernel/Migrate/d6/MigrateContactSettingsTest.php @@ -32,9 +32,9 @@ protected function setUp() { */ public function testContactSettings() { $config = $this->config('contact.settings'); - $this->assertIdentical(TRUE, $config->get('user_default_enabled')); - $this->assertIdentical(3, $config->get('flood.limit')); - $this->assertIdentical('some_other_category', $config->get('default_form')); + $this->assertSame(TRUE, $config->get('user_default_enabled')); + $this->assertSame(3, $config->get('flood.limit')); + $this->assertSame('some_other_category', $config->get('default_form')); $this->assertConfigSchema(\Drupal::service('config.typed'), 'contact.settings', $config->get()); } diff --git a/core/modules/contact/tests/src/Kernel/Migrate/d7/MigrateContactSettingsTest.php b/core/modules/contact/tests/src/Kernel/Migrate/d7/MigrateContactSettingsTest.php index 22385f0..bd52b37 100644 --- a/core/modules/contact/tests/src/Kernel/Migrate/d7/MigrateContactSettingsTest.php +++ b/core/modules/contact/tests/src/Kernel/Migrate/d7/MigrateContactSettingsTest.php @@ -31,7 +31,7 @@ protected function setUp() { public function testContactSettings() { $config = $this->config('contact.settings'); $this->assertTrue($config->get('user_default_enabled')); - $this->assertIdentical(33, $config->get('flood.limit')); + $this->assertSame(33, $config->get('flood.limit')); $this->assertEqual('website_testing', $config->get('default_form')); } diff --git a/core/modules/content_translation/tests/src/Kernel/ContentTranslationConfigImportTest.php b/core/modules/content_translation/tests/src/Kernel/ContentTranslationConfigImportTest.php index f650270..ccf3204 100644 --- a/core/modules/content_translation/tests/src/Kernel/ContentTranslationConfigImportTest.php +++ b/core/modules/content_translation/tests/src/Kernel/ContentTranslationConfigImportTest.php @@ -66,7 +66,7 @@ function testConfigImportUpdates() { $sync = $this->container->get('config.storage.sync'); // Verify the configuration to create does not exist yet. - $this->assertIdentical($storage->exists($config_name), FALSE, $config_name . ' not found.'); + $this->assertSame($storage->exists($config_name), FALSE, $config_name . ' not found.'); // Create new config entity. $data = array( @@ -86,14 +86,14 @@ function testConfigImportUpdates() { ), ); $sync->write($config_name, $data); - $this->assertIdentical($sync->exists($config_name), TRUE, $config_name . ' found.'); + $this->assertSame($sync->exists($config_name), TRUE, $config_name . ' found.'); // Import. $this->configImporter->reset()->import(); // Verify the values appeared. $config = $this->config($config_name); - $this->assertIdentical($config->get('id'), $config_id); + $this->assertSame($config->get('id'), $config_id); // Verify that updates were performed. $entity_type = $this->container->get('entity.manager')->getDefinition($entity_type_id); diff --git a/core/modules/contextual/src/Tests/ContextualDynamicContextTest.php b/core/modules/contextual/src/Tests/ContextualDynamicContextTest.php index e5d2c85..bfacc20 100644 --- a/core/modules/contextual/src/Tests/ContextualDynamicContextTest.php +++ b/core/modules/contextual/src/Tests/ContextualDynamicContextTest.php @@ -95,10 +95,10 @@ function testDifferentPermissions() { $response = $this->renderContextualLinks($ids, 'node'); $this->assertResponse(200); $json = Json::decode($response); - $this->assertIdentical($json[$ids[0]], ''); - $this->assertIdentical($json[$ids[1]], ''); - $this->assertIdentical($json[$ids[2]], ''); - $this->assertIdentical($json[$ids[3]], ''); + $this->assertSame($json[$ids[0]], ''); + $this->assertSame($json[$ids[1]], ''); + $this->assertSame($json[$ids[2]], ''); + $this->assertSame($json[$ids[3]], ''); // Verify that link language is properly handled. $node3->addTranslation('it')->set('title', $this->randomString())->save(); @@ -118,10 +118,10 @@ function testDifferentPermissions() { $response = $this->renderContextualLinks($ids, 'node'); $this->assertResponse(200); $json = Json::decode($response); - $this->assertIdentical($json[$ids[0]], ''); - $this->assertIdentical($json[$ids[1]], ''); - $this->assertIdentical($json[$ids[2]], ''); - $this->assertIdentical($json[$ids[3]], ''); + $this->assertSame($json[$ids[0]], ''); + $this->assertSame($json[$ids[1]], ''); + $this->assertSame($json[$ids[2]], ''); + $this->assertSame($json[$ids[3]], ''); // Anonymous user: cannot access contextual links. $this->drupalLogin($this->anonymousUser); diff --git a/core/modules/contextual/tests/src/Kernel/ContextualUnitTest.php b/core/modules/contextual/tests/src/Kernel/ContextualUnitTest.php index 680303d..7dbc4a3 100644 --- a/core/modules/contextual/tests/src/Kernel/ContextualUnitTest.php +++ b/core/modules/contextual/tests/src/Kernel/ContextualUnitTest.php @@ -113,7 +113,7 @@ function _contextual_links_id_testcases() { function testContextualLinksToId() { $tests = $this->_contextual_links_id_testcases(); foreach ($tests as $test) { - $this->assertIdentical(_contextual_links_to_id($test['links']), $test['id']); + $this->assertSame(_contextual_links_to_id($test['links']), $test['id']); } } @@ -123,7 +123,7 @@ function testContextualLinksToId() { function testContextualIdToLinks() { $tests = $this->_contextual_links_id_testcases(); foreach ($tests as $test) { - $this->assertIdentical(_contextual_id_to_links($test['id']), $test['links']); + $this->assertSame(_contextual_id_to_links($test['id']), $test['links']); } } diff --git a/core/modules/dblog/tests/src/Kernel/Migrate/d6/MigrateDblogConfigsTest.php b/core/modules/dblog/tests/src/Kernel/Migrate/d6/MigrateDblogConfigsTest.php index 321870f..d8c9913 100644 --- a/core/modules/dblog/tests/src/Kernel/Migrate/d6/MigrateDblogConfigsTest.php +++ b/core/modules/dblog/tests/src/Kernel/Migrate/d6/MigrateDblogConfigsTest.php @@ -32,7 +32,7 @@ protected function setUp() { */ public function testBookSettings() { $config = $this->config('dblog.settings'); - $this->assertIdentical(10000, $config->get('row_limit')); + $this->assertSame(10000, $config->get('row_limit')); $this->assertConfigSchema(\Drupal::service('config.typed'), 'dblog.settings', $config->get()); } diff --git a/core/modules/dblog/tests/src/Kernel/Migrate/d7/MigrateDblogConfigsTest.php b/core/modules/dblog/tests/src/Kernel/Migrate/d7/MigrateDblogConfigsTest.php index d970830..963b26a 100644 --- a/core/modules/dblog/tests/src/Kernel/Migrate/d7/MigrateDblogConfigsTest.php +++ b/core/modules/dblog/tests/src/Kernel/Migrate/d7/MigrateDblogConfigsTest.php @@ -30,7 +30,7 @@ protected function setUp() { */ public function testDblogSettings() { $config = $this->config('dblog.settings'); - $this->assertIdentical(10000, $config->get('row_limit')); + $this->assertSame(10000, $config->get('row_limit')); } } diff --git a/core/modules/editor/src/Tests/EditorAdminTest.php b/core/modules/editor/src/Tests/EditorAdminTest.php index 97d47b1..2ce7d20 100644 --- a/core/modules/editor/src/Tests/EditorAdminTest.php +++ b/core/modules/editor/src/Tests/EditorAdminTest.php @@ -221,8 +221,8 @@ protected function selectUnicornEditor() { protected function verifyUnicornEditorConfiguration($format_id, $ponies_too = TRUE) { $editor = editor_load($format_id); $settings = $editor->getSettings(); - $this->assertIdentical($editor->getEditor(), 'unicorn', 'The text editor is configured correctly.'); - $this->assertIdentical($settings['ponies_too'], $ponies_too, 'The text editor settings are stored correctly.'); + $this->assertSame($editor->getEditor(), 'unicorn', 'The text editor is configured correctly.'); + $this->assertSame($settings['ponies_too'], $ponies_too, 'The text editor settings are stored correctly.'); $this->drupalGet('admin/config/content/formats/manage/' . $format_id); $select = $this->xpath('//select[@name="editor[editor]"]'); $select_is_disabled = $this->xpath('//select[@name="editor[editor]" and @disabled="disabled"]'); diff --git a/core/modules/editor/src/Tests/EditorLoadingTest.php b/core/modules/editor/src/Tests/EditorLoadingTest.php index 88055e9..512b346 100644 --- a/core/modules/editor/src/Tests/EditorLoadingTest.php +++ b/core/modules/editor/src/Tests/EditorLoadingTest.php @@ -148,7 +148,7 @@ public function testLoading() { 'isXssSafe' => FALSE, ))); $this->assertTrue($editor_settings_present, "Text Editor module's JavaScript settings are on the page."); - $this->assertIdentical($expected, $settings['editor'], "Text Editor module's JavaScript settings on the page are correct."); + $this->assertSame($expected, $settings['editor'], "Text Editor module's JavaScript settings on the page are correct."); $this->assertTrue($editor_js_present, 'Text Editor JavaScript is present.'); $this->assertTrue(count($body) === 1, 'A body field exists.'); $this->assertTrue(count($format_selector) === 1, 'A single text format selector exists on the page.'); @@ -182,7 +182,7 @@ public function testLoading() { 'isXssSafe' => FALSE, ))); $this->assertTrue($editor_settings_present, "Text Editor module's JavaScript settings are on the page."); - $this->assertIdentical($expected, $settings['editor'], "Text Editor module's JavaScript settings on the page are correct."); + $this->assertSame($expected, $settings['editor'], "Text Editor module's JavaScript settings on the page are correct."); $this->assertTrue($editor_js_present, 'Text Editor JavaScript is present.'); $this->assertTrue(count($body) === 1, 'A body field exists.'); $this->assertTrue(count($format_selector) === 0, 'No text format selector exists on the page.'); diff --git a/core/modules/editor/src/Tests/EditorSecurityTest.php b/core/modules/editor/src/Tests/EditorSecurityTest.php index c771439..46d48b0 100644 --- a/core/modules/editor/src/Tests/EditorSecurityTest.php +++ b/core/modules/editor/src/Tests/EditorSecurityTest.php @@ -284,7 +284,7 @@ function testInitialSecurity() { $this->drupalLogin($account); $this->drupalGet('node/' . $case['node_id'] . '/edit'); $dom_node = $this->xpath('//textarea[@id="edit-body-0-value"]'); - $this->assertIdentical($case['value'], (string) $dom_node[0], 'The value was correctly filtered for XSS attack vectors.'); + $this->assertSame($case['value'], (string) $dom_node[0], 'The value was correctly filtered for XSS attack vectors.'); } } } @@ -390,8 +390,8 @@ function testSwitchingSecurity() { // Verify data- attributes. $dom_node = $this->xpath('//textarea[@id="edit-body-0-value"]'); - $this->assertIdentical(self::$sampleContent, (string) $dom_node[0]['data-editor-value-original'], 'The data-editor-value-original attribute is correctly set.'); - $this->assertIdentical('false', (string) $dom_node[0]['data-editor-value-is-changed'], 'The data-editor-value-is-changed attribute is correctly set.'); + $this->assertSame(self::$sampleContent, (string) $dom_node[0]['data-editor-value-original'], 'The data-editor-value-original attribute is correctly set.'); + $this->assertSame('false', (string) $dom_node[0]['data-editor-value-is-changed'], 'The data-editor-value-is-changed attribute is correctly set.'); // Switch to every other text format/editor and verify the results. foreach ($case['switch_to'] as $format => $expected_filtered_value) { @@ -407,7 +407,7 @@ function testSwitchingSecurity() { $response = $this->drupalPostWithFormat('editor/filter_xss/' . $format, 'json', $post); $this->assertResponse(200); $json = Json::decode($response); - $this->assertIdentical($json, $expected_filtered_value, 'The value was correctly filtered for XSS attack vectors.'); + $this->assertSame($json, $expected_filtered_value, 'The value was correctly filtered for XSS attack vectors.'); } } } @@ -420,7 +420,7 @@ function testEditorXssFilterOverride() { $this->drupalLogin($this->normalUser); $this->drupalGet('node/2/edit'); $dom_node = $this->xpath('//textarea[@id="edit-body-0-value"]'); - $this->assertIdentical(self::$sampleContentSecured, (string) $dom_node[0], 'The value was filtered by the Standard text editor XSS filter.'); + $this->assertSame(self::$sampleContentSecured, (string) $dom_node[0], 'The value was filtered by the Standard text editor XSS filter.'); // Enable editor_test.module's hook_editor_xss_filter_alter() implementation // to alter the text editor XSS filter class being used. @@ -429,7 +429,7 @@ function testEditorXssFilterOverride() { // First: the Insecure text editor XSS filter. $this->drupalGet('node/2/edit'); $dom_node = $this->xpath('//textarea[@id="edit-body-0-value"]'); - $this->assertIdentical(self::$sampleContent, (string) $dom_node[0], 'The value was filtered by the Insecure text editor XSS filter.'); + $this->assertSame(self::$sampleContent, (string) $dom_node[0], 'The value was filtered by the Insecure text editor XSS filter.'); } } diff --git a/core/modules/editor/src/Tests/QuickEditIntegrationLoadingTest.php b/core/modules/editor/src/Tests/QuickEditIntegrationLoadingTest.php index 9a41f6b..e2e22ee 100644 --- a/core/modules/editor/src/Tests/QuickEditIntegrationLoadingTest.php +++ b/core/modules/editor/src/Tests/QuickEditIntegrationLoadingTest.php @@ -87,7 +87,7 @@ public function testUsersWithoutPermission() { // Retrieving the untransformed text should result in an empty 403 response. $response = $this->drupalPost('editor/' . 'node/1/body/en/full', '', array(), array('query' => array(MainContentViewSubscriber::WRAPPER_FORMAT => 'drupal_ajax'))); $this->assertResponse(403); - $this->assertIdentical('{}', $response); + $this->assertSame('{}', $response); } } @@ -105,9 +105,9 @@ public function testUserWithPermission() { $response = $this->drupalPost('editor/' . 'node/1/body/en/full', '', [], ['query' => [MainContentViewSubscriber::WRAPPER_FORMAT => 'drupal_ajax']]); $this->assertResponse(200); $ajax_commands = Json::decode($response); - $this->assertIdentical(1, count($ajax_commands), 'The untransformed text POST request results in one AJAX command.'); - $this->assertIdentical('editorGetUntransformedText', $ajax_commands[0]['command'], 'The first AJAX command is an editorGetUntransformedText command.'); - $this->assertIdentical('

            Do you also love Drupal?

            ', $ajax_commands[0]['data'], 'The editorGetUntransformedText command contains the expected data.'); + $this->assertSame(1, count($ajax_commands), 'The untransformed text POST request results in one AJAX command.'); + $this->assertSame('editorGetUntransformedText', $ajax_commands[0]['command'], 'The first AJAX command is an editorGetUntransformedText command.'); + $this->assertSame('

            Do you also love Drupal?

            ', $ajax_commands[0]['data'], 'The editorGetUntransformedText command contains the expected data.'); } } diff --git a/core/modules/editor/src/Tests/Update/EditorUpdateTest.php b/core/modules/editor/src/Tests/Update/EditorUpdateTest.php index e7f0f44..71ef09e 100644 --- a/core/modules/editor/src/Tests/Update/EditorUpdateTest.php +++ b/core/modules/editor/src/Tests/Update/EditorUpdateTest.php @@ -59,12 +59,12 @@ public function testEditorUpdate8001() { // Checks if the 'basic_html' format and editor statuses are in sync. $this->assertTrue($format_basic_html->get('status')); $this->assertTrue($editor_basic_html->get('status')); - $this->assertIdentical($format_basic_html->get('status'), $editor_basic_html->get('status')); + $this->assertSame($format_basic_html->get('status'), $editor_basic_html->get('status')); // Checks if the 'full_html' format and editor statuses are in sync. $this->assertFalse($format_full_html->get('status')); $this->assertFalse($editor_full_html->get('status')); - $this->assertIdentical($format_full_html->get('status'), $editor_full_html->get('status')); + $this->assertSame($format_full_html->get('status'), $editor_full_html->get('status')); } } diff --git a/core/modules/editor/tests/src/Kernel/EditorFileReferenceFilterTest.php b/core/modules/editor/tests/src/Kernel/EditorFileReferenceFilterTest.php index 51eee97..3fcc11c 100644 --- a/core/modules/editor/tests/src/Kernel/EditorFileReferenceFilterTest.php +++ b/core/modules/editor/tests/src/Kernel/EditorFileReferenceFilterTest.php @@ -67,38 +67,38 @@ function testEditorFileReferenceFilter() { $this->pass('No data-entity-type and no data-entity-uuid attribute.'); $input = ''; $output = $test($input); - $this->assertIdentical($input, $output->getProcessedText()); + $this->assertSame($input, $output->getProcessedText()); $this->pass('A non-file data-entity-type attribute value.'); $input = ''; $output = $test($input); - $this->assertIdentical($input, $output->getProcessedText()); + $this->assertSame($input, $output->getProcessedText()); $this->pass('One data-entity-uuid attribute.'); $input = ''; $expected_output = ''; $output = $test($input); - $this->assertIdentical($expected_output, $output->getProcessedText()); + $this->assertSame($expected_output, $output->getProcessedText()); $this->assertEqual($cache_tag, $output->getCacheTags()); $this->pass('One data-entity-uuid attribute with odd capitalization.'); $input = ''; $expected_output = ''; $output = $test($input); - $this->assertIdentical($expected_output, $output->getProcessedText()); + $this->assertSame($expected_output, $output->getProcessedText()); $this->assertEqual($cache_tag, $output->getCacheTags()); $this->pass('One data-entity-uuid attribute on a non-image tag.'); $input = '