protected function getContentTypeServiceMock() { $contentTypeServiceMock = $this->getMock('eZ\\Publish\\Core\\Repository\\ContentTypeService', array(), array(), '', false); $contentTypeServiceMock->expects($this->any())->method('newFieldDefinitionUpdateStruct')->will($this->returnValue(new FieldDefinitionUpdateStruct())); $contentTypeServiceMock->expects($this->any())->method('loadContentTypeDraft')->with($this->equalTo(42))->will($this->returnValue(new ContentType(array('fieldDefinitions' => array(new FieldDefinition(array('id' => 24, 'fieldTypeIdentifier' => 'ezstring'))))))); return $contentTypeServiceMock; }