public function IndividualExportImportTest::testExportNonEmptyFiles in Configuration Split 2.0.x
Same name and namespace in other branches
- 8 tests/src/Kernel/IndividualExportImportTest.php \Drupal\Tests\config_split\Kernel\IndividualExportImportTest::testExportNonEmptyFiles()
Test exporting when there is already data to be overwritten.
File
- tests/
src/ Kernel/ IndividualExportImportTest.php, line 143
Class
- IndividualExportImportTest
- Test the export and import of individual splits.
Namespace
Drupal\Tests\config_split\KernelCode
public function testExportNonEmptyFiles() {
// Start with random data in the storages.
$random = $this
->getRandomDataStorage();
$this
->copyConfig($random, $this
->getSyncFileStorage());
$this
->copyConfig($this
->getRandomDataStorage(), $this
->getSplitSourceStorage($this->split));
// Do the export.
$this->container
->get('config_split.cli')
->ioExport($this->split
->getName(), $this->io, $this->t);
// The sync storage is still random.
static::assertStorageEquals($random, $this
->getSyncFileStorage());
// The split is successfully exported.
static::assertStorageEquals($this
->getSplitExpectationStorage(), $this
->getSplitSourceStorage($this->split));
// Check the IO, but we skip checking the confirmation message.
static::assertCount(2, $this->io->calls);
static::assertEquals([
'confirm',
], array_keys($this->io->calls[0]));
static::assertEquals([
'success' => [
'Configuration successfully exported.',
],
], $this->io->calls[1]);
}