public function serializingAnObjectAndUnserializingWillReinjectProperties()
{
$object = $this->objectManager->get(Fixtures\ClassToBeSerialized::class);
$object->interfaceDeclaredSingletonButImplementationIsPrototype->getSingletonA();
$this->assertInstanceOf(Fixtures\PrototypeClassA::class, $object->interfaceDeclaredSingletonButImplementationIsPrototype);
$object->prototypeB->setSomeProperty('This is not a coffee machine.');
$serializedObject = serialize($object);
$object = unserialize($serializedObject);
$this->assertInstanceOf(Fixtures\ClassToBeSerialized::class, $object);
$object->interfaceDeclaredSingletonButImplementationIsPrototype->getSingletonA();
$this->assertInstanceOf(Fixtures\PrototypeClassA::class, $object->interfaceDeclaredSingletonButImplementationIsPrototype);
$this->assertInstanceOf(Fixtures\SingletonClassC::class, $object->eagerC);
$this->assertEquals(null, $object->prototypeB->getSomeProperty(), 'An injected prototype instance will be overwritten with a fresh instance on unserialize.');
}