$data =
$test1_snapshot->
read('config_test.update'
);
$this->
assertEquals(['foo' => 'baz'
],
$data, 'The config_test.update in collection.test1 exists in the snapshot storage.'
);
$this->
assertFalse($test1_snapshot->
read('config_test.create'
), 'The config_test.create in collection.test1 does not exist in the snapshot storage.'
);
$test2_snapshot =
$snapshot_storage->
createCollection('collection.test2'
);
$data =
$test2_snapshot->
read('config_test.another_delete'
);
$this->
assertEquals(['foo' => 'bar'
],
$data, 'The config_test.another_delete in collection.test2 exists in the snapshot storage.'
);
$data =
$test2_snapshot->
read('config_test.another_update'
);
$this->
assertEquals(['foo' => 'baz'
],
$data, 'The config_test.another_update in collection.test2 exists in the snapshot storage.'
);
$this->
assertFalse($test2_snapshot->
read('config_test.another_create'
), 'The config_test.another_create in collection.test2 does not exist in the snapshot storage.'
);
// Create the tar that contains the expected content for the collections.
$tar =
new ArchiveTar($filename, 'gz'
);
$content_list =
$tar->
listContent();
// Convert the list of files into something easy to search.
$files =
[];
foreach ($content_list as $file) { $files[] =
$file['filename'
];
} $this->
assertContains('collection/test1/config_test.create.yml',
$files, 'Config export contains collection/test1/config_test.create.yml.'
);
$this->
assertContains('collection/test2/config_test.another_create.yml',
$files, 'Config export contains collection/test2/config_test.another_create.yml.'
);
$this->
assertContains('collection/test1/config_test.update.yml',
$files, 'Config export contains collection/test1/config_test.update.yml.'
);
$this->
assertContains('collection/test2/config_test.another_update.yml',
$files, 'Config export contains collection/test2/config_test.another_update.yml.'
);
$this->
assertNotContains('collection/test1/config_test.delete.yml',
$files, 'Config export does not contain collection/test1/config_test.delete.yml.'
);