예제 #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();
 }
예제 #2
0
 public function testChainedMethods()
 {
     $open1 = Former::open('test')->secure()->addClass('foo')->method('GET')->__toString();
     $open2 = Former::horizontal_open('#')->class('form-vertical bar')->__toString();
     $matcher1 = '<form class="form-horizontal foo" method="GET" action="https://test/en/test" accept-charset="UTF-8">';
     $matcher2 = $this->createMatcher('form-vertical bar');
     $this->assertEquals($matcher1, $open1);
     $this->assertEquals($matcher2, $open2);
 }
예제 #3
0
파일: start.php 프로젝트: raftalks/former
 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');
 }
예제 #4
0
 public function testHorizontalOpen()
 {
     $open = Former::horizontal_open('#');
     $matcher = $this->createMatcher();
     $this->assertEquals($matcher, $open);
 }
예제 #5
0
 public static function setUpBeforeClass()
 {
     \Former\Former::horizontal_open();
 }