Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added tests for element options

  • Loading branch information...
commit 5e847c2f80f4d6ae5a432b1ffee4a34a074a4f00 1 parent 8ac7346
Matt Cockayne mattcockayne authored
Showing with 22 additions and 0 deletions.
  1. +22 −0 tests/Zend/Form/ElementTest.php
22 tests/Zend/Form/ElementTest.php
View
@@ -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']);
+ }
}
Please sign in to comment.
Something went wrong with that request. Please try again.