Update to Drupal 8.0.5. For more information, see https://www.drupal.org/node/2679347

This commit is contained in:
Pantheon Automation 2016-03-02 12:40:24 -08:00 committed by Greg Anderson
parent 2a9f1f148d
commit fd3b12cf27
251 changed files with 5439 additions and 957 deletions

View file

@ -229,7 +229,7 @@ class ConfigDependencyTest extends EntityUnitTestBase {
// Set a more complicated test where dependencies will be fixed.
\Drupal::state()->set('config_test.fix_dependencies', array($entity1->getConfigDependencyName()));
\Drupal::state()->set('config_test.on_dependency_removal_called', []);
// Entity1 will be deleted because it depends on node.
$entity1 = $storage->create(
array(
@ -259,7 +259,8 @@ class ConfigDependencyTest extends EntityUnitTestBase {
$entity2->save();
// Entity3 will be unchanged because it is dependent on Entity2 which can
// be fixed.
// be fixed. The ConfigEntityInterface::onDependencyRemoval() method will
// not be called for this entity.
$entity3 = $storage->create(
array(
'id' => 'entity3',
@ -295,6 +296,10 @@ class ConfigDependencyTest extends EntityUnitTestBase {
$this->assertEqual($entity3->uuid(), reset($config_entities['unchanged'])->uuid(), 'Entity 3 is not changed.');
$this->assertEqual($entity4->uuid(), $config_entities['delete'][1]->uuid(), 'Entity 4 will be deleted.');
$called = \Drupal::state()->get('config_test.on_dependency_removal_called', []);
$this->assertFalse(in_array($entity3->id(), $called), 'ConfigEntityInterface::onDependencyRemoval() is not called for entity 3.');
$this->assertIdentical(['entity1', 'entity2', 'entity4'], $called, 'The most dependent entites have ConfigEntityInterface::onDependencyRemoval() called first.');
// Perform the uninstall.
$config_manager->uninstall('module', 'node');

View file

@ -70,6 +70,12 @@ class FileStorageTest extends ConfigStorageTestBase {
$config_files = $this->storage->listAll();
$this->assertIdentical($config_files, $expected_files, 'Relative path, two config files found.');
// @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.');
// Initialize FileStorage with absolute file path.
$absolute_path = realpath($this->directory);
$storage_absolute_path = new FileStorage($absolute_path);

View file

@ -122,6 +122,11 @@ class ConfigTest extends ConfigEntityBase implements ConfigTestInterface {
* {@inheritdoc}
*/
public function onDependencyRemoval(array $dependencies) {
// Record which entities have this method called on.
$called = \Drupal::state()->get('config_test.on_dependency_removal_called', []);
$called[] = $this->id();
\Drupal::state()->set('config_test.on_dependency_removal_called', $called);
$changed = parent::onDependencyRemoval($dependencies);
if (!isset($this->dependencies['enforced']['config'])) {
return $changed;