コード例 #1
0
 public function testSetProperties()
 {
     $object = new \Foundation\Form\Element\TextInput($this->field);
     $value = uniqid();
     foreach ($object->getAttributes() as $memberName => $htmlName) {
         $set = 'set' . ucfirst($memberName);
         $object->{$set}($value);
     }
     foreach ($object->getAttributes() as $memberName => $htmlName) {
         $get = 'get' . ucfirst($memberName);
         $this->assertEquals($value, $object->{$get}(), "Wrong value for {$memberName}");
     }
 }
コード例 #2
0
ファイル: FormElementTest.php プロジェクト: jazzee/foundation
 public function testGetField()
 {
     $form = new \Foundation\Form();
     $field = $form->newField();
     $element = new \Foundation\Form\Element\TextInput($field);
     $this->assertSame($field, $element->getField());
 }