Exemplo n.º 1
0
 public function testRender()
 {
     $text = new Text('test');
     $text->addDecorator('inputGroup', ['prependAddon' => '@', 'appendAddon' => '*']);
     $expected = '<div class="input-group">' . '<span class="input-group-addon">@</span>' . '<input id="form_test" class="form-control" name="test" type="text" />' . '<span class="input-group-addon">*</span>' . '</div>';
     $this->assertEquals($expected, $text->render());
 }
Exemplo n.º 2
0
 public function testRender()
 {
     $text = new Text('test');
     $text->addDecorator('wrapper', ['name' => 'formgroup', 'class' => 'form-group']);
     $expected = '<div class="form-group">' . '<input id="form_test" class="form-control" name="test" type="text" />' . '</div>';
     $this->assertEquals($expected, $text->render());
 }
Exemplo n.º 3
0
 public function testSetAndGetHelp()
 {
     $element = new Text('test');
     $help = 'this is a help text';
     $element->setHelp($help);
     $this->assertEquals($help, $element->getHelp());
 }
Exemplo n.º 4
0
 public function testSetPlacementBefore()
 {
     $text = new Text('test');
     $text->addDecorator('helpblock', ['name' => 'helpblock', 'placement' => 'before']);
     $text->setHelp('This is a help text!');
     $expected = '<span class="help-block">This is a help text!</span>' . '<input id="form_test" class="form-control" name="test" type="text" />';
     $this->assertEquals($expected, $text->render());
 }
Exemplo n.º 5
0
 public function testRender()
 {
     $text = new Text('test');
     $this->assertEquals('<input id="form_test" class="form-control" name="test" type="text" />', $text->render());
 }
Exemplo n.º 6
0
 public function testGetFor()
 {
     $text = new Text('test', ['label' => 'Test Label']);
     $text->addDecorator('label', ['name' => 'label']);
     $this->assertEquals('form_test', $text->getDecorator('label')->getFor());
 }