public function testItReturnsTheCompiledMetadata($value) { $classMetadataFactory =
$this->
createMock(ClassMetadataFactoryInterface::
class);
$compiledClassMetadataFactory =
new CompiledClassMetadataFactory(__DIR__.'/../../Fixtures/serializer.class.metadata.php',
$classMetadataFactory);
$classMetadataFactory ->
expects($this->
never()) ->
method('getMetadataFor'
) ;
$expected =
new ClassMetadata(Dummy::
class);
$expected->
addAttributeMetadata(new AttributeMetadata('foo'
));
$expected->
addAttributeMetadata(new AttributeMetadata('bar'
));
$expected->
addAttributeMetadata(new AttributeMetadata('baz'
));
$expected->
addAttributeMetadata(new AttributeMetadata('qux'
));
$this->
assertEquals($expected,
$compiledClassMetadataFactory->
getMetadataFor($value));
} public function testItDelegatesGetMetadataForCall() { $classMetadataFactory =
$this->
createMock(ClassMetadataFactoryInterface::
class);
$compiledClassMetadataFactory =
new CompiledClassMetadataFactory(__DIR__.'/../../Fixtures/serializer.class.metadata.php',
$classMetadataFactory);