public function testReplaceStorageContents($source_collections,
$target_collections) { $source =
new MemoryStorage();
$target =
new MemoryStorage();
// Empty the storage should be the same.
$this->
assertEquals(self::
toArray($source), self::
toArray($target));
// When the source is populated, they are not the same any more.
$this->
generateRandomData($source,
$source_collections);
$this->
assertNotEquals(self::
toArray($source), self::
toArray($target));
// When the target is filled with random data they are also not the same.
$this->
generateRandomData($target,
$target_collections);
$this->
assertNotEquals(self::
toArray($source), self::
toArray($target));
// Set the active collection to a random one on both source and target.
if ($source_collections) { $collections =
$source->
getAllCollectionNames();
$source =
$source->
createCollection($collections[array_rand($collections)]);
}