Commit 5da4584d authored by xjm's avatar xjm

Issue #2756519 by ZeiP, timmillwood, xjm, mradcliffe, dawehner, joelpittet,...

Issue #2756519 by ZeiP, timmillwood, xjm, mradcliffe, dawehner, joelpittet, Antti J. Salminen: Convert assertIdentical() to assertSame() for some uses in kernel tests that already have assertSame()'s parameter order
parent 56799641
...@@ -70,7 +70,7 @@ public function testLibraryUnknown() { ...@@ -70,7 +70,7 @@ public function testLibraryUnknown() {
$build['#attached']['library'][] = 'core/unknown'; $build['#attached']['library'][] = 'core/unknown';
$assets = AttachedAssets::createFromRenderArray($build); $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() { ...@@ -435,12 +435,12 @@ public function testDynamicLibrary() {
$dynamic_library = $library_discovery->getLibraryByName('common_test', 'dynamic_library'); $dynamic_library = $library_discovery->getLibraryByName('common_test', 'dynamic_library');
$this->assertTrue(is_array($dynamic_library)); $this->assertTrue(is_array($dynamic_library));
if ($this->assertTrue(isset($dynamic_library['version']))) { 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. // Make sure the dynamic library definition could be altered.
// @see common_test_library_info_alter() // @see common_test_library_info_alter()
if ($this->assertTrue(isset($dynamic_library['dependencies']))) { if ($this->assertTrue(isset($dynamic_library['dependencies']))) {
$this->assertIdentical(['core/jquery'], $dynamic_library['dependencies']); $this->assertSame(['core/jquery'], $dynamic_library['dependencies']);
} }
} }
......
...@@ -40,12 +40,12 @@ public function testSetGet() { ...@@ -40,12 +40,12 @@ public function testSetGet() {
$cid_long = str_repeat('愛€', 500); $cid_long = str_repeat('愛€', 500);
$cached_value_long = $this->randomMachineName(); $cached_value_long = $this->randomMachineName();
$backend->set($cid_long, $cached_value_long); $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€'; $cid_short = '愛1€';
$cached_value_short = $this->randomMachineName(); $cached_value_short = $this->randomMachineName();
$backend->set($cid_short, $cached_value_short); $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.");
} }
} }
...@@ -130,22 +130,22 @@ protected function tearDown() { ...@@ -130,22 +130,22 @@ protected function tearDown() {
public function testSetGet() { public function testSetGet() {
$backend = $this->getCacheBackend(); $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']; $with_backslash = ['foo' => '\Drupal\foo\Bar'];
$backend->set('test1', $with_backslash); $backend->set('test1', $with_backslash);
$cached = $backend->get('test1'); $cached = $backend->get('test1');
$this->assert(is_object($cached), "Backend returned an object for cache id 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.'); $this->assertTrue($cached->valid, 'Item is marked as valid.');
// We need to round because microtime may be rounded up in the backend. // 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->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->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); $backend->set('test2', ['value' => 3], REQUEST_TIME + 3);
$cached = $backend->get('test2'); $cached = $backend->get('test2');
$this->assert(is_object($cached), "Backend returned an object for cache id 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->valid, 'Item is marked as valid.');
$this->assertTrue($cached->created >= REQUEST_TIME && $cached->created <= round(microtime(TRUE), 3), 'Created time is correct.'); $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->assertEqual($cached->expire, REQUEST_TIME + 3, 'Expire time is correct.');
...@@ -158,22 +158,22 @@ public function testSetGet() { ...@@ -158,22 +158,22 @@ public function testSetGet() {
$this->assertTrue($cached->created >= REQUEST_TIME && $cached->created <= round(microtime(TRUE), 3), 'Created time is correct.'); $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->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"]; $with_eof = ['foo' => "\nEOF\ndata"];
$backend->set('test4', $with_eof); $backend->set('test4', $with_eof);
$cached = $backend->get('test4'); $cached = $backend->get('test4');
$this->assert(is_object($cached), "Backend returned an object for cache id 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->valid, 'Item is marked as valid.');
$this->assertTrue($cached->created >= REQUEST_TIME && $cached->created <= round(microtime(TRUE), 3), 'Created time is correct.'); $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->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"]; $with_eof_and_semicolon = ['foo' => "\nEOF;\ndata"];
$backend->set('test5', $with_eof_and_semicolon); $backend->set('test5', $with_eof_and_semicolon);
$cached = $backend->get('test5'); $cached = $backend->get('test5');
$this->assert(is_object($cached), "Backend returned an object for cache id 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->valid, 'Item is marked as valid.');
$this->assertTrue($cached->created >= REQUEST_TIME && $cached->created <= round(microtime(TRUE), 3), 'Created time is correct.'); $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->assertEqual($cached->expire, Cache::PERMANENT, 'Expire time is correct.');
...@@ -182,7 +182,7 @@ public function testSetGet() { ...@@ -182,7 +182,7 @@ public function testSetGet() {
$backend->set('test6', $with_variable); $backend->set('test6', $with_variable);
$cached = $backend->get('test6'); $cached = $backend->get('test6');
$this->assert(is_object($cached), "Backend returned an object for cache id 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. // Make sure that a cached object is not affected by changing the original.
$data = new \stdClass(); $data = new \stdClass();
...@@ -229,26 +229,26 @@ public function testSetGet() { ...@@ -229,26 +229,26 @@ public function testSetGet() {
public function testDelete() { public function testDelete() {
$backend = $this->getCacheBackend(); $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); $backend->set('test1', 7);
$this->assert(is_object($backend->get('test1')), "Backend returned an object for cache id test1."); $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); $backend->set('test2', 3);
$this->assert(is_object($backend->get('test2')), "Backend returned an object for cache id %cid."); $this->assert(is_object($backend->get('test2')), "Backend returned an object for cache id %cid.");
$backend->delete('test1'); $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."); $this->assert(is_object($backend->get('test2')), "Backend still has an object for cache id test2.");
$backend->delete('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); $long_cid = str_repeat('a', 300);
$backend->set($long_cid, 'test'); $backend->set($long_cid, 'test');
$backend->delete($long_cid); $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() { ...@@ -275,7 +275,7 @@ public function testValueTypeIsKept() {
foreach ($variables as $cid => $value) { foreach ($variables as $cid => $value) {
$object = $backend->get($cid); $object = $backend->get($cid);
$this->assert(is_object($object), sprintf("Backend returned an object for cache id %s.", $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() { ...@@ -450,10 +450,10 @@ public function testDeleteMultiple() {
]); ]);
// Test if expected keys have been deleted. // Test if expected keys have been deleted.
$this->assertIdentical(FALSE, $backend->get('test1'), "Cache id test1 deleted."); $this->assertSame(FALSE, $backend->get('test1'), "Cache id test1 deleted.");
$this->assertIdentical(FALSE, $backend->get('test3'), "Cache id test3 deleted."); $this->assertSame(FALSE, $backend->get('test3'), "Cache id test3 deleted.");
$this->assertIdentical(FALSE, $backend->get('test5'), "Cache id test5 deleted."); $this->assertSame(FALSE, $backend->get('test5'), "Cache id test5 deleted.");
$this->assertIdentical(FALSE, $backend->get('test7'), "Cache id test7 deleted."); $this->assertSame(FALSE, $backend->get('test7'), "Cache id test7 deleted.");
// Test if expected keys exist. // Test if expected keys exist.
$this->assertNotIdentical(FALSE, $backend->get('test2'), "Cache id test2 exists."); $this->assertNotIdentical(FALSE, $backend->get('test2'), "Cache id test2 exists.");
...@@ -461,8 +461,8 @@ public function testDeleteMultiple() { ...@@ -461,8 +461,8 @@ public function testDeleteMultiple() {
$this->assertNotIdentical(FALSE, $backend->get('test6'), "Cache id test6 exists."); $this->assertNotIdentical(FALSE, $backend->get('test6'), "Cache id test6 exists.");
// Test if that expected keys do not exist. // Test if that expected keys do not exist.
$this->assertIdentical(FALSE, $backend->get('test19'), "Cache id test19 does not exist."); $this->assertSame(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('test21'), "Cache id test21 does not exist.");
// Calling deleteMultiple() with an empty array should not cause an error. // Calling deleteMultiple() with an empty array should not cause an error.
$this->assertFalse($backend->deleteMultiple([])); $this->assertFalse($backend->deleteMultiple([]));
......
...@@ -205,8 +205,8 @@ public function testScriptLoad() { ...@@ -205,8 +205,8 @@ public function testScriptLoad() {
$this->assertTrue(Database::getConnection() $this->assertTrue(Database::getConnection()
->schema() ->schema()
->tableExists($table), SafeMarkup::format('Table @table created by the database script.', ['@table' => $table])); ->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->assertSame($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->originalTableIndexes[$table], $this->getTableIndexes($table), SafeMarkup::format('The indexes for @table were properly restored.', ['@table' => $table]));
} }
// Ensure the test config has been replaced. // Ensure the test config has been replaced.
......
...@@ -278,12 +278,12 @@ public function testDataTypes() { ...@@ -278,12 +278,12 @@ public function testDataTypes() {
$this->assertIdentical($storage->read($name), $data); $this->assertIdentical($storage->read($name), $data);
// Test that schema type enforcement can be overridden by trusting the 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); $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. // Test that re-saving without testing the data enforces the schema type.
$config->save(); $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 // Test that setting an unsupported type for a config object with a schema
// fails. // fails.
......
...@@ -328,7 +328,7 @@ public function testConfigEntityUninstallComplex(array $entity_id_suffixes) { ...@@ -328,7 +328,7 @@ public function testConfigEntityUninstallComplex(array $entity_id_suffixes) {
$called = \Drupal::state()->get('config_test.on_dependency_removal_called', []); $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->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 // Perform a module rebuild so we can know where the node module is located
// and uninstall it. // and uninstall it.
......
...@@ -57,7 +57,7 @@ public function testCacheHit() { ...@@ -57,7 +57,7 @@ public function testCacheHit() {
// config_entity_static_cache_test_config_test_load() sets _loadStamp to a // 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 // random string. If they match, it means $entity_2 was retrieved from the
// static cache rather than going through a separate load sequence. // 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);
} }
/** /**
......
...@@ -80,7 +80,7 @@ public function testStorageMethods() { ...@@ -80,7 +80,7 @@ public function testStorageMethods() {
// Compare UUIDs as the objects are not identical since // Compare UUIDs as the objects are not identical since
// $entity->enforceIsNew is FALSE and $entity_loaded_by_uuid->enforceIsNew // $entity->enforceIsNew is FALSE and $entity_loaded_by_uuid->enforceIsNew
// is NULL. // is NULL.
$this->assertIdentical($entity->uuid(), $entity_loaded_by_uuid->uuid()); $this->assertSame($entity->uuid(), $entity_loaded_by_uuid->uuid());
$entities = $this->storage->loadByProperties(); $entities = $this->storage->loadByProperties();
$this->assertEqual(count($entities), 3, 'Three entities are loaded when no properties are specified.'); $this->assertEqual(count($entities), 3, 'Three entities are loaded when no properties are specified.');
...@@ -100,12 +100,12 @@ public function testStorageMethods() { ...@@ -100,12 +100,12 @@ public function testStorageMethods() {
'style' => 999 'style' => 999
]); ]);
$entity->save(); $entity->save();
$this->assertIdentical('999', $entity->style); $this->assertSame('999', $entity->style);
$entity->style = 999; $entity->style = 999;
$entity->trustData()->save(); $entity->trustData()->save();
$this->assertIdentical(999, $entity->style); $this->assertSame(999, $entity->style);
$entity->save(); $entity->save();
$this->assertIdentical('999', $entity->style); $this->assertSame('999', $entity->style);
} }
} }
...@@ -210,22 +210,22 @@ public function testSerialization() { ...@@ -210,22 +210,22 @@ public function testSerialization() {
$config_parsed = $filestorage->read($name); $config_parsed = $filestorage->read($name);
$key = 'numeric keys'; $key = 'numeric keys';
$this->assertIdentical($config_data[$key], $config_parsed[$key]); $this->assertSame($config_data[$key], $config_parsed[$key]);
$key = 'nested keys'; $key = 'nested keys';
$this->assertIdentical($config_data[$key], $config_parsed[$key]); $this->assertSame($config_data[$key], $config_parsed[$key]);
$key = 'HTML'; $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'; $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 = 'ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΣὨ'; $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'; $key = 'invalid xml';
$this->assertIdentical($config_data[$key], $config_parsed[$key]); $this->assertSame($config_data[$key], $config_parsed[$key]);
} }
} }
...@@ -92,7 +92,7 @@ public function testRecreateEntity() { ...@@ -92,7 +92,7 @@ public function testRecreateEntity() {
$this->assertEqual(5, count($creates), 'There are 5 configuration items to create.'); $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(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->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(); $this->configImporter->import();
......
...@@ -95,7 +95,7 @@ public function testRenameValidation() { ...@@ -95,7 +95,7 @@ public function testRenameValidation() {
'node.type.' . $content_type->id() . '::config_test.dynamic.' . $test_entity_id, 'node.type.' . $content_type->id() . '::config_test.dynamic.' . $test_entity_id,
]; ];
$renames = $this->configImporter->getUnprocessedConfiguration('rename'); $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 // Try to import the configuration. We expect an exception to be thrown
// because the staged entity is of a different type. // because the staged entity is of a different type.
...@@ -138,7 +138,7 @@ public function testRenameSimpleConfigValidation() { ...@@ -138,7 +138,7 @@ public function testRenameSimpleConfigValidation() {
'config_test.old::config_test.new' 'config_test.old::config_test.new'
]; ];
$renames = $this->configImporter->getUnprocessedConfiguration('rename'); $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 // Try to import the configuration. We expect an exception to be thrown
// because the rename is for simple configuration. // because the rename is for simple configuration.
......
...@@ -351,7 +351,7 @@ public function testSecondaryUpdateDeletedDeleterFirst() { ...@@ -351,7 +351,7 @@ public function testSecondaryUpdateDeletedDeleterFirst() {
$name_deletee, $name_deletee,
$name_other, $name_other,
]; ];
$this->assertIdentical($expected, $updates); $this->assertSame($expected, $updates);
// Import. // Import.
$this->configImporter->import(); $this->configImporter->import();
......
...@@ -146,7 +146,7 @@ public function testCollectionInstallationCollections() { ...@@ -146,7 +146,7 @@ public function testCollectionInstallationCollections() {
$this->assertEqual($collections, $active_storage->getAllCollectionNames()); $this->assertEqual($collections, $active_storage->getAllCollectionNames());
$collection_storage = $active_storage->createCollection('entity'); $collection_storage = $active_storage->createCollection('entity');
$data = $collection_storage->read('config_test.dynamic.dotted.default'); $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 // Test that the config manager uninstalls configuration from collections
// as expected. // as expected.
...@@ -185,7 +185,7 @@ public function testCollectionInstallationCollectionConfigEntity() { ...@@ -185,7 +185,7 @@ public function testCollectionInstallationCollectionConfigEntity() {
$data = $active_storage->read($name); $data = $active_storage->read($name);
$this->assertTrue(isset($data['uuid'])); $this->assertTrue(isset($data['uuid']));
$data = $collection_storage->read($name); $data = $collection_storage->read($name);
$this->assertIdentical(['label' => 'entity'], $data); $this->assertSame(['label' => 'entity'], $data);
} }
/** /**
...@@ -227,7 +227,7 @@ public function testDependencyChecking() { ...@@ -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.'); $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 // Ensure that dependencies can be added during module installation by
// hooks. // hooks.
$this->assertIdentical('config_install_dependency_test', $entity->getDependencies()['module'][0]); $this->assertSame('config_install_dependency_test', $entity->getDependencies()['module'][0]);
} }
/** /**
......
...@@ -40,7 +40,7 @@ protected function setUp() { ...@@ -40,7 +40,7 @@ protected function setUp() {
*/ */
public function testSchemaMapping() { public function testSchemaMapping() {
// Nonexistent configuration key will have Undefined as metadata. // 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'); $definition = \Drupal::service('config.typed')->getDefinition('config_schema_test.no_such_key');
$expected = []; $expected = [];
$expected['label'] = 'Undefined'; $expected['label'] = 'Undefined';
...@@ -51,12 +51,12 @@ public function testSchemaMapping() { ...@@ -51,12 +51,12 @@ public function testSchemaMapping() {
$this->assertEqual($definition, $expected, 'Retrieved the right metadata for nonexistent configuration.'); $this->assertEqual($definition, $expected, 'Retrieved the right metadata for nonexistent configuration.');
// Configuration file without schema will return Undefined as well. // 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'); $definition = \Drupal::service('config.typed')->getDefinition('config_schema_test.noschema');
$this->assertEqual($definition, $expected, 'Retrieved the right metadata for configuration with no schema.'); $this->assertEqual($definition, $expected, 'Retrieved the right metadata for configuration with no schema.');
// Configuration file with only some 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'); $definition = \Drupal::service('config.typed')->getDefinition('config_schema_test.someschema');
$expected = []; $expected = [];
$expected['label'] = 'Schema test data'; $expected['label'] = 'Schema test data';
...@@ -505,7 +505,7 @@ public function testSchemaFallback() { ...@@ -505,7 +505,7 @@ public function testSchemaFallback() {
$definition2 = \Drupal::service('config.typed')->getDefinition('config_schema_test.wildcard_fallback.something.something'); $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 // This should be the schema of config_schema_test.wildcard_fallback.* as
//well. //well.
$this->assertIdentical($definition, $definition2); $this->assertSame($definition, $definition2);
} }
/** /**
......
...@@ -189,7 +189,7 @@ public function testCollection() { ...@@ -189,7 +189,7 @@ public function testCollection() {
$data = ['foo' => 'bar']; $data = ['foo' => 'bar'];
$result = $this->storage->write($name, $data); $result = $this->storage->write($name, $data);
$this->assertIdentical($result, TRUE); $this->assertIdentical($result, TRUE);
$this->assertIdentical($data, $this->storage->read($name)); $this->assertSame($data, $this->storage->read($name));
// Create configuration in a new collection. // Create configuration in a new collection.
$new_storage = $this->storage->createCollection('collection.sub.new'); $new_storage = $this->storage->createCollection('collection.sub.new');
...@@ -197,13 +197,13 @@ public function testCollection() { ...@@ -197,13 +197,13 @@ public function testCollection() {
$this->assertEqual([], $new_storage->listAll()); $this->assertEqual([], $new_storage->listAll());
$new_storage->write($name, $data); $new_storage->write($name, $data);
$this->assertIdentical($result, TRUE); $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->assertEqual([$name], $new_storage->listAll());
$this->assertTrue($new_storage->exists($name)); $this->assertTrue($new_storage->exists($name));
$new_data = ['foo' => 'baz']; $new_data = ['foo' => 'baz'];
$new_storage->write($name, $new_data); $new_storage->write($name, $new_data);
$this->assertIdentical($result, TRUE); $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. // Create configuration in another collection.
$another_storage = $this->storage->createCollection('collection.sub.another'); $another_storage = $this->storage->createCollection('collection.sub.another');
...@@ -211,7 +211,7 @@ public function testCollection() { ...@@ -211,7 +211,7 @@ public function testCollection() {
$this->assertEqual([], $another_storage->listAll()); $this->assertEqual([], $another_storage->listAll());
$another_storage->write($name, $new_data); $another_storage->write($name, $new_data);
$this->assertIdentical($result, TRUE); $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->assertEqual([$name], $another_storage->listAll());
$this->assertTrue($another_storage->exists($name)); $this->assertTrue($another_storage->exists($name));
...@@ -219,18 +219,18 @@ public function testCollection() { ...@@ -219,18 +219,18 @@ public function testCollection() {
$alt_storage = $this->storage->createCollection('alternate'); $alt_storage = $this->storage->createCollection('alternate');
$alt_storage->write($name, $new_data); $alt_storage->write($name, $new_data);
$this->assertIdentical($result, TRUE); $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 // Switch back to the collection-less mode and check the data still exists
// add has not been touched. // 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. // 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. // Check that the collections are removed when they are empty.
$alt_storage->delete($name); $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 // Create configuration in collection called 'collection'. This ensures that
// FileStorage's collection storage works regardless of its use of // FileStorage's collection storage works regardless of its use of
...@@ -240,19 +240,19 @@ public function testCollection() { ...@@ -240,19 +240,19 @@ public function testCollection() {
$this->assertEqual([], $parent_storage->listAll()); $this->assertEqual([], $parent_storage->listAll());
$parent_storage->write($name, $new_data); $parent_storage->write($name, $new_data);
$this->assertIdentical($result, TRUE); $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->assertEqual([$name], $parent_storage->listAll());
$this->assertTrue($parent_storage->exists($name)); $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();