/** * Returns the field type under test. * * @return \Netgen\TagsBundle\Core\FieldType\Tags\Type */ protected function createFieldTypeUnderTest() { $this->tagsService = $this->getMock('Netgen\\TagsBundle\\API\\Repository\\TagsService'); $this->tagsService->expects($this->any())->method('loadTag')->will($this->returnCallback(array($this, 'getTagsServiceLoadTagValues'))); $tagsType = new TagsType($this->tagsService); $tagsType->setEditViews(array('default' => array('identifier' => 'Default'), 'select' => array('identifier' => 'Select'))); return $tagsType; }
/** * Returns the Handler with all necessary objects registered. * * Returns an instance of the Persistence Handler where the * FieldType\Storage has been registered. * * @return \eZ\Publish\SPI\Persistence\Handler */ public function getCustomHandler() { $this->tagsService = $this->getMock('Netgen\\TagsBundle\\API\\Repository\\TagsService'); $fieldType = new TagsType($this->tagsService); $fieldType->setTransformationProcessor($this->getTransformationProcessor()); $fieldType->setEditViews(array('default' => array('identifier' => 'Default'), 'select' => array('identifier' => 'Select'))); return $this->getHandler('eztags', $fieldType, new TagsConverter(), new TagsStorage(array('LegacyStorage' => new TagsLegacyStorage(new LanguageHandlerMock())))); }