/** * {@inheritdoc} */ public function findMetadataBySubject(MetadataSubjectInterface $metadataSubject) { $compiledMetadata = $this->metadataProvider->findMetadataBySubject($metadataSubject); if (null === $compiledMetadata) { return null; } return $this->metadataProcessor->process($compiledMetadata, ['subject' => $metadataSubject]); }
function it_does_not_process_returned_metadata_if_null(MetadataProviderInterface $metadataProvider, MetadataProcessorInterface $metadataProcessor, MetadataSubjectInterface $metadataSubject) { $metadataProvider->findMetadataBySubject($metadataSubject)->shouldBeCalled()->willReturn(null); $metadataProcessor->process(Argument::cetera())->shouldNotBeCalled(); $this->findMetadataBySubject($metadataSubject)->shouldReturn(null); }