Beispiel #1
0
 public function testTextWithoutFormInstance()
 {
     Former::close();
     $input = Former::text('foo')->data('foo')->class('bar')->__toString();
     $matcher = '<label for="foo">Foo</label><input data="foo" class="bar" type="text" name="foo" id="foo">';
     $this->assertEquals($matcher, $input);
     Former::horizontal_open();
 }
Beispiel #2
0
 public function testCanAddRequiredTextToPlainFields()
 {
     Former::close();
     Former::withRules(array('foo' => 'required'));
     $input = Former::text('foo')->__toString();
     $matcher = '<label for="foo">Foo<sup>*</sup></label><input required="true" type="text" name="foo" id="foo">';
     $this->assertEquals($matcher, $input);
 }
Beispiel #3
0
 /**
  * Closes a form
  *
  * @return string A form closing tag
  * @static 
  */
 public static function close()
 {
     return \Former\Former::close();
 }
Beispiel #4
0
 public function testClose()
 {
     $close = Former::close();
     $this->assertEquals('</form>', $close);
 }
Beispiel #5
0
 public static function tearDownAfterClass()
 {
     \Former\Former::close();
 }
Beispiel #6
0
 public function tearDown()
 {
     \Former\Former::close();
 }