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}"); } }
public function testGetField() { $form = new \Foundation\Form(); $field = $form->newField(); $element = new \Foundation\Form\Element\TextInput($field); $this->assertSame($field, $element->getField()); }