Exemplo n.º 1
0
 /** @test */
 public function it_can_change_template_with_options()
 {
     $expectedOptions = $this->getDefaults(['type' => 'submit'], 'Some submit');
     $expectedOptions['wrapper'] = false;
     $expectedOptions['wrapperAttrs'] = null;
     $expectedViewData = ['name' => 'some_submit', 'nameKey' => 'some_submit', 'type' => 'submit', 'options' => $expectedOptions, 'showLabel' => true, 'showField' => true, 'showError' => true];
     $button = new ButtonType('some_submit', 'submit', $this->plainForm);
     $button->render();
 }
 /** @test */
 public function it_can_change_template_with_options()
 {
     $expectedOptions = $this->getDefaults(['type' => 'submit'], 'Some submit');
     $expectedOptions['wrapper'] = false;
     $expectedOptions['wrapperAttrs'] = null;
     $expectedOptions['template'] = 'laravel-form-builder::text';
     $expectedViewData = ['name' => 'some_submit', 'nameKey' => 'some_submit', 'type' => 'submit', 'options' => $expectedOptions, 'showLabel' => true, 'showField' => true, 'showError' => true];
     $button = new ButtonType('some_submit', 'submit', $this->plainForm, ['template' => 'laravel-form-builder::text']);
     $renderedView = $button->render();
     $this->assertEquals($expectedOptions, $button->getOptions());
     $this->assertContains('<input', $renderedView);
 }