Esempio n. 1
0
 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);
 }
Esempio n. 2
0
 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');
 }
Esempio n. 3
0
 /**
  * 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);
 }
Esempio n. 4
0
 public function setUp()
 {
     parent::setUp();
     Former::framework('zurb');
 }
Esempio n. 5
0
 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);
 }
Esempio n. 6
0
 public function testChangeViaFormer()
 {
     Former::framework('zurb');
     $this->assertEquals(Framework::current(), 'zurb');
 }