private function generateRepositoryMockForContentTypeIdentifier($contentTypeIdentifier) { $contentTypeMock = $this->getMockBuilder('eZ\\Publish\\API\\Repository\\Values\\ContentType\\ContentType')->setConstructorArgs(array(array('identifier' => $contentTypeIdentifier)))->getMockForAbstractClass(); $contentTypeServiceMock = $this->getMockBuilder('eZ\\Publish\\API\\Repository\\ContentTypeService')->disableOriginalConstructor()->getMock(); $contentTypeServiceMock->expects($this->once())->method('loadContentType')->with(42)->will($this->returnValue($contentTypeMock)); $repository = $this->getRepositoryMock(); $repository->expects($this->any())->method('getContentTypeService')->will($this->returnValue($contentTypeServiceMock)); return $repository; }