示例#1
0
 /**
  * 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;
 }
示例#2
0
 /**
  * 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());
     return $this->getHandler('eztags', $fieldType, new TagsConverter(), new TagsStorage(array('LegacyStorage' => new TagsLegacyStorage(new LanguageHandlerMock()))));
 }