/** * Get handler with required custom field types registered * * @return Handler */ public function getCustomHandler() { $fieldType = new FieldType\XmlText\Type(); $fieldType->setTransformationProcessor($this->getTransformationProcessor()); return $this->getHandler('ezxmltext', $fieldType, new XmlTextConverter(), new FieldType\XmlText\XmlTextStorage(array('LegacyStorage' => new LegacyStorage(new UrlGateway())))); }
/** * Normally this should be enough:. * * $ft = new XmlTextType( $this->getMock( 'eZ\\Publish\\Core\\FieldType\\XmlText\\Input\\Parser' ) ); * * But there is a bug in PHPUnit when mocking an interface and calling the test in a certain way * (eg. with --group switch), when invocationMocker is missing. * * Possibly described here: * https://github.com/sebastianbergmann/phpunit-mock-objects/issues/26 */ protected function getFieldType() { $fieldType = new XmlTextType(); $fieldType->setTransformationProcessor($this->getTransformationProcessorMock()); return $fieldType; }