Permalink
Browse files

added tests for element options

  • Loading branch information...
1 parent 8ac7346 commit 5e847c2f80f4d6ae5a432b1ffee4a34a074a4f00 @phpboyscout phpboyscout committed Jul 16, 2012
Showing with 22 additions and 0 deletions.
  1. +22 −0 tests/Zend/Form/ElementTest.php
View
22 tests/Zend/Form/ElementTest.php
@@ -96,4 +96,26 @@ public function testCanPassNameToConstructor()
$element = new Element('foo');
$this->assertEquals('foo', $element->getName());
}
+
+ public function testCanSetCustomOptionFromConstructor()
+ {
+ $element = new Element($foo, array(
+ 'custom' => 'option'
+ ));
+ $options = $element->getOptions();
+ $this->assertArrayHasKey('custom', $options);
+ $this->assertEquals('option', $options['custom']);
+ }
+
+ public function testCanSetCustomOptionFromMethod()
+ {
+ $element = new Element($foo);
+ $element->setOptions(array(
+ 'custom' => 'option'
+ ));
+
+ $options = $element->getOptions();
+ $this->assertArrayHasKey('custom', $options);
+ $this->assertEquals('option', $options['custom']);
+ }
}

0 comments on commit 5e847c2

Please sign in to comment.