public function matchContentInfo(ContentInfo $contentInfo) { $section = $this->repository->sudo(function (Repository $repository) use($contentInfo) { return $repository->getSectionService()->loadSection($contentInfo->sectionId); }); return isset($this->values[$section->identifier]); }
/** * @dataProvider matchSectionProvider * @covers eZ\Publish\Core\MVC\Symfony\Matcher\ContentBased\Identifier\Section::matchContentInfo * @covers eZ\Publish\Core\MVC\Symfony\Matcher\ContentBased\MultipleValued::setMatchingConfig * @covers \eZ\Publish\Core\MVC\RepositoryAware::setRepository * * @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())); }