public function StorageComparerTest::testCreateChangelistCreate in Drupal 8
Same name and namespace in other branches
- 9 core/tests/Drupal/Tests/Core/Config/StorageComparerTest.php \Drupal\Tests\Core\Config\StorageComparerTest::testCreateChangelistCreate()
@covers ::createChangelist
File
- core/
tests/ Drupal/ Tests/ Core/ Config/ StorageComparerTest.php, line 127
Class
- StorageComparerTest
- @coversDefaultClass \Drupal\Core\Config\StorageComparer @group Config
Namespace
Drupal\Tests\Core\ConfigCode
public function testCreateChangelistCreate() {
$target_data = $source_data = $this
->getConfigData();
unset($target_data['field.storage.node.body']);
unset($target_data['field.field.node.article.body']);
unset($target_data['views.view.test_view']);
$this->sourceStorage
->expects($this
->once())
->method('listAll')
->will($this
->returnValue(array_keys($source_data)));
$this->targetStorage
->expects($this
->once())
->method('listAll')
->will($this
->returnValue(array_keys($target_data)));
$this->sourceStorage
->expects($this
->once())
->method('readMultiple')
->will($this
->returnValue($source_data));
$this->targetStorage
->expects($this
->once())
->method('readMultiple')
->will($this
->returnValue($target_data));
$this->sourceStorage
->expects($this
->once())
->method('getAllCollectionNames')
->will($this
->returnValue([]));
$this->targetStorage
->expects($this
->once())
->method('getAllCollectionNames')
->will($this
->returnValue([]));
$this->storageComparer
->createChangelist();
$expected = [
'field.storage.node.body',
'field.field.node.article.body',
'views.view.test_view',
];
$this
->assertEquals($expected, $this->storageComparer
->getChangelist('create'));
$this
->assertEmpty($this->storageComparer
->getChangelist('delete'));
$this
->assertEmpty($this->storageComparer
->getChangelist('update'));
}