protected function setUp() { parent::setUp(); $this->router = $this->getMock('Symfony\\Component\\Routing\\RouterInterface'); $this->logger = $this->getMock('Psr\\Log\\LoggerInterface'); $this->siteAccessRouter = $this->getMock('eZ\\Publish\\Core\\MVC\\Symfony\\SiteAccess\\SiteAccessRouterInterface'); $this->configResolver = $this->getMock('eZ\\Publish\\Core\\MVC\\ConfigResolverInterface'); $repositoryClass = 'eZ\\Publish\\Core\\Repository\\Repository'; $this->repository = $repository = $this->getMockBuilder($repositoryClass)->disableOriginalConstructor()->setMethods(array_diff(get_class_methods($repositoryClass), array('sudo')))->getMock(); $this->urlAliasService = $this->getMock('eZ\\Publish\\API\\Repository\\URLAliasService'); $this->locationService = $this->getMock('eZ\\Publish\\API\\Repository\\LocationService'); $this->repository->expects($this->any())->method('getUrlAliasService')->will($this->returnValue($this->urlAliasService)); $this->repository->expects($this->any())->method('getLocationService')->will($this->returnValue($this->locationService)); $this->urlAliasGenerator = new UrlAliasGenerator($this->repository, $this->router, $this->configResolver); $this->urlAliasGenerator->setLogger($this->logger); $this->urlAliasGenerator->setSiteAccessRouter($this->siteAccessRouter); }