public function testTextLabelWithoutBootstrap() { Former::framework(null); $static = Former::text('foo')->label('bar', $this->testAttributes)->__toString(); $matcher = '<label for="foo" class="foo" data-foo="bar">Bar</label><input type="text" name="foo" id="foo">'; $this->assertEquals($matcher, $static); $input = Former::text('foo', 'bar')->__toString(); $matcher = '<label for="foo">Bar</label><input type="text" name="foo" id="foo">'; $this->assertEquals($matcher, $input); }
public function setUp() { Input::clear(); \Former\Former::horizontal_open(); \Former\Former::populate(array()); \Former\Former::withErrors(null); \Former\Former::config('automatic_label', true); \Former\Former::config('push_checkboxes', false); \Former\Former::framework('bootstrap'); }
/** * Switch the framework used by Former * * @param string $framework The name of the framework to use * @static */ public static function framework($framework = null) { return \Former\Former::framework($framework); }
public function setUp() { parent::setUp(); Former::framework('zurb'); }
public function testCanGroupCheckboxes() { Former::framework(null); $auto = Former::checkboxes('value[]', '')->checkboxes('Value 01', 'Value 02')->__toString(); $chain = Former::checkboxes('value', '')->grouped()->checkboxes('Value 01', 'Value 02')->__toString(); $this->assertEquals($chain, $auto); $this->assertEquals('<label for="value_0" class="checkbox">' . '<input id="value_0" type="checkbox" name="value[]" value="1">Value 01' . '</label>' . '<label for="value_1" class="checkbox">' . '<input id="value_1" type="checkbox" name="value[]" value="1">Value 02' . '</label>', $auto); }
public function testChangeViaFormer() { Former::framework('zurb'); $this->assertEquals(Framework::current(), 'zurb'); }