Exemplo n.º 1
0
 public function testValidate()
 {
     $textField = Field\TextField::create(self::FIELDNAME);
     $this->assertTrue($textField->validate('this is a valid text value.'));
     $this->assertFalse($textField->validate(235));
     $this->assertFalse($textField->validate(array('fnord' => 'array not acceptable')));
 }
Exemplo n.º 2
0
 protected function __construct()
 {
     parent::__construct('Article', array(Field\TextField::create('headline'), Field\TextField::create('content'), Field\IntegerField::create('clickCount'), Field\TextField::create('author'), Field\TextField::create('email'), Field\IntegerCollectionField::create('images'), Field\TextCollectionField::create('keywords'), Field\BooleanField::create('enabled'), Field\AggregateField::create('paragraph', array('modules' => array('\\Dat0r\\Tests\\Core\\Module\\AggregateModule'))), Field\ReferenceField::create('references', array(Field\ReferenceField::OPT_REFERENCES => array(array(Field\ReferenceField::OPT_MODULE => 'Dat0r\\Tests\\Core\\Module\\RootModule', Field\ReferenceField::OPT_IDENTITY_FIELD => 'headline', Field\ReferenceField::OPT_DISPLAY_FIELD => 'headline')))), Field\KeyValueField::create('meta', array('constraints' => array('value_type' => 'dynamic')))));
 }
Exemplo n.º 3
0
 protected function __construct()
 {
     parent::__construct('Paragraph', array(Field\TextField::create('title'), Field\TextareaField::create('content')));
 }