This field type represents a simple string.
Inheritance: extends eZ\Publish\Core\FieldType\FieldType
Esempio n. 1
0
 /**
  * Returns the field type under test.
  *
  * This method is used by all test cases to retrieve the field type under
  * test. Just create the FieldType instance using mocks from the provided
  * get*Mock() methods and/or custom get*Mock() implementations. You MUST
  * NOT take care for test case wide caching of the field type, just return
  * a new instance from this method!
  *
  * @return FieldType
  */
 protected function createFieldTypeUnderTest()
 {
     $fieldType = new Country(array("BE" => array("Name" => "Belgium", "Alpha2" => "BE", "Alpha3" => "BEL", "IDC" => 32), "FR" => array("Name" => "France", "Alpha2" => "FR", "Alpha3" => "FRA", "IDC" => 33), "NO" => array("Name" => "Norway", "Alpha2" => "NO", "Alpha3" => "NOR", "IDC" => 47), "KP" => array("Name" => "Korea, Democratic People's Republic of", "Alpha2" => "KP", "Alpha3" => "PRK", "IDC" => 850), "TF" => array("Name" => "French Southern Territories", "Alpha2" => "TF", "Alpha3" => "ATF", "IDC" => 0), "CF" => array("Name" => "Central African Republic", "Alpha2" => "CF", "Alpha3" => "CAF", "IDC" => 236)));
     $fieldType->setTransformationProcessor($this->getTransformationProcessorMock());
     return $fieldType;
 }
Esempio n. 2
0
 /**
  * Returns the field type under test.
  *
  * This method is used by all test cases to retrieve the field type under
  * test. Just create the FieldType instance using mocks from the provided
  * get*Mock() methods and/or custom get*Mock() implementations. You MUST
  * NOT take care for test case wide caching of the field type, just return
  * a new instance from this method!
  *
  * @return FieldType
  */
 protected function createFieldTypeUnderTest()
 {
     $fieldType = new Country(array('BE' => array('Name' => 'Belgium', 'Alpha2' => 'BE', 'Alpha3' => 'BEL', 'IDC' => 32), 'FR' => array('Name' => 'France', 'Alpha2' => 'FR', 'Alpha3' => 'FRA', 'IDC' => 33), 'NO' => array('Name' => 'Norway', 'Alpha2' => 'NO', 'Alpha3' => 'NOR', 'IDC' => 47), 'KP' => array('Name' => "Korea, Democratic People's Republic of", 'Alpha2' => 'KP', 'Alpha3' => 'PRK', 'IDC' => 850), 'TF' => array('Name' => 'French Southern Territories', 'Alpha2' => 'TF', 'Alpha3' => 'ATF', 'IDC' => 0), 'CF' => array('Name' => 'Central African Republic', 'Alpha2' => 'CF', 'Alpha3' => 'CAF', 'IDC' => 236)));
     $fieldType->setTransformationProcessor($this->getTransformationProcessorMock());
     return $fieldType;
 }
 /**
  * Get handler with required custom field types registered
  *
  * @return Handler
  */
 public function getCustomHandler()
 {
     $fieldType = new FieldType\Country\Type(array("BE" => array("Name" => "Belgium", "Alpha2" => "BE", "Alpha3" => "BEL", "IDC" => "32"), "FR" => array("Name" => "France", "Alpha2" => "FR", "Alpha3" => "FRA", "IDC" => "33")));
     $fieldType->setTransformationProcessor($this->getTransformationProcessor());
     return $this->getHandler('ezcountry', $fieldType, new Legacy\Content\FieldValue\Converter\CountryConverter(), new FieldType\NullStorage());
 }
 /**
  * Get handler with required custom field types registered.
  *
  * @return Handler
  */
 public function getCustomHandler()
 {
     $fieldType = new FieldType\Country\Type(array('BE' => array('Name' => 'Belgium', 'Alpha2' => 'BE', 'Alpha3' => 'BEL', 'IDC' => '32'), 'FR' => array('Name' => 'France', 'Alpha2' => 'FR', 'Alpha3' => 'FRA', 'IDC' => '33')));
     $fieldType->setTransformationProcessor($this->getTransformationProcessor());
     return $this->getHandler('ezcountry', $fieldType, new Legacy\Content\FieldValue\Converter\CountryConverter(), new FieldType\NullStorage());
 }