public function testCreateThrowsContentValidationException($sourceUrl, $destinationUrl, $forward) { $mockedService = $this->getPartlyMockedURLWildcardService(); /** @var \PHPUnit_Framework_MockObject_MockObject $handlerMock */ $handlerMock = $this->getPersistenceMock()->urlWildcardHandler(); $repositoryMock = $this->getRepositoryMock(); $repositoryMock->expects($this->once())->method('hasAccess')->with($this->equalTo('content'), $this->equalTo('urltranslator'))->will($this->returnValue(true)); $handlerMock->expects($this->once())->method('loadAll')->will($this->returnValue(array())); $mockedService->create($sourceUrl, $destinationUrl, $forward); }