diff --git a/core/tests/Drupal/KernelTests/Core/Asset/AttachedAssetsTest.php b/core/tests/Drupal/KernelTests/Core/Asset/AttachedAssetsTest.php index fa409af..13af30f 100644 --- a/core/tests/Drupal/KernelTests/Core/Asset/AttachedAssetsTest.php +++ b/core/tests/Drupal/KernelTests/Core/Asset/AttachedAssetsTest.php @@ -70,7 +70,7 @@ public function testLibraryUnknown() { $build['#attached']['library'][] = 'core/unknown'; $assets = AttachedAssets::createFromRenderArray($build); - $this->assertIdentical([], $this->assetResolver->getJsAssets($assets, FALSE)[0], 'Unknown library was not added to the page.'); + $this->assertSame([], $this->assetResolver->getJsAssets($assets, FALSE)[0], 'Unknown library was not added to the page.'); } /** @@ -435,12 +435,12 @@ public function testDynamicLibrary() { $dynamic_library = $library_discovery->getLibraryByName('common_test', 'dynamic_library'); $this->assertTrue(is_array($dynamic_library)); if ($this->assertTrue(isset($dynamic_library['version']))) { - $this->assertIdentical('1.0', $dynamic_library['version']); + $this->assertSame('1.0', $dynamic_library['version']); } // Make sure the dynamic library definition could be altered. // @see common_test_library_info_alter() if ($this->assertTrue(isset($dynamic_library['dependencies']))) { - $this->assertIdentical(['core/jquery'], $dynamic_library['dependencies']); + $this->assertSame(['core/jquery'], $dynamic_library['dependencies']); } } diff --git a/core/tests/Drupal/KernelTests/Core/Cache/DatabaseBackendTest.php b/core/tests/Drupal/KernelTests/Core/Cache/DatabaseBackendTest.php index de8bbda..04bbdc6 100644 --- a/core/tests/Drupal/KernelTests/Core/Cache/DatabaseBackendTest.php +++ b/core/tests/Drupal/KernelTests/Core/Cache/DatabaseBackendTest.php @@ -40,12 +40,12 @@ public function testSetGet() { $cid_long = str_repeat('愛€', 500); $cached_value_long = $this->randomMachineName(); $backend->set($cid_long, $cached_value_long); - $this->assertIdentical($cached_value_long, $backend->get($cid_long)->data, "Backend contains the correct value for long, non-ASCII cache id."); + $this->assertSame($cached_value_long, $backend->get($cid_long)->data, "Backend contains the correct value for long, non-ASCII cache id."); $cid_short = '愛1€'; $cached_value_short = $this->randomMachineName(); $backend->set($cid_short, $cached_value_short); - $this->assertIdentical($cached_value_short, $backend->get($cid_short)->data, "Backend contains the correct value for short, non-ASCII cache id."); + $this->assertSame($cached_value_short, $backend->get($cid_short)->data, "Backend contains the correct value for short, non-ASCII cache id."); } } diff --git a/core/tests/Drupal/KernelTests/Core/Cache/GenericCacheBackendUnitTestBase.php b/core/tests/Drupal/KernelTests/Core/Cache/GenericCacheBackendUnitTestBase.php index 0143f86..a08d0f9 100644 --- a/core/tests/Drupal/KernelTests/Core/Cache/GenericCacheBackendUnitTestBase.php +++ b/core/tests/Drupal/KernelTests/Core/Cache/GenericCacheBackendUnitTestBase.php @@ -130,22 +130,22 @@ protected function tearDown() { public function testSetGet() { $backend = $this->getCacheBackend(); - $this->assertIdentical(FALSE, $backend->get('test1'), "Backend does not contain data for cache id test1."); + $this->assertSame(FALSE, $backend->get('test1'), "Backend does not contain data for cache id test1."); $with_backslash = ['foo' => '\Drupal\foo\Bar']; $backend->set('test1', $with_backslash); $cached = $backend->get('test1'); $this->assert(is_object($cached), "Backend returned an object for cache id test1."); - $this->assertIdentical($with_backslash, $cached->data); + $this->assertSame($with_backslash, $cached->data); $this->assertTrue($cached->valid, 'Item is marked as valid.'); // We need to round because microtime may be rounded up in the backend. $this->assertTrue($cached->created >= REQUEST_TIME && $cached->created <= round(microtime(TRUE), 3), 'Created time is correct.'); $this->assertEqual($cached->expire, Cache::PERMANENT, 'Expire time is correct.'); - $this->assertIdentical(FALSE, $backend->get('test2'), "Backend does not contain data for cache id test2."); + $this->assertSame(FALSE, $backend->get('test2'), "Backend does not contain data for cache id test2."); $backend->set('test2', ['value' => 3], REQUEST_TIME + 3); $cached = $backend->get('test2'); $this->assert(is_object($cached), "Backend returned an object for cache id test2."); - $this->assertIdentical(['value' => 3], $cached->data); + $this->assertSame(['value' => 3], $cached->data); $this->assertTrue($cached->valid, 'Item is marked as valid.'); $this->assertTrue($cached->created >= REQUEST_TIME && $cached->created <= round(microtime(TRUE), 3), 'Created time is correct.'); $this->assertEqual($cached->expire, REQUEST_TIME + 3, 'Expire time is correct.'); @@ -158,22 +158,22 @@ public function testSetGet() { $this->assertTrue($cached->created >= REQUEST_TIME && $cached->created <= round(microtime(TRUE), 3), 'Created time is correct.'); $this->assertEqual($cached->expire, REQUEST_TIME - 3, 'Expire time is correct.'); - $this->assertIdentical(FALSE, $backend->get('test4'), "Backend does not contain data for cache id test4."); + $this->assertSame(FALSE, $backend->get('test4'), "Backend does not contain data for cache id test4."); $with_eof = ['foo' => "\nEOF\ndata"]; $backend->set('test4', $with_eof); $cached = $backend->get('test4'); $this->assert(is_object($cached), "Backend returned an object for cache id test4."); - $this->assertIdentical($with_eof, $cached->data); + $this->assertSame($with_eof, $cached->data); $this->assertTrue($cached->valid, 'Item is marked as valid.'); $this->assertTrue($cached->created >= REQUEST_TIME && $cached->created <= round(microtime(TRUE), 3), 'Created time is correct.'); $this->assertEqual($cached->expire, Cache::PERMANENT, 'Expire time is correct.'); - $this->assertIdentical(FALSE, $backend->get('test5'), "Backend does not contain data for cache id test5."); + $this->assertSame(FALSE, $backend->get('test5'), "Backend does not contain data for cache id test5."); $with_eof_and_semicolon = ['foo' => "\nEOF;\ndata"]; $backend->set('test5', $with_eof_and_semicolon); $cached = $backend->get('test5'); $this->assert(is_object($cached), "Backend returned an object for cache id test5."); - $this->assertIdentical($with_eof_and_semicolon, $cached->data); + $this->assertSame($with_eof_and_semicolon, $cached->data); $this->assertTrue($cached->valid, 'Item is marked as valid.'); $this->assertTrue($cached->created >= REQUEST_TIME && $cached->created <= round(microtime(TRUE), 3), 'Created time is correct.'); $this->assertEqual($cached->expire, Cache::PERMANENT, 'Expire time is correct.'); @@ -182,7 +182,7 @@ public function testSetGet() { $backend->set('test6', $with_variable); $cached = $backend->get('test6'); $this->assert(is_object($cached), "Backend returned an object for cache id test6."); - $this->assertIdentical($with_variable, $cached->data); + $this->assertSame($with_variable, $cached->data); // Make sure that a cached object is not affected by changing the original. $data = new \stdClass(); @@ -229,26 +229,26 @@ public function testSetGet() { public function testDelete() { $backend = $this->getCacheBackend(); - $this->assertIdentical(FALSE, $backend->get('test1'), "Backend does not contain data for cache id test1."); + $this->assertSame(FALSE, $backend->get('test1'), "Backend does not contain data for cache id test1."); $backend->set('test1', 7); $this->assert(is_object($backend->get('test1')), "Backend returned an object for cache id test1."); - $this->assertIdentical(FALSE, $backend->get('test2'), "Backend does not contain data for cache id test2."); + $this->assertSame(FALSE, $backend->get('test2'), "Backend does not contain data for cache id test2."); $backend->set('test2', 3); $this->assert(is_object($backend->get('test2')), "Backend returned an object for cache id %cid."); $backend->delete('test1'); - $this->assertIdentical(FALSE, $backend->get('test1'), "Backend does not contain data for cache id test1 after deletion."); + $this->assertSame(FALSE, $backend->get('test1'), "Backend does not contain data for cache id test1 after deletion."); $this->assert(is_object($backend->get('test2')), "Backend still has an object for cache id test2."); $backend->delete('test2'); - $this->assertIdentical(FALSE, $backend->get('test2'), "Backend does not contain data for cache id test2 after deletion."); + $this->assertSame(FALSE, $backend->get('test2'), "Backend does not contain data for cache id test2 after deletion."); $long_cid = str_repeat('a', 300); $backend->set($long_cid, 'test'); $backend->delete($long_cid); - $this->assertIdentical(FALSE, $backend->get($long_cid), "Backend does not contain data for long cache id after deletion."); + $this->assertSame(FALSE, $backend->get($long_cid), "Backend does not contain data for long cache id after deletion."); } /** @@ -275,7 +275,7 @@ public function testValueTypeIsKept() { foreach ($variables as $cid => $value) { $object = $backend->get($cid); $this->assert(is_object($object), sprintf("Backend returned an object for cache id %s.", $cid)); - $this->assertIdentical($value, $object->data, sprintf("Data of cached id %s kept is identical in type and value", $cid)); + $this->assertSame($value, $object->data, sprintf("Data of cached id %s kept is identical in type and value", $cid)); } } @@ -450,10 +450,10 @@ public function testDeleteMultiple() { ]); // Test if expected keys have been deleted. - $this->assertIdentical(FALSE, $backend->get('test1'), "Cache id test1 deleted."); - $this->assertIdentical(FALSE, $backend->get('test3'), "Cache id test3 deleted."); - $this->assertIdentical(FALSE, $backend->get('test5'), "Cache id test5 deleted."); - $this->assertIdentical(FALSE, $backend->get('test7'), "Cache id test7 deleted."); + $this->assertSame(FALSE, $backend->get('test1'), "Cache id test1 deleted."); + $this->assertSame(FALSE, $backend->get('test3'), "Cache id test3 deleted."); + $this->assertSame(FALSE, $backend->get('test5'), "Cache id test5 deleted."); + $this->assertSame(FALSE, $backend->get('test7'), "Cache id test7 deleted."); // Test if expected keys exist. $this->assertNotIdentical(FALSE, $backend->get('test2'), "Cache id test2 exists."); @@ -461,8 +461,8 @@ public function testDeleteMultiple() { $this->assertNotIdentical(FALSE, $backend->get('test6'), "Cache id test6 exists."); // Test if that expected keys do not exist. - $this->assertIdentical(FALSE, $backend->get('test19'), "Cache id test19 does not exist."); - $this->assertIdentical(FALSE, $backend->get('test21'), "Cache id test21 does not exist."); + $this->assertSame(FALSE, $backend->get('test19'), "Cache id test19 does not exist."); + $this->assertSame(FALSE, $backend->get('test21'), "Cache id test21 does not exist."); // Calling deleteMultiple() with an empty array should not cause an error. $this->assertFalse($backend->deleteMultiple([])); diff --git a/core/tests/Drupal/KernelTests/Core/Command/DbDumpTest.php b/core/tests/Drupal/KernelTests/Core/Command/DbDumpTest.php index 8129410..c6192da 100644 --- a/core/tests/Drupal/KernelTests/Core/Command/DbDumpTest.php +++ b/core/tests/Drupal/KernelTests/Core/Command/DbDumpTest.php @@ -205,13 +205,13 @@ public function testScriptLoad() { $this->assertTrue(Database::getConnection() ->schema() ->tableExists($table), SafeMarkup::format('Table @table created by the database script.', ['@table' => $table])); - $this->assertIdentical($this->originalTableSchemas[$table], $this->getTableSchema($table), SafeMarkup::format('The schema for @table was properly restored.', ['@table' => $table])); - $this->assertIdentical($this->originalTableIndexes[$table], $this->getTableIndexes($table), SafeMarkup::format('The indexes for @table were properly restored.', ['@table' => $table])); + $this->assertSame($this->originalTableSchemas[$table], $this->getTableSchema($table), SafeMarkup::format('The schema for @table was properly restored.', ['@table' => $table])); + $this->assertSame($this->originalTableIndexes[$table], $this->getTableIndexes($table), SafeMarkup::format('The indexes for @table were properly restored.', ['@table' => $table])); } // Ensure the test config has been replaced. $config = unserialize(db_query("SELECT data FROM {config} WHERE name = 'test_config'")->fetchField()); - $this->assertIdentical($config, $this->data, 'Script has properly restored the config table data.'); + $this->assertSame($config, $this->data, 'Script has properly restored the config table data.'); // Ensure the cache data was not exported. $this->assertFalse(\Drupal::cache('discovery') diff --git a/core/tests/Drupal/KernelTests/Core/Config/ConfigCRUDTest.php b/core/tests/Drupal/KernelTests/Core/Config/ConfigCRUDTest.php index a94b1b8..9f2a1a7 100644 --- a/core/tests/Drupal/KernelTests/Core/Config/ConfigCRUDTest.php +++ b/core/tests/Drupal/KernelTests/Core/Config/ConfigCRUDTest.php @@ -278,12 +278,12 @@ public function testDataTypes() { $this->assertIdentical($storage->read($name), $data); // Test that schema type enforcement can be overridden by trusting the data. - $this->assertIdentical(99, $config->get('int')); + $this->assertSame(99, $config->get('int')); $config->set('int', '99')->save(TRUE); - $this->assertIdentical('99', $config->get('int')); + $this->assertSame('99', $config->get('int')); // Test that re-saving without testing the data enforces the schema type. $config->save(); - $this->assertIdentical($data, $config->get()); + $this->assertSame($data, $config->get()); // Test that setting an unsupported type for a config object with a schema // fails. diff --git a/core/tests/Drupal/KernelTests/Core/Config/ConfigDependencyTest.php b/core/tests/Drupal/KernelTests/Core/Config/ConfigDependencyTest.php index 79b01cb..7bc7fcc 100644 --- a/core/tests/Drupal/KernelTests/Core/Config/ConfigDependencyTest.php +++ b/core/tests/Drupal/KernelTests/Core/Config/ConfigDependencyTest.php @@ -328,7 +328,7 @@ public function testConfigEntityUninstallComplex(array $entity_id_suffixes) { $called = \Drupal::state()->get('config_test.on_dependency_removal_called', []); $this->assertFalse(in_array($entity_3->id(), $called), 'ConfigEntityInterface::onDependencyRemoval() is not called for entity 3.'); - $this->assertIdentical([$entity_1->id(), $entity_4->id(), $entity_2->id()], $called, 'The most dependent entites have ConfigEntityInterface::onDependencyRemoval() called first.'); + $this->assertSame([$entity_1->id(), $entity_4->id(), $entity_2->id()], $called, 'The most dependent entites have ConfigEntityInterface::onDependencyRemoval() called first.'); // Perform a module rebuild so we can know where the node module is located // and uninstall it. diff --git a/core/tests/Drupal/KernelTests/Core/Config/ConfigEntityStaticCacheTest.php b/core/tests/Drupal/KernelTests/Core/Config/ConfigEntityStaticCacheTest.php index 3c3f70b..1cd9cb1 100644 --- a/core/tests/Drupal/KernelTests/Core/Config/ConfigEntityStaticCacheTest.php +++ b/core/tests/Drupal/KernelTests/Core/Config/ConfigEntityStaticCacheTest.php @@ -57,7 +57,7 @@ public function testCacheHit() { // config_entity_static_cache_test_config_test_load() sets _loadStamp to a // random string. If they match, it means $entity_2 was retrieved from the // static cache rather than going through a separate load sequence. - $this->assertIdentical($entity_1->_loadStamp, $entity_2->_loadStamp); + $this->assertSame($entity_1->_loadStamp, $entity_2->_loadStamp); } /** diff --git a/core/tests/Drupal/KernelTests/Core/Config/ConfigEntityUnitTest.php b/core/tests/Drupal/KernelTests/Core/Config/ConfigEntityUnitTest.php index 0010da7..807152b 100644 --- a/core/tests/Drupal/KernelTests/Core/Config/ConfigEntityUnitTest.php +++ b/core/tests/Drupal/KernelTests/Core/Config/ConfigEntityUnitTest.php @@ -80,7 +80,7 @@ public function testStorageMethods() { // Compare UUIDs as the objects are not identical since // $entity->enforceIsNew is FALSE and $entity_loaded_by_uuid->enforceIsNew // is NULL. - $this->assertIdentical($entity->uuid(), $entity_loaded_by_uuid->uuid()); + $this->assertSame($entity->uuid(), $entity_loaded_by_uuid->uuid()); $entities = $this->storage->loadByProperties(); $this->assertEqual(count($entities), 3, 'Three entities are loaded when no properties are specified.'); @@ -100,12 +100,12 @@ public function testStorageMethods() { 'style' => 999 ]); $entity->save(); - $this->assertIdentical('999', $entity->style); + $this->assertSame('999', $entity->style); $entity->style = 999; $entity->trustData()->save(); - $this->assertIdentical(999, $entity->style); + $this->assertSame(999, $entity->style); $entity->save(); - $this->assertIdentical('999', $entity->style); + $this->assertSame('999', $entity->style); } } diff --git a/core/tests/Drupal/KernelTests/Core/Config/ConfigFileContentTest.php b/core/tests/Drupal/KernelTests/Core/Config/ConfigFileContentTest.php index 5366629..b449064 100644 --- a/core/tests/Drupal/KernelTests/Core/Config/ConfigFileContentTest.php +++ b/core/tests/Drupal/KernelTests/Core/Config/ConfigFileContentTest.php @@ -210,22 +210,22 @@ public function testSerialization() { $config_parsed = $filestorage->read($name); $key = 'numeric keys'; - $this->assertIdentical($config_data[$key], $config_parsed[$key]); + $this->assertSame($config_data[$key], $config_parsed[$key]); $key = 'nested keys'; - $this->assertIdentical($config_data[$key], $config_parsed[$key]); + $this->assertSame($config_data[$key], $config_parsed[$key]); $key = 'HTML'; - $this->assertIdentical($config_data['nested keys'][$key], $config_parsed['nested keys'][$key]); + $this->assertSame($config_data['nested keys'][$key], $config_parsed['nested keys'][$key]); $key = 'UTF-8'; - $this->assertIdentical($config_data['nested keys'][$key], $config_parsed['nested keys'][$key]); + $this->assertSame($config_data['nested keys'][$key], $config_parsed['nested keys'][$key]); $key = 'ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΣὨ'; - $this->assertIdentical($config_data['nested keys'][$key], $config_parsed['nested keys'][$key]); + $this->assertSame($config_data['nested keys'][$key], $config_parsed['nested keys'][$key]); $key = 'invalid xml'; - $this->assertIdentical($config_data[$key], $config_parsed[$key]); + $this->assertSame($config_data[$key], $config_parsed[$key]); } } diff --git a/core/tests/Drupal/KernelTests/Core/Config/ConfigImportRecreateTest.php b/core/tests/Drupal/KernelTests/Core/Config/ConfigImportRecreateTest.php index 0523ee8..c69f9fe 100644 --- a/core/tests/Drupal/KernelTests/Core/Config/ConfigImportRecreateTest.php +++ b/core/tests/Drupal/KernelTests/Core/Config/ConfigImportRecreateTest.php @@ -92,7 +92,7 @@ public function testRecreateEntity() { $this->assertEqual(5, count($creates), 'There are 5 configuration items to create.'); $this->assertEqual(5, count($deletes), 'There are 5 configuration items to delete.'); $this->assertEqual(0, count($this->configImporter->getUnprocessedConfiguration('update')), 'There are no configuration items to update.'); - $this->assertIdentical($creates, array_reverse($deletes), 'Deletes and creates contain the same configuration names in opposite orders due to dependencies.'); + $this->assertSame($creates, array_reverse($deletes), 'Deletes and creates contain the same configuration names in opposite orders due to dependencies.'); $this->configImporter->import(); diff --git a/core/tests/Drupal/KernelTests/Core/Config/ConfigImportRenameValidationTest.php b/core/tests/Drupal/KernelTests/Core/Config/ConfigImportRenameValidationTest.php index e755d5f..cbb2e95 100644 --- a/core/tests/Drupal/KernelTests/Core/Config/ConfigImportRenameValidationTest.php +++ b/core/tests/Drupal/KernelTests/Core/Config/ConfigImportRenameValidationTest.php @@ -95,7 +95,7 @@ public function testRenameValidation() { 'node.type.' . $content_type->id() . '::config_test.dynamic.' . $test_entity_id, ]; $renames = $this->configImporter->getUnprocessedConfiguration('rename'); - $this->assertIdentical($expected, $renames); + $this->assertSame($expected, $renames); // Try to import the configuration. We expect an exception to be thrown // because the staged entity is of a different type. @@ -138,7 +138,7 @@ public function testRenameSimpleConfigValidation() { 'config_test.old::config_test.new' ]; $renames = $this->configImporter->getUnprocessedConfiguration('rename'); - $this->assertIdentical($expected, $renames); + $this->assertSame($expected, $renames); // Try to import the configuration. We expect an exception to be thrown // because the rename is for simple configuration. diff --git a/core/tests/Drupal/KernelTests/Core/Config/ConfigImporterTest.php b/core/tests/Drupal/KernelTests/Core/Config/ConfigImporterTest.php index 0ecc38c..9d3989c 100644 --- a/core/tests/Drupal/KernelTests/Core/Config/ConfigImporterTest.php +++ b/core/tests/Drupal/KernelTests/Core/Config/ConfigImporterTest.php @@ -351,7 +351,7 @@ public function testSecondaryUpdateDeletedDeleterFirst() { $name_deletee, $name_other, ]; - $this->assertIdentical($expected, $updates); + $this->assertSame($expected, $updates); // Import. $this->configImporter->import(); diff --git a/core/tests/Drupal/KernelTests/Core/Config/ConfigInstallTest.php b/core/tests/Drupal/KernelTests/Core/Config/ConfigInstallTest.php index 8ba0ae1..9e473c2 100644 --- a/core/tests/Drupal/KernelTests/Core/Config/ConfigInstallTest.php +++ b/core/tests/Drupal/KernelTests/Core/Config/ConfigInstallTest.php @@ -146,7 +146,7 @@ public function testCollectionInstallationCollections() { $this->assertEqual($collections, $active_storage->getAllCollectionNames()); $collection_storage = $active_storage->createCollection('entity'); $data = $collection_storage->read('config_test.dynamic.dotted.default'); - $this->assertIdentical(['label' => 'entity'], $data); + $this->assertSame(['label' => 'entity'], $data); // Test that the config manager uninstalls configuration from collections // as expected. @@ -185,7 +185,7 @@ public function testCollectionInstallationCollectionConfigEntity() { $data = $active_storage->read($name); $this->assertTrue(isset($data['uuid'])); $data = $collection_storage->read($name); - $this->assertIdentical(['label' => 'entity'], $data); + $this->assertSame(['label' => 'entity'], $data); } /** @@ -227,7 +227,7 @@ public function testDependencyChecking() { $this->assertTrue($entity, 'The config_test.dynamic.other_module_test_with_dependency configuration has been created during install.'); // Ensure that dependencies can be added during module installation by // hooks. - $this->assertIdentical('config_install_dependency_test', $entity->getDependencies()['module'][0]); + $this->assertSame('config_install_dependency_test', $entity->getDependencies()['module'][0]); } /** diff --git a/core/tests/Drupal/KernelTests/Core/Config/ConfigSchemaTest.php b/core/tests/Drupal/KernelTests/Core/Config/ConfigSchemaTest.php index e2e02e1..b3dab6d 100644 --- a/core/tests/Drupal/KernelTests/Core/Config/ConfigSchemaTest.php +++ b/core/tests/Drupal/KernelTests/Core/Config/ConfigSchemaTest.php @@ -40,7 +40,7 @@ protected function setUp() { */ public function testSchemaMapping() { // Nonexistent configuration key will have Undefined as metadata. - $this->assertIdentical(FALSE, \Drupal::service('config.typed')->hasConfigSchema('config_schema_test.no_such_key')); + $this->assertSame(FALSE, \Drupal::service('config.typed')->hasConfigSchema('config_schema_test.no_such_key')); $definition = \Drupal::service('config.typed')->getDefinition('config_schema_test.no_such_key'); $expected = []; $expected['label'] = 'Undefined'; @@ -51,12 +51,12 @@ public function testSchemaMapping() { $this->assertEqual($definition, $expected, 'Retrieved the right metadata for nonexistent configuration.'); // Configuration file without schema will return Undefined as well. - $this->assertIdentical(FALSE, \Drupal::service('config.typed')->hasConfigSchema('config_schema_test.noschema')); + $this->assertSame(FALSE, \Drupal::service('config.typed')->hasConfigSchema('config_schema_test.noschema')); $definition = \Drupal::service('config.typed')->getDefinition('config_schema_test.noschema'); $this->assertEqual($definition, $expected, 'Retrieved the right metadata for configuration with no schema.'); // Configuration file with only some schema. - $this->assertIdentical(TRUE, \Drupal::service('config.typed')->hasConfigSchema('config_schema_test.someschema')); + $this->assertSame(TRUE, \Drupal::service('config.typed')->hasConfigSchema('config_schema_test.someschema')); $definition = \Drupal::service('config.typed')->getDefinition('config_schema_test.someschema'); $expected = []; $expected['label'] = 'Schema test data'; @@ -505,7 +505,7 @@ public function testSchemaFallback() { $definition2 = \Drupal::service('config.typed')->getDefinition('config_schema_test.wildcard_fallback.something.something'); // This should be the schema of config_schema_test.wildcard_fallback.* as //well. - $this->assertIdentical($definition, $definition2); + $this->assertSame($definition, $definition2); } /** diff --git a/core/tests/Drupal/KernelTests/Core/Config/Storage/ConfigStorageTestBase.php b/core/tests/Drupal/KernelTests/Core/Config/Storage/ConfigStorageTestBase.php index 54d0164..5bdbc74 100644 --- a/core/tests/Drupal/KernelTests/Core/Config/Storage/ConfigStorageTestBase.php +++ b/core/tests/Drupal/KernelTests/Core/Config/Storage/ConfigStorageTestBase.php @@ -189,7 +189,7 @@ public function testCollection() { $data = ['foo' => 'bar']; $result = $this->storage->write($name, $data); $this->assertIdentical($result, TRUE); - $this->assertIdentical($data, $this->storage->read($name)); + $this->assertSame($data, $this->storage->read($name)); // Create configuration in a new collection. $new_storage = $this->storage->createCollection('collection.sub.new'); @@ -197,13 +197,13 @@ public function testCollection() { $this->assertEqual([], $new_storage->listAll()); $new_storage->write($name, $data); $this->assertIdentical($result, TRUE); - $this->assertIdentical($data, $new_storage->read($name)); + $this->assertSame($data, $new_storage->read($name)); $this->assertEqual([$name], $new_storage->listAll()); $this->assertTrue($new_storage->exists($name)); $new_data = ['foo' => 'baz']; $new_storage->write($name, $new_data); $this->assertIdentical($result, TRUE); - $this->assertIdentical($new_data, $new_storage->read($name)); + $this->assertSame($new_data, $new_storage->read($name)); // Create configuration in another collection. $another_storage = $this->storage->createCollection('collection.sub.another'); @@ -211,7 +211,7 @@ public function testCollection() { $this->assertEqual([], $another_storage->listAll()); $another_storage->write($name, $new_data); $this->assertIdentical($result, TRUE); - $this->assertIdentical($new_data, $another_storage->read($name)); + $this->assertSame($new_data, $another_storage->read($name)); $this->assertEqual([$name], $another_storage->listAll()); $this->assertTrue($another_storage->exists($name)); @@ -219,18 +219,18 @@ public function testCollection() { $alt_storage = $this->storage->createCollection('alternate'); $alt_storage->write($name, $new_data); $this->assertIdentical($result, TRUE); - $this->assertIdentical($new_data, $alt_storage->read($name)); + $this->assertSame($new_data, $alt_storage->read($name)); // Switch back to the collection-less mode and check the data still exists // add has not been touched. - $this->assertIdentical($data, $this->storage->read($name)); + $this->assertSame($data, $this->storage->read($name)); // Check that the getAllCollectionNames() method works. - $this->assertIdentical(['alternate', 'collection.sub.another', 'collection.sub.new'], $this->storage->getAllCollectionNames()); + $this->assertSame(['alternate', 'collection.sub.another', 'collection.sub.new'], $this->storage->getAllCollectionNames()); // Check that the collections are removed when they are empty. $alt_storage->delete($name); - $this->assertIdentical(['collection.sub.another', 'collection.sub.new'], $this->storage->getAllCollectionNames()); + $this->assertSame(['collection.sub.another', 'collection.sub.new'], $this->storage->getAllCollectionNames()); // Create configuration in collection called 'collection'. This ensures that // FileStorage's collection storage works regardless of its use of @@ -240,19 +240,19 @@ public function testCollection() { $this->assertEqual([], $parent_storage->listAll()); $parent_storage->write($name, $new_data); $this->assertIdentical($result, TRUE); - $this->assertIdentical($new_data, $parent_storage->read($name)); + $this->assertSame($new_data, $parent_storage->read($name)); $this->assertEqual([$name], $parent_storage->listAll()); $this->assertTrue($parent_storage->exists($name)); - $this->assertIdentical(['collection', 'collection.sub.another', 'collection.sub.new'], $this->storage->getAllCollectionNames()); + $this->assertSame(['collection', 'collection.sub.another', 'collection.sub.new'], $this->storage->getAllCollectionNames()); $parent_storage->deleteAll(); - $this->assertIdentical(['collection.sub.another', 'collection.sub.new'], $this->storage->getAllCollectionNames()); + $this->assertSame(['collection.sub.another', 'collection.sub.new'], $this->storage->getAllCollectionNames()); // Check that the having an empty collection-less storage does not break // anything. Before deleting check that the previous delete did not affect // data in another collection. - $this->assertIdentical($data, $this->storage->read($name)); + $this->assertSame($data, $this->storage->read($name)); $this->storage->delete($name); - $this->assertIdentical(['collection.sub.another', 'collection.sub.new'], $this->storage->getAllCollectionNames()); + $this->assertSame(['collection.sub.another', 'collection.sub.new'], $this->storage->getAllCollectionNames()); } abstract protected function read($name); diff --git a/core/tests/Drupal/KernelTests/Core/Config/Storage/FileStorageTest.php b/core/tests/Drupal/KernelTests/Core/Config/Storage/FileStorageTest.php index 23bd5ea..805af8a 100644 --- a/core/tests/Drupal/KernelTests/Core/Config/Storage/FileStorageTest.php +++ b/core/tests/Drupal/KernelTests/Core/Config/Storage/FileStorageTest.php @@ -68,8 +68,8 @@ public function testlistAll() { // @todo https://www.drupal.org/node/2666954 FileStorage::listAll() is // case-sensitive. However, \Drupal\Core\Config\DatabaseStorage::listAll() // is case-insensitive. - $this->assertIdentical(['system.performance'], $this->storage->listAll('system'), 'The FileStorage::listAll() with prefix works.'); - $this->assertIdentical([], $this->storage->listAll('System'), 'The FileStorage::listAll() is case sensitive.'); + $this->assertSame(['system.performance'], $this->storage->listAll('system'), 'The FileStorage::listAll() with prefix works.'); + $this->assertSame([], $this->storage->listAll('System'), 'The FileStorage::listAll() is case sensitive.'); } /** diff --git a/core/tests/Drupal/KernelTests/Core/Database/CaseSensitivityTest.php b/core/tests/Drupal/KernelTests/Core/Database/CaseSensitivityTest.php index c3e766f..abd9d4c 100644 --- a/core/tests/Drupal/KernelTests/Core/Database/CaseSensitivityTest.php +++ b/core/tests/Drupal/KernelTests/Core/Database/CaseSensitivityTest.php @@ -23,7 +23,7 @@ public function testCaseSensitiveInsert() { ->execute(); $num_records_after = db_query('SELECT COUNT(*) FROM {test}')->fetchField(); - $this->assertIdentical($num_records_before + 1, (int) $num_records_after, 'Record inserts correctly.'); + $this->assertSame($num_records_before + 1, (int) $num_records_after, 'Record inserts correctly.'); $saved_age = db_query('SELECT age FROM {test} WHERE name = :name', [':name' => 'john'])->fetchField(); $this->assertIdentical($saved_age, '2', 'Can retrieve after inserting.'); } diff --git a/core/tests/Drupal/KernelTests/Core/Database/ConnectionTest.php b/core/tests/Drupal/KernelTests/Core/Database/ConnectionTest.php index e95afe0..4741967 100644 --- a/core/tests/Drupal/KernelTests/Core/Database/ConnectionTest.php +++ b/core/tests/Drupal/KernelTests/Core/Database/ConnectionTest.php @@ -32,18 +32,18 @@ public function testConnectionRouting() { // Try to open those targets another time, that should return the same objects. $db1b = Database::getConnection('default', 'default'); $db2b = Database::getConnection('replica', 'default'); - $this->assertIdentical($db1, $db1b, 'A second call to getConnection() returns the same object.'); - $this->assertIdentical($db2, $db2b, 'A second call to getConnection() returns the same object.'); + $this->assertSame($db1, $db1b, 'A second call to getConnection() returns the same object.'); + $this->assertSame($db2, $db2b, 'A second call to getConnection() returns the same object.'); // Try to open an unknown target. $unknown_target = $this->randomMachineName(); $db3 = Database::getConnection($unknown_target, 'default'); $this->assertNotNull($db3, 'Opening an unknown target returns a real connection object.'); - $this->assertIdentical($db1, $db3, 'An unknown target opens the default connection.'); + $this->assertSame($db1, $db3, 'An unknown target opens the default connection.'); // Try to open that unknown target another time, that should return the same object. $db3b = Database::getConnection($unknown_target, 'default'); - $this->assertIdentical($db3, $db3b, 'A second call to getConnection() returns the same object.'); + $this->assertSame($db3, $db3b, 'A second call to getConnection() returns the same object.'); } /** @@ -61,7 +61,7 @@ public function testConnectionRoutingOverride() { $db1 = Database::getConnection('default', 'default'); $db2 = Database::getConnection('replica', 'default'); - $this->assertIdentical($db1, $db2, 'Both targets refer to the same connection.'); + $this->assertSame($db1, $db2, 'Both targets refer to the same connection.'); } /** @@ -103,7 +103,7 @@ public function testConnectionOptions() { // Get a fresh copy of the default connection options. $connectionOptions = $db->getConnectionOptions(); - $this->assertIdentical($connectionOptions, $connectionOptions2, 'The default and replica connection options are identical.'); + $this->assertSame($connectionOptions, $connectionOptions2, 'The default and replica connection options are identical.'); // Set up a new connection with different connection info. $test = $connection_info['default']; diff --git a/core/tests/Drupal/KernelTests/Core/Database/InsertDefaultsTest.php b/core/tests/Drupal/KernelTests/Core/Database/InsertDefaultsTest.php index 5b6c03e..b5963cf 100644 --- a/core/tests/Drupal/KernelTests/Core/Database/InsertDefaultsTest.php +++ b/core/tests/Drupal/KernelTests/Core/Database/InsertDefaultsTest.php @@ -40,7 +40,7 @@ public function testDefaultEmptyInsert() { } $num_records_after = (int) db_query('SELECT COUNT(*) FROM {test}')->fetchField(); - $this->assertIdentical($num_records_before, $num_records_after, 'Do nothing as no fields are specified.'); + $this->assertSame($num_records_before, $num_records_after, 'Do nothing as no fields are specified.'); } /** diff --git a/core/tests/Drupal/KernelTests/Core/Database/InsertTest.php b/core/tests/Drupal/KernelTests/Core/Database/InsertTest.php index 1c2c21d..dc5f075 100644 --- a/core/tests/Drupal/KernelTests/Core/Database/InsertTest.php +++ b/core/tests/Drupal/KernelTests/Core/Database/InsertTest.php @@ -26,7 +26,7 @@ public function testSimpleInsert() { $query->execute(); $num_records_after = db_query('SELECT COUNT(*) FROM {test}')->fetchField(); - $this->assertIdentical($num_records_before + 1, (int) $num_records_after, 'Record inserts correctly.'); + $this->assertSame($num_records_before + 1, (int) $num_records_after, 'Record inserts correctly.'); $saved_age = db_query('SELECT age FROM {test} WHERE name = :name', [':name' => 'Yoko'])->fetchField(); $this->assertIdentical($saved_age, '29', 'Can retrieve after inserting.'); } @@ -61,7 +61,7 @@ public function testMultiInsert() { $query->execute(); $num_records_after = (int) db_query('SELECT COUNT(*) FROM {test}')->fetchField(); - $this->assertIdentical($num_records_before + 3, $num_records_after, 'Record inserts correctly.'); + $this->assertSame($num_records_before + 3, $num_records_after, 'Record inserts correctly.'); $saved_age = db_query('SELECT age FROM {test} WHERE name = :name', [':name' => 'Larry'])->fetchField(); $this->assertIdentical($saved_age, '30', 'Can retrieve after inserting.'); $saved_age = db_query('SELECT age FROM {test} WHERE name = :name', [':name' => 'Curly'])->fetchField(); @@ -103,7 +103,7 @@ public function testRepeatedInsert() { $query->execute(); $num_records_after = db_query('SELECT COUNT(*) FROM {test}')->fetchField(); - $this->assertIdentical((int) $num_records_before + 3, (int) $num_records_after, 'Record inserts correctly.'); + $this->assertSame((int) $num_records_before + 3, (int) $num_records_after, 'Record inserts correctly.'); $saved_age = db_query('SELECT age FROM {test} WHERE name = :name', [':name' => 'Larry'])->fetchField(); $this->assertIdentical($saved_age, '30', 'Can retrieve after inserting.'); $saved_age = db_query('SELECT age FROM {test} WHERE name = :name', [':name' => 'Curly'])->fetchField(); diff --git a/core/tests/Drupal/KernelTests/Core/Database/RegressionTest.php b/core/tests/Drupal/KernelTests/Core/Database/RegressionTest.php index db4c7de..66eed0a 100644 --- a/core/tests/Drupal/KernelTests/Core/Database/RegressionTest.php +++ b/core/tests/Drupal/KernelTests/Core/Database/RegressionTest.php @@ -30,31 +30,31 @@ public function testRegression_310447() { ])->execute(); $from_database = db_query('SELECT job FROM {test} WHERE job = :job', [':job' => $job])->fetchField(); - $this->assertIdentical($job, $from_database, 'The database handles UTF-8 characters cleanly.'); + $this->assertSame($job, $from_database, 'The database handles UTF-8 characters cleanly.'); } /** * Tests the db_table_exists() function. */ public function testDBTableExists() { - $this->assertIdentical(TRUE, db_table_exists('test'), 'Returns true for existent table.'); - $this->assertIdentical(FALSE, db_table_exists('nosuchtable'), 'Returns false for nonexistent table.'); + $this->assertSame(TRUE, db_table_exists('test'), 'Returns true for existent table.'); + $this->assertSame(FALSE, db_table_exists('nosuchtable'), 'Returns false for nonexistent table.'); } /** * Tests the db_field_exists() function. */ public function testDBFieldExists() { - $this->assertIdentical(TRUE, db_field_exists('test', 'name'), 'Returns true for existent column.'); - $this->assertIdentical(FALSE, db_field_exists('test', 'nosuchcolumn'), 'Returns false for nonexistent column.'); + $this->assertSame(TRUE, db_field_exists('test', 'name'), 'Returns true for existent column.'); + $this->assertSame(FALSE, db_field_exists('test', 'nosuchcolumn'), 'Returns false for nonexistent column.'); } /** * Tests the db_index_exists() function. */ public function testDBIndexExists() { - $this->assertIdentical(TRUE, db_index_exists('test', 'ages'), 'Returns true for existent index.'); - $this->assertIdentical(FALSE, db_index_exists('test', 'nosuchindex'), 'Returns false for nonexistent index.'); + $this->assertSame(TRUE, db_index_exists('test', 'ages'), 'Returns true for existent index.'); + $this->assertSame(FALSE, db_index_exists('test', 'nosuchindex'), 'Returns false for nonexistent index.'); } } diff --git a/core/tests/Drupal/KernelTests/Core/DrupalKernel/DrupalKernelTest.php b/core/tests/Drupal/KernelTests/Core/DrupalKernel/DrupalKernelTest.php index 722bdd2..b5cb96b 100644 --- a/core/tests/Drupal/KernelTests/Core/DrupalKernel/DrupalKernelTest.php +++ b/core/tests/Drupal/KernelTests/Core/DrupalKernel/DrupalKernelTest.php @@ -137,7 +137,7 @@ public function testCompileDIC() { // Check that the container itself is not among the persist IDs because it // does not make sense to persist the container itself. $persist_ids = $container->getParameter('persist_ids'); - $this->assertIdentical(FALSE, array_search('service_container', $persist_ids)); + $this->assertSame(FALSE, array_search('service_container', $persist_ids)); } /** diff --git a/core/tests/Drupal/KernelTests/Core/Entity/ConfigEntityQueryTest.php b/core/tests/Drupal/KernelTests/Core/Entity/ConfigEntityQueryTest.php index 56050a7..ecac11d 100644 --- a/core/tests/Drupal/KernelTests/Core/Entity/ConfigEntityQueryTest.php +++ b/core/tests/Drupal/KernelTests/Core/Entity/ConfigEntityQueryTest.php @@ -403,7 +403,7 @@ public function testCount() { $count = $this->factory->get('config_query_test') ->count() ->execute(); - $this->assertIdentical($count, count($this->entities)); + $this->assertSame($count, count($this->entities)); // Test count on a complex query. $query = $this->factory->get('config_query_test', 'OR'); diff --git a/core/tests/Drupal/KernelTests/Core/Entity/ContentEntityNullStorageTest.php b/core/tests/Drupal/KernelTests/Core/Entity/ContentEntityNullStorageTest.php index 697f1be..6da9bb3 100644 --- a/core/tests/Drupal/KernelTests/Core/Entity/ContentEntityNullStorageTest.php +++ b/core/tests/Drupal/KernelTests/Core/Entity/ContentEntityNullStorageTest.php @@ -30,10 +30,10 @@ class ContentEntityNullStorageTest extends KernelTestBase { * @see \Drupal\Core\Entity\Query\Null\Query */ public function testEntityQuery() { - $this->assertIdentical(0, \Drupal::entityQuery('contact_message')->count()->execute(), 'Counting a null storage returns 0.'); - $this->assertIdentical([], \Drupal::entityQuery('contact_message')->execute(), 'Querying a null storage returns an empty array.'); - $this->assertIdentical([], \Drupal::entityQuery('contact_message')->condition('contact_form', 'test')->execute(), 'Querying a null storage returns an empty array and conditions are ignored.'); - $this->assertIdentical([], \Drupal::entityQueryAggregate('contact_message')->aggregate('name', 'AVG')->execute(), 'Aggregate querying a null storage returns an empty array'); + $this->assertSame(0, \Drupal::entityQuery('contact_message')->count()->execute(), 'Counting a null storage returns 0.'); + $this->assertSame([], \Drupal::entityQuery('contact_message')->execute(), 'Querying a null storage returns an empty array.'); + $this->assertSame([], \Drupal::entityQuery('contact_message')->condition('contact_form', 'test')->execute(), 'Querying a null storage returns an empty array and conditions are ignored.'); + $this->assertSame([], \Drupal::entityQueryAggregate('contact_message')->aggregate('name', 'AVG')->execute(), 'Aggregate querying a null storage returns an empty array'); } diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityAutocompleteTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityAutocompleteTest.php index ca65eb8..c8fc036 100644 --- a/core/tests/Drupal/KernelTests/Core/Entity/EntityAutocompleteTest.php +++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityAutocompleteTest.php @@ -66,8 +66,8 @@ public function testEntityReferenceAutocompletion() { // We should get both entities in a JSON encoded string. $input = '10/'; $data = $this->getAutocompleteResult($input); - $this->assertIdentical($data[0]['label'], Html::escape($entity_1->name->value), 'Autocomplete returned the first matching entity'); - $this->assertIdentical($data[1]['label'], Html::escape($entity_2->name->value), 'Autocomplete returned the second matching entity'); + $this->assertSame($data[0]['label'], Html::escape($entity_1->name->value), 'Autocomplete returned the first matching entity'); + $this->assertSame($data[1]['label'], Html::escape($entity_2->name->value), 'Autocomplete returned the second matching entity'); // Try to autocomplete a entity label that matches the first entity. // We should only get the first entity in a JSON encoded string. @@ -77,13 +77,13 @@ public function testEntityReferenceAutocompletion() { 'value' => $entity_1->name->value . ' (1)', 'label' => Html::escape($entity_1->name->value), ]; - $this->assertIdentical(reset($data), $target, 'Autocomplete returns only the expected matching entity.'); + $this->assertSame(reset($data), $target, 'Autocomplete returns only the expected matching entity.'); // Try to autocomplete a entity label that matches the second entity, and // the first entity is already typed in the autocomplete (tags) widget. $input = $entity_1->name->value . ' (1), 10/17'; $data = $this->getAutocompleteResult($input); - $this->assertIdentical($data[0]['label'], Html::escape($entity_2->name->value), 'Autocomplete returned the second matching entity'); + $this->assertSame($data[0]['label'], Html::escape($entity_2->name->value), 'Autocomplete returned the second matching entity'); // Try to autocomplete a entity label with both a comma, a slash and markup. $input = '"label with, and /"'; @@ -95,7 +95,7 @@ public function testEntityReferenceAutocompletion() { 'value' => $n, 'label' => Html::escape($entity_3->name->value), ]; - $this->assertIdentical(reset($data), $target, 'Autocomplete returns an entity label containing a comma and a slash.'); + $this->assertSame(reset($data), $target, 'Autocomplete returns an entity label containing a comma and a slash.'); } /** diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityFieldTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityFieldTest.php index 12c4c75..31b1f9e 100644 --- a/core/tests/Drupal/KernelTests/Core/Entity/EntityFieldTest.php +++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityFieldTest.php @@ -472,30 +472,30 @@ protected function doTestIntrospection($entity_type) { // Make sure provided contextual information is right. $entity_adapter = $entity->getTypedData(); - $this->assertIdentical($entity_adapter->getRoot(), $entity_adapter, 'Entity is root object.'); + $this->assertSame($entity_adapter->getRoot(), $entity_adapter, 'Entity is root object.'); $this->assertEqual($entity_adapter->getPropertyPath(), ''); $this->assertEqual($entity_adapter->getName(), ''); $this->assertEqual($entity_adapter->getParent(), NULL); $field = $entity->user_id; - $this->assertIdentical($field->getRoot()->getValue(), $entity, 'Entity is root object.'); - $this->assertIdentical($field->getEntity(), $entity, 'getEntity() returns the entity.'); + $this->assertSame($field->getRoot()->getValue(), $entity, 'Entity is root object.'); + $this->assertSame($field->getEntity(), $entity, 'getEntity() returns the entity.'); $this->assertEqual($field->getPropertyPath(), 'user_id'); $this->assertEqual($field->getName(), 'user_id'); - $this->assertIdentical($field->getParent()->getValue(), $entity, 'Parent object matches.'); + $this->assertSame($field->getParent()->getValue(), $entity, 'Parent object matches.'); $field_item = $field[0]; - $this->assertIdentical($field_item->getRoot()->getValue(), $entity, 'Entity is root object.'); - $this->assertIdentical($field_item->getEntity(), $entity, 'getEntity() returns the entity.'); + $this->assertSame($field_item->getRoot()->getValue(), $entity, 'Entity is root object.'); + $this->assertSame($field_item->getEntity(), $entity, 'getEntity() returns the entity.'); $this->assertEqual($field_item->getPropertyPath(), 'user_id.0'); $this->assertEqual($field_item->getName(), '0'); - $this->assertIdentical($field_item->getParent(), $field, 'Parent object matches.'); + $this->assertSame($field_item->getParent(), $field, 'Parent object matches.'); $item_value = $field_item->get('entity'); - $this->assertIdentical($item_value->getRoot()->getValue(), $entity, 'Entity is root object.'); + $this->assertSame($item_value->getRoot()->getValue(), $entity, 'Entity is root object.'); $this->assertEqual($item_value->getPropertyPath(), 'user_id.0.entity'); $this->assertEqual($item_value->getName(), 'entity'); - $this->assertIdentical($item_value->getParent(), $field_item, 'Parent object matches.'); + $this->assertSame($item_value->getParent(), $field_item, 'Parent object matches.'); } /** diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityTranslationTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityTranslationTest.php index fe8bcc0..bcd702a 100644 --- a/core/tests/Drupal/KernelTests/Core/Entity/EntityTranslationTest.php +++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityTranslationTest.php @@ -341,12 +341,12 @@ protected function doTestEntityTranslationAPI($entity_type) { // retrieve a translation referring to it. $translation = $entity->getTranslation(LanguageInterface::LANGCODE_NOT_SPECIFIED); $this->assertFalse($translation->isNewTranslation(), 'Existing translations are not marked as new.'); - $this->assertIdentical($entity, $translation, 'The translation object corresponding to a non-default language is the entity object itself when the entity is language-neutral.'); + $this->assertSame($entity, $translation, 'The translation object corresponding to a non-default language is the entity object itself when the entity is language-neutral.'); $entity->{$langcode_key}->value = $default_langcode; $translation = $entity->getTranslation($default_langcode); - $this->assertIdentical($entity, $translation, 'The translation object corresponding to the default language (explicit) is the entity object itself.'); + $this->assertSame($entity, $translation, 'The translation object corresponding to the default language (explicit) is the entity object itself.'); $translation = $entity->getTranslation(LanguageInterface::LANGCODE_DEFAULT); - $this->assertIdentical($entity, $translation, 'The translation object corresponding to the default language (implicit) is the entity object itself.'); + $this->assertSame($entity, $translation, 'The translation object corresponding to the default language (implicit) is the entity object itself.'); $this->assertTrue($entity->{$default_langcode_key}->value, 'The translation object is the default one.'); // Verify that trying to retrieve a translation for a locked language when @@ -657,7 +657,7 @@ protected function doTestLanguageFallback($entity_type) { $translation = $this->entityManager->getTranslationFromContext($entity2, $default_langcode); $translation_build = $controller->view($translation); $translation_output = (string) $renderer->renderRoot($translation_build); - $this->assertIdentical($entity2_output, $translation_output, 'When the entity has no translation no fallback is applied.'); + $this->assertSame($entity2_output, $translation_output, 'When the entity has no translation no fallback is applied.'); // Checks that entity translations are rendered properly. $controller = $this->entityManager->getViewBuilder($entity_type); diff --git a/core/tests/Drupal/KernelTests/Core/EventSubscriber/IgnoreReplicaSubscriberTest.php b/core/tests/Drupal/KernelTests/Core/EventSubscriber/IgnoreReplicaSubscriberTest.php index 4206cea..7ce994a 100644 --- a/core/tests/Drupal/KernelTests/Core/EventSubscriber/IgnoreReplicaSubscriberTest.php +++ b/core/tests/Drupal/KernelTests/Core/EventSubscriber/IgnoreReplicaSubscriberTest.php @@ -37,7 +37,7 @@ public function testSystemInitIgnoresSecondaries() { $db1 = Database::getConnection('default', 'default'); $db2 = Database::getConnection('replica', 'default'); - $this->assertIdentical($db1, $db2, 'System Init ignores secondaries when requested.'); + $this->assertSame($db1, $db2, 'System Init ignores secondaries when requested.'); } } diff --git a/core/tests/Drupal/KernelTests/Core/File/NameMungingTest.php b/core/tests/Drupal/KernelTests/Core/File/NameMungingTest.php index 422f294..2e5d094 100644 --- a/core/tests/Drupal/KernelTests/Core/File/NameMungingTest.php +++ b/core/tests/Drupal/KernelTests/Core/File/NameMungingTest.php @@ -59,7 +59,7 @@ public function testMungeNullByte() { public function testMungeIgnoreInsecure() { $this->config('system.file')->set('allow_insecure_uploads', 1)->save(); $munged_name = file_munge_filename($this->name, ''); - $this->assertIdentical($munged_name, $this->name, format_string('The original filename (%original) matches the munged filename (%munged) when insecure uploads are enabled.', ['%munged' => $munged_name, '%original' => $this->name])); + $this->assertSame($munged_name, $this->name, format_string('The original filename (%original) matches the munged filename (%munged) when insecure uploads are enabled.', ['%munged' => $munged_name, '%original' => $this->name])); } /** @@ -69,10 +69,10 @@ public function testMungeIgnoreWhitelisted() { // Declare our extension as whitelisted. The declared extensions should // be case insensitive so test using one with a different case. $munged_name = file_munge_filename($this->nameWithUcExt, $this->badExtension); - $this->assertIdentical($munged_name, $this->nameWithUcExt, format_string('The new filename (%munged) matches the original (%original) once the extension has been whitelisted.', ['%munged' => $munged_name, '%original' => $this->nameWithUcExt])); + $this->assertSame($munged_name, $this->nameWithUcExt, format_string('The new filename (%munged) matches the original (%original) once the extension has been whitelisted.', ['%munged' => $munged_name, '%original' => $this->nameWithUcExt])); // The allowed extensions should also be normalized. $munged_name = file_munge_filename($this->name, strtoupper($this->badExtension)); - $this->assertIdentical($munged_name, $this->name, format_string('The new filename (%munged) matches the original (%original) also when the whitelisted extension is in uppercase.', ['%munged' => $munged_name, '%original' => $this->name])); + $this->assertSame($munged_name, $this->name, format_string('The new filename (%munged) matches the original (%original) also when the whitelisted extension is in uppercase.', ['%munged' => $munged_name, '%original' => $this->name])); } /** @@ -81,7 +81,7 @@ public function testMungeIgnoreWhitelisted() { public function testUnMunge() { $munged_name = file_munge_filename($this->name, '', FALSE); $unmunged_name = file_unmunge_filename($munged_name); - $this->assertIdentical($unmunged_name, $this->name, format_string('The unmunged (%unmunged) filename matches the original (%original)', ['%unmunged' => $unmunged_name, '%original' => $this->name])); + $this->assertSame($unmunged_name, $this->name, format_string('The unmunged (%unmunged) filename matches the original (%original)', ['%unmunged' => $unmunged_name, '%original' => $this->name])); } } diff --git a/core/tests/Drupal/KernelTests/Core/File/UrlRewritingTest.php b/core/tests/Drupal/KernelTests/Core/File/UrlRewritingTest.php index 35d2ca0..bdf66bd 100644 --- a/core/tests/Drupal/KernelTests/Core/File/UrlRewritingTest.php +++ b/core/tests/Drupal/KernelTests/Core/File/UrlRewritingTest.php @@ -106,13 +106,13 @@ public function testRelativeFileURL() { // Shipped file. $filepath = 'core/assets/vendor/jquery/jquery.min.js'; $url = file_create_url($filepath); - $this->assertIdentical(base_path() . $filepath, file_url_transform_relative($url)); + $this->assertSame(base_path() . $filepath, file_url_transform_relative($url)); // Managed file. $uri = $this->createUri(); $url = file_create_url($uri); $public_directory_path = \Drupal::service('stream_wrapper_manager')->getViaScheme('public')->getDirectoryPath(); - $this->assertIdentical(base_path() . $public_directory_path . '/' . rawurlencode(drupal_basename($uri)), file_url_transform_relative($url)); + $this->assertSame(base_path() . $public_directory_path . '/' . rawurlencode(drupal_basename($uri)), file_url_transform_relative($url)); } } diff --git a/core/tests/Drupal/KernelTests/Core/KeyValueStore/DatabaseStorageExpirableTest.php b/core/tests/Drupal/KernelTests/Core/KeyValueStore/DatabaseStorageExpirableTest.php index 2d543cb..26a1abe 100644 --- a/core/tests/Drupal/KernelTests/Core/KeyValueStore/DatabaseStorageExpirableTest.php +++ b/core/tests/Drupal/KernelTests/Core/KeyValueStore/DatabaseStorageExpirableTest.php @@ -78,7 +78,7 @@ public function testCRUDWithExpiration() { // Ensure that an item with the same name exists in the other collection. $stores[1]->set('foo', $this->objects[5]); $result = $stores[0]->getAll(); - // Not using assertIdentical(), since the order is not defined for getAll(). + // Not using assertSame(), since the order is not defined for getAll(). $this->assertEqual(count($result), count($values)); foreach ($result as $key => $value) { $this->assertEqual($values[$key], $value); diff --git a/core/tests/Drupal/KernelTests/Core/KeyValueStore/StorageTestBase.php b/core/tests/Drupal/KernelTests/Core/KeyValueStore/StorageTestBase.php index 7651234..48af84d 100644 --- a/core/tests/Drupal/KernelTests/Core/KeyValueStore/StorageTestBase.php +++ b/core/tests/Drupal/KernelTests/Core/KeyValueStore/StorageTestBase.php @@ -102,7 +102,7 @@ public function testCRUD() { // Ensure that an item with the same name exists in the other collection. $stores[1]->set('foo', $this->objects[5]); $result = $stores[0]->getAll(); - // Not using assertIdentical(), since the order is not defined for getAll(). + // Not using assertSame(), since the order is not defined for getAll(). $this->assertEqual(count($result), count($values)); foreach ($result as $key => $value) { $this->assertEqual($values[$key], $value); diff --git a/core/tests/Drupal/KernelTests/Core/Plugin/ContextPluginTest.php b/core/tests/Drupal/KernelTests/Core/Plugin/ContextPluginTest.php index bd3bba5..a9ec4b8 100644 --- a/core/tests/Drupal/KernelTests/Core/Plugin/ContextPluginTest.php +++ b/core/tests/Drupal/KernelTests/Core/Plugin/ContextPluginTest.php @@ -59,7 +59,7 @@ public function testContext() { $plugin->getContextValue('user'); } catch (ContextException $e) { - $this->assertIdentical("The 'entity:user' context is required and not present.", $e->getMessage(), 'Requesting a non-set value of a required context should throw a context exception.'); + $this->assertSame("The 'entity:user' context is required and not present.", $e->getMessage(), 'Requesting a non-set value of a required context should throw a context exception.'); } // Try to pass the wrong class type as a context value. diff --git a/core/tests/Drupal/KernelTests/Core/Theme/RegistryTest.php b/core/tests/Drupal/KernelTests/Core/Theme/RegistryTest.php index a962fec..a20798e 100644 --- a/core/tests/Drupal/KernelTests/Core/Theme/RegistryTest.php +++ b/core/tests/Drupal/KernelTests/Core/Theme/RegistryTest.php @@ -77,7 +77,7 @@ public function testMultipleSubThemes() { $registry_base_theme->setThemeManager(\Drupal::theme()); $preprocess_functions = $registry_subsub_theme->get()['theme_test_template_test']['preprocess functions']; - $this->assertIdentical([ + $this->assertSame([ 'template_preprocess', 'test_basetheme_preprocess_theme_test_template_test', 'test_subtheme_preprocess_theme_test_template_test', @@ -85,20 +85,20 @@ public function testMultipleSubThemes() { ], $preprocess_functions); $preprocess_functions = $registry_sub_theme->get()['theme_test_template_test']['preprocess functions']; - $this->assertIdentical([ + $this->assertSame([ 'template_preprocess', 'test_basetheme_preprocess_theme_test_template_test', 'test_subtheme_preprocess_theme_test_template_test', ], $preprocess_functions); $preprocess_functions = $registry_base_theme->get()['theme_test_template_test']['preprocess functions']; - $this->assertIdentical([ + $this->assertSame([ 'template_preprocess', 'test_basetheme_preprocess_theme_test_template_test', ], $preprocess_functions); $preprocess_functions = $registry_base_theme->get()['theme_test_function_suggestions']['preprocess functions']; - $this->assertIdentical([ + $this->assertSame([ 'template_preprocess_theme_test_function_suggestions', 'test_basetheme_preprocess_theme_test_function_suggestions', ], $preprocess_functions, "Theme functions don't have template_preprocess but do have template_preprocess_HOOK"); @@ -125,7 +125,7 @@ public function testSuggestionPreprocessFunctions() { $hook .= "$suggestion"; $expected_preprocess_functions[] = "test_theme_preprocess_$hook"; $preprocess_functions = $registry_theme->get()[$hook]['preprocess functions']; - $this->assertIdentical($expected_preprocess_functions, $preprocess_functions, "$hook has correct preprocess functions."); + $this->assertSame($expected_preprocess_functions, $preprocess_functions, "$hook has correct preprocess functions."); } while ($suggestion = array_shift($suggestions)); $expected_preprocess_functions = [ @@ -136,10 +136,10 @@ public function testSuggestionPreprocessFunctions() { ]; $preprocess_functions = $registry_theme->get()['theme_test_preprocess_suggestions__kitten__meerkat']['preprocess functions']; - $this->assertIdentical($expected_preprocess_functions, $preprocess_functions, 'Suggestion implemented as a function correctly inherits preprocess functions.'); + $this->assertSame($expected_preprocess_functions, $preprocess_functions, 'Suggestion implemented as a function correctly inherits preprocess functions.'); $preprocess_functions = $registry_theme->get()['theme_test_preprocess_suggestions__kitten__bearcat']['preprocess functions']; - $this->assertIdentical($expected_preprocess_functions, $preprocess_functions, 'Suggestion implemented as a template correctly inherits preprocess functions.'); + $this->assertSame($expected_preprocess_functions, $preprocess_functions, 'Suggestion implemented as a template correctly inherits preprocess functions.'); $this->assertTrue(isset($registry_theme->get()['theme_test_preprocess_suggestions__kitten__meerkat__tarsier__moose']), 'Preprocess function with an unimplemented lower-level suggestion is added to the registry.'); }