示例#1
0
 public function testFormOptions()
 {
     $this->specify("Text elements don't properly store user options or attributes", function () {
         $element1 = new Text("name");
         $element1->setAttributes(array('class' => 'big-input'));
         $element1->setUserOptions(array('some' => 'value'));
         expect($element1->getUserOptions())->equals(array('some' => 'value'));
         expect($element1->getUserOption('some'))->equals('value');
         expect($element1->getUserOption('some-non'))->null();
         expect($element1->getUserOption('some-non', 'default'))->equals('default');
     });
 }
示例#2
0
 public function testFormOptions()
 {
     $element1 = new Text("name");
     $element1->setAttributes(array('class' => 'big-input'));
     $element1->setUserOptions(array('some' => 'value'));
     $this->assertEquals($element1->getUserOptions(), array('some' => 'value'));
     $this->assertEquals($element1->getUserOption('some'), 'value');
     $this->assertEquals($element1->getUserOption('some-non'), null);
     $this->assertEquals($element1->getUserOption('some-non', 'default'), 'default');
 }