eZ\Publish\Core\MVC\Symfony\Templating\Tests\Twig\Extension\FieldRenderingExtensionIntegrationTest::getContentTypeServiceMock PHP Method

getContentTypeServiceMock() protected method

protected getContentTypeServiceMock ( ) : PHPUnit_Framework_MockObject_MockObject
return PHPUnit_Framework_MockObject_MockObject
    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;
    }