Exemplo n.º 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();
 }
Exemplo n.º 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);
 }
Exemplo n.º 3
0
 /**
  * Closes a form
  *
  * @return string A form closing tag
  * @static 
  */
 public static function close()
 {
     return \Former\Former::close();
 }
Exemplo n.º 4
0
 public function testClose()
 {
     $close = Former::close();
     $this->assertEquals('</form>', $close);
 }
Exemplo n.º 5
0
 public static function tearDownAfterClass()
 {
     \Former\Former::close();
 }
Exemplo n.º 6
0
 public function tearDown()
 {
     \Former\Former::close();
 }