public function persistAllPassesAddedObjectsToBackend()
{
$entity2 = new Fixture\Model\Entity2();
$objectStorage = new \SplObjectStorage();
$objectStorage->attach($entity2);
$mockBackend = $this->createMock(Generic\Backend\BackendInterface::class);
$mockBackend->expects($this->once())->method('setAggregateRootObjects')->with($objectStorage);
$manager = new Generic\PersistenceManager();
$manager->injectBackend($mockBackend);
$manager->add($entity2);
$manager->persistAll();
}