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());
 }
 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());
 }
 public function testSetAndGetHelp()
 {
     $element = new Text('test');
     $help = 'this is a help text';
     $element->setHelp($help);
     $this->assertEquals($help, $element->getHelp());
 }
 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());
 }
 public function testRender()
 {
     $text = new Text('test');
     $this->assertEquals('<input id="form_test" class="form-control" name="test" type="text" />', $text->render());
 }
 public function testGetFor()
 {
     $text = new Text('test', ['label' => 'Test Label']);
     $text->addDecorator('label', ['name' => 'label']);
     $this->assertEquals('form_test', $text->getDecorator('label')->getFor());
 }