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