getMock('Doctrine\Common\Persistence\ObjectManager'); $args = new OnClassMetadataNotFoundEventArgs('foo', $objectManager); $this->assertSame('foo', $args->getClassName()); $this->assertSame($objectManager, $args->getObjectManager()); $this->assertNull($args->getFoundMetadata()); /* @var $metadata \Doctrine\Common\Persistence\Mapping\ClassMetadata */ $metadata = $this->getMock('Doctrine\Common\Persistence\Mapping\ClassMetadata'); $args->setFoundMetadata($metadata); $this->assertSame($metadata, $args->getFoundMetadata()); $args->setFoundMetadata(null); $this->assertNull($args->getFoundMetadata()); } }