protected function getContentTypeServiceMock() { $mock = $this->getMock('eZ\\Publish\\API\\Repository\\ContentTypeService'); $mock->expects($this->any())->method('loadContentType')->will($this->returnCallback(function ($contentTypeId) { return new ContentType(array('identifier' => $contentTypeId, 'mainLanguageCode' => 'fre-FR', 'fieldDefinitions' => $this->fieldDefinitions[$contentTypeId])); })); return $mock; }