public matchContentInfo ( eZ\Publish\API\Repository\Values\Content\ContentInfo $contentInfo ) : boolean | ||
$contentInfo | eZ\Publish\API\Repository\Values\Content\ContentInfo | |
return | boolean |
public function matchContentInfo(ContentInfo $contentInfo)
{
$contentType = $this->repository->getContentTypeService()->loadContentType($contentInfo->contentTypeId);
return isset($this->values[$contentType->identifier]);
}
/** * @dataProvider matchContentInfoProvider * @covers eZ\Publish\Core\MVC\Symfony\Matcher\ContentBased\Identifier\ContentType::matchLocation * @covers eZ\Publish\Core\MVC\Symfony\Matcher\ContentBased\MultipleValued::setMatchingConfig * * @param string|string[] $matchingConfig * @param \eZ\Publish\API\Repository\Repository $repository * @param bool $expectedResult */ public function testMatchContentInfo($matchingConfig, Repository $repository, $expectedResult) { $this->matcher->setRepository($repository); $this->matcher->setMatchingConfig($matchingConfig); $this->assertSame($expectedResult, $this->matcher->matchContentInfo($this->getContentInfoMock(array('contentTypeId' => 42)))); }