@@ -32,45 +32,3 @@ |
||
| 32 | 32 | $render = Input::create($type, 'foo'); |
| 33 | 33 | |
| 34 | 34 | $this->assertEquals(<<<'T' |
| 35 | -<div class="form-group"><label for="form_foo">Foo</label><input type="text" id="form_foo" name="form[foo]" class="form-control" /></div> |
|
| 36 | -T, $render); |
|
| 37 | - } |
|
| 38 | - |
|
| 39 | - public function testItRenderMethodType(): void |
|
| 40 | - { |
|
| 41 | - $render = Input::text('foo'); |
|
| 42 | - |
|
| 43 | - $this->assertEquals(<<<'T' |
|
| 44 | -<div class="form-group"><label for="form_foo">Foo</label><input type="text" id="form_foo" name="form[foo]" class="form-control" /></div> |
|
| 45 | -T, $render); |
|
| 46 | - } |
|
| 47 | - |
|
| 48 | - public function testItRenderMethodForm(): void |
|
| 49 | - { |
|
| 50 | - $render = Input::form([]); |
|
| 51 | - |
|
| 52 | - $this->assertEquals(<<<'T' |
|
| 53 | -<form name="form" method="post"> |
|
| 54 | -</form> |
|
| 55 | -T, $render); |
|
| 56 | - } |
|
| 57 | - |
|
| 58 | - public function getTypeNameOptions(): array |
|
| 59 | - { |
|
| 60 | - return [ |
|
| 61 | - ['text'], |
|
| 62 | - [' text '], |
|
| 63 | - [' text'], |
|
| 64 | - ['text '], |
|
| 65 | - ['TEXT '], |
|
| 66 | - ['textType'], |
|
| 67 | - [' textType '], |
|
| 68 | - [' textType'], |
|
| 69 | - ['textType '], |
|
| 70 | - ['TextType '], |
|
| 71 | - ['Texttype '], |
|
| 72 | - ['texttype '], |
|
| 73 | - ['TEXTTYPE '], |
|
| 74 | - ]; |
|
| 75 | - } |
|
| 76 | -} |
|
@@ -32,45 +32,3 @@ |
||
| 32 | 32 | $render = Input::create($type, 'foo'); |
| 33 | 33 | |
| 34 | 34 | $this->assertEquals(<<<'T' |
| 35 | -<div class="form-group"><label for="form_foo">Foo</label><input type="text" id="form_foo" name="form[foo]" class="form-control" /></div> |
|
| 36 | -T, $render); |
|
| 37 | - } |
|
| 38 | - |
|
| 39 | - public function testItRenderMethodType(): void |
|
| 40 | - { |
|
| 41 | - $render = Input::text('foo'); |
|
| 42 | - |
|
| 43 | - $this->assertEquals(<<<'T' |
|
| 44 | -<div class="form-group"><label for="form_foo">Foo</label><input type="text" id="form_foo" name="form[foo]" class="form-control" /></div> |
|
| 45 | -T, $render); |
|
| 46 | - } |
|
| 47 | - |
|
| 48 | - public function testItRenderMethodForm(): void |
|
| 49 | - { |
|
| 50 | - $render = Input::form([]); |
|
| 51 | - |
|
| 52 | - $this->assertEquals(<<<'T' |
|
| 53 | -<form name="form" method="post"> |
|
| 54 | -</form> |
|
| 55 | -T, $render); |
|
| 56 | - } |
|
| 57 | - |
|
| 58 | - public function getTypeNameOptions(): array |
|
| 59 | - { |
|
| 60 | - return [ |
|
| 61 | - ['text'], |
|
| 62 | - [' text '], |
|
| 63 | - [' text'], |
|
| 64 | - ['text '], |
|
| 65 | - ['TEXT '], |
|
| 66 | - ['textType'], |
|
| 67 | - [' textType '], |
|
| 68 | - [' textType'], |
|
| 69 | - ['textType '], |
|
| 70 | - ['TextType '], |
|
| 71 | - ['Texttype '], |
|
| 72 | - ['texttype '], |
|
| 73 | - ['TEXTTYPE '], |
|
| 74 | - ]; |
|
| 75 | - } |
|
| 76 | -} |
|
@@ -32,45 +32,3 @@ |
||
| 32 | 32 | $render = Input::create($type, 'foo'); |
| 33 | 33 | |
| 34 | 34 | $this->assertEquals(<<<'T' |
| 35 | -<div class="form-group"><label for="form_foo">Foo</label><input type="text" id="form_foo" name="form[foo]" class="form-control" /></div> |
|
| 36 | -T, $render); |
|
| 37 | - } |
|
| 38 | - |
|
| 39 | - public function testItRenderMethodType(): void |
|
| 40 | - { |
|
| 41 | - $render = Input::text('foo'); |
|
| 42 | - |
|
| 43 | - $this->assertEquals(<<<'T' |
|
| 44 | -<div class="form-group"><label for="form_foo">Foo</label><input type="text" id="form_foo" name="form[foo]" class="form-control" /></div> |
|
| 45 | -T, $render); |
|
| 46 | - } |
|
| 47 | - |
|
| 48 | - public function testItRenderMethodForm(): void |
|
| 49 | - { |
|
| 50 | - $render = Input::form([]); |
|
| 51 | - |
|
| 52 | - $this->assertEquals(<<<'T' |
|
| 53 | -<form name="form" method="post"> |
|
| 54 | -</form> |
|
| 55 | -T, $render); |
|
| 56 | - } |
|
| 57 | - |
|
| 58 | - public function getTypeNameOptions(): array |
|
| 59 | - { |
|
| 60 | - return [ |
|
| 61 | - ['text'], |
|
| 62 | - [' text '], |
|
| 63 | - [' text'], |
|
| 64 | - ['text '], |
|
| 65 | - ['TEXT '], |
|
| 66 | - ['textType'], |
|
| 67 | - [' textType '], |
|
| 68 | - [' textType'], |
|
| 69 | - ['textType '], |
|
| 70 | - ['TextType '], |
|
| 71 | - ['Texttype '], |
|
| 72 | - ['texttype '], |
|
| 73 | - ['TEXTTYPE '], |
|
| 74 | - ]; |
|
| 75 | - } |
|
| 76 | -} |
|
@@ -32,45 +32,3 @@ |
||
| 32 | 32 | $render = Input::create($type, 'foo'); |
| 33 | 33 | |
| 34 | 34 | $this->assertEquals(<<<'T' |
| 35 | -<div class="form-group"><label for="form_foo">Foo</label><input type="text" id="form_foo" name="form[foo]" class="form-control" /></div> |
|
| 36 | -T, $render); |
|
| 37 | - } |
|
| 38 | - |
|
| 39 | - public function testItRenderMethodType(): void |
|
| 40 | - { |
|
| 41 | - $render = Input::text('foo'); |
|
| 42 | - |
|
| 43 | - $this->assertEquals(<<<'T' |
|
| 44 | -<div class="form-group"><label for="form_foo">Foo</label><input type="text" id="form_foo" name="form[foo]" class="form-control" /></div> |
|
| 45 | -T, $render); |
|
| 46 | - } |
|
| 47 | - |
|
| 48 | - public function testItRenderMethodForm(): void |
|
| 49 | - { |
|
| 50 | - $render = Input::form([]); |
|
| 51 | - |
|
| 52 | - $this->assertEquals(<<<'T' |
|
| 53 | -<form name="form" method="post"> |
|
| 54 | -</form> |
|
| 55 | -T, $render); |
|
| 56 | - } |
|
| 57 | - |
|
| 58 | - public function getTypeNameOptions(): array |
|
| 59 | - { |
|
| 60 | - return [ |
|
| 61 | - ['text'], |
|
| 62 | - [' text '], |
|
| 63 | - [' text'], |
|
| 64 | - ['text '], |
|
| 65 | - ['TEXT '], |
|
| 66 | - ['textType'], |
|
| 67 | - [' textType '], |
|
| 68 | - [' textType'], |
|
| 69 | - ['textType '], |
|
| 70 | - ['TextType '], |
|
| 71 | - ['Texttype '], |
|
| 72 | - ['texttype '], |
|
| 73 | - ['TEXTTYPE '], |
|
| 74 | - ]; |
|
| 75 | - } |
|
| 76 | -} |
|
@@ -32,45 +32,3 @@ |
||
| 32 | 32 | $render = Input::create($type, 'foo'); |
| 33 | 33 | |
| 34 | 34 | $this->assertEquals(<<<'T' |
| 35 | -<div class="form-group"><label for="form_foo">Foo</label><input type="text" id="form_foo" name="form[foo]" class="form-control" /></div> |
|
| 36 | -T, $render); |
|
| 37 | - } |
|
| 38 | - |
|
| 39 | - public function testItRenderMethodType(): void |
|
| 40 | - { |
|
| 41 | - $render = Input::text('foo'); |
|
| 42 | - |
|
| 43 | - $this->assertEquals(<<<'T' |
|
| 44 | -<div class="form-group"><label for="form_foo">Foo</label><input type="text" id="form_foo" name="form[foo]" class="form-control" /></div> |
|
| 45 | -T, $render); |
|
| 46 | - } |
|
| 47 | - |
|
| 48 | - public function testItRenderMethodForm(): void |
|
| 49 | - { |
|
| 50 | - $render = Input::form([]); |
|
| 51 | - |
|
| 52 | - $this->assertEquals(<<<'T' |
|
| 53 | -<form name="form" method="post"> |
|
| 54 | -</form> |
|
| 55 | -T, $render); |
|
| 56 | - } |
|
| 57 | - |
|
| 58 | - public function getTypeNameOptions(): array |
|
| 59 | - { |
|
| 60 | - return [ |
|
| 61 | - ['text'], |
|
| 62 | - [' text '], |
|
| 63 | - [' text'], |
|
| 64 | - ['text '], |
|
| 65 | - ['TEXT '], |
|
| 66 | - ['textType'], |
|
| 67 | - [' textType '], |
|
| 68 | - [' textType'], |
|
| 69 | - ['textType '], |
|
| 70 | - ['TextType '], |
|
| 71 | - ['Texttype '], |
|
| 72 | - ['texttype '], |
|
| 73 | - ['TEXTTYPE '], |
|
| 74 | - ]; |
|
| 75 | - } |
|
| 76 | -} |
|
@@ -12,75 +12,3 @@ |
||
| 12 | 12 | $render = (new FormBuilder([]))->render(); |
| 13 | 13 | |
| 14 | 14 | $this->assertEquals(<<<'T' |
| 15 | -<form name="form" method="post"> |
|
| 16 | -</form> |
|
| 17 | -T, $render); |
|
| 18 | - } |
|
| 19 | - |
|
| 20 | - public function testItWithInputRender(): void |
|
| 21 | - { |
|
| 22 | - $render = (new FormBuilder([ |
|
| 23 | - 'foo' => '<div class="form-group"><label for="form_foo">Foo</label><input type="text" id="form_foo" name="form[foo]" class="form-control" /></div>', |
|
| 24 | - ]))->render(); |
|
| 25 | - |
|
| 26 | - $this->assertEquals(<<<'T' |
|
| 27 | -<form name="form" method="post"> |
|
| 28 | - <div class="form-group"><label for="form_foo">Foo</label><input type="text" id="form_foo" name="form[foo]" class="form-control" /></div> |
|
| 29 | -</form> |
|
| 30 | -T, $render); |
|
| 31 | - } |
|
| 32 | - |
|
| 33 | - public function testItWithInputOptions(): void |
|
| 34 | - { |
|
| 35 | - $render = (new FormBuilder([ |
|
| 36 | - 'foo' => [ |
|
| 37 | - 'type' => 'email', |
|
| 38 | - ], |
|
| 39 | - ]))->render(); |
|
| 40 | - |
|
| 41 | - $this->assertEquals(<<<'T' |
|
| 42 | -<form name="form" method="post"> |
|
| 43 | - <div class="form-group"><label for="form_foo">Foo</label><input type="email" id="form_foo" name="form[foo]" class="form-control" /></div> |
|
| 44 | -</form> |
|
| 45 | -T, $render); |
|
| 46 | - } |
|
| 47 | - |
|
| 48 | - public function testItWithInputs(): void |
|
| 49 | - { |
|
| 50 | - $render = (new FormBuilder([ |
|
| 51 | - 'foo' => [ |
|
| 52 | - 'type' => 'email', |
|
| 53 | - ], |
|
| 54 | - 'bar' => [ |
|
| 55 | - 'type' => 'textarea', |
|
| 56 | - ], |
|
| 57 | - ]))->render(); |
|
| 58 | - |
|
| 59 | - $this->assertEquals(<<<'T' |
|
| 60 | -<form name="form" method="post"> |
|
| 61 | - <div class="form-group"><label for="form_foo">Foo</label><input type="email" id="form_foo" name="form[foo]" class="form-control" /></div> |
|
| 62 | - <div class="form-group"><label for="form_bar">Bar</label><textarea id="form_bar" name="form[bar]" class="form-control"></textarea></div> |
|
| 63 | -</form> |
|
| 64 | -T, $render); |
|
| 65 | - } |
|
| 66 | - |
|
| 67 | - public function testItWithStringTemplate(): void |
|
| 68 | - { |
|
| 69 | - $render = (new FormBuilder([], null, [], '{{ form(form) }}'))->render(); |
|
| 70 | - |
|
| 71 | - $this->assertEquals(<<<'T' |
|
| 72 | -<form name="form" method="post"><div id="form"></div></form> |
|
| 73 | -T, $render); |
|
| 74 | - } |
|
| 75 | - |
|
| 76 | - public function testItWithFileTemplate(): void |
|
| 77 | - { |
|
| 78 | - $file = \sprintf('%1$s/../../Resources/Template.html.twig', __DIR__); |
|
| 79 | - |
|
| 80 | - $render = (new FormBuilder([], null, [], $file))->render(); |
|
| 81 | - |
|
| 82 | - $this->assertEquals(<<<'T' |
|
| 83 | -File: <form name="form" method="post"><div id="form"></div></form> |
|
| 84 | -T, $render); |
|
| 85 | - } |
|
| 86 | -} |
|
@@ -12,75 +12,3 @@ |
||
| 12 | 12 | $render = (new FormBuilder([]))->render(); |
| 13 | 13 | |
| 14 | 14 | $this->assertEquals(<<<'T' |
| 15 | -<form name="form" method="post"> |
|
| 16 | -</form> |
|
| 17 | -T, $render); |
|
| 18 | - } |
|
| 19 | - |
|
| 20 | - public function testItWithInputRender(): void |
|
| 21 | - { |
|
| 22 | - $render = (new FormBuilder([ |
|
| 23 | - 'foo' => '<div class="form-group"><label for="form_foo">Foo</label><input type="text" id="form_foo" name="form[foo]" class="form-control" /></div>', |
|
| 24 | - ]))->render(); |
|
| 25 | - |
|
| 26 | - $this->assertEquals(<<<'T' |
|
| 27 | -<form name="form" method="post"> |
|
| 28 | - <div class="form-group"><label for="form_foo">Foo</label><input type="text" id="form_foo" name="form[foo]" class="form-control" /></div> |
|
| 29 | -</form> |
|
| 30 | -T, $render); |
|
| 31 | - } |
|
| 32 | - |
|
| 33 | - public function testItWithInputOptions(): void |
|
| 34 | - { |
|
| 35 | - $render = (new FormBuilder([ |
|
| 36 | - 'foo' => [ |
|
| 37 | - 'type' => 'email', |
|
| 38 | - ], |
|
| 39 | - ]))->render(); |
|
| 40 | - |
|
| 41 | - $this->assertEquals(<<<'T' |
|
| 42 | -<form name="form" method="post"> |
|
| 43 | - <div class="form-group"><label for="form_foo">Foo</label><input type="email" id="form_foo" name="form[foo]" class="form-control" /></div> |
|
| 44 | -</form> |
|
| 45 | -T, $render); |
|
| 46 | - } |
|
| 47 | - |
|
| 48 | - public function testItWithInputs(): void |
|
| 49 | - { |
|
| 50 | - $render = (new FormBuilder([ |
|
| 51 | - 'foo' => [ |
|
| 52 | - 'type' => 'email', |
|
| 53 | - ], |
|
| 54 | - 'bar' => [ |
|
| 55 | - 'type' => 'textarea', |
|
| 56 | - ], |
|
| 57 | - ]))->render(); |
|
| 58 | - |
|
| 59 | - $this->assertEquals(<<<'T' |
|
| 60 | -<form name="form" method="post"> |
|
| 61 | - <div class="form-group"><label for="form_foo">Foo</label><input type="email" id="form_foo" name="form[foo]" class="form-control" /></div> |
|
| 62 | - <div class="form-group"><label for="form_bar">Bar</label><textarea id="form_bar" name="form[bar]" class="form-control"></textarea></div> |
|
| 63 | -</form> |
|
| 64 | -T, $render); |
|
| 65 | - } |
|
| 66 | - |
|
| 67 | - public function testItWithStringTemplate(): void |
|
| 68 | - { |
|
| 69 | - $render = (new FormBuilder([], null, [], '{{ form(form) }}'))->render(); |
|
| 70 | - |
|
| 71 | - $this->assertEquals(<<<'T' |
|
| 72 | -<form name="form" method="post"><div id="form"></div></form> |
|
| 73 | -T, $render); |
|
| 74 | - } |
|
| 75 | - |
|
| 76 | - public function testItWithFileTemplate(): void |
|
| 77 | - { |
|
| 78 | - $file = \sprintf('%1$s/../../Resources/Template.html.twig', __DIR__); |
|
| 79 | - |
|
| 80 | - $render = (new FormBuilder([], null, [], $file))->render(); |
|
| 81 | - |
|
| 82 | - $this->assertEquals(<<<'T' |
|
| 83 | -File: <form name="form" method="post"><div id="form"></div></form> |
|
| 84 | -T, $render); |
|
| 85 | - } |
|
| 86 | -} |
|
@@ -12,75 +12,3 @@ |
||
| 12 | 12 | $render = (new FormBuilder([]))->render(); |
| 13 | 13 | |
| 14 | 14 | $this->assertEquals(<<<'T' |
| 15 | -<form name="form" method="post"> |
|
| 16 | -</form> |
|
| 17 | -T, $render); |
|
| 18 | - } |
|
| 19 | - |
|
| 20 | - public function testItWithInputRender(): void |
|
| 21 | - { |
|
| 22 | - $render = (new FormBuilder([ |
|
| 23 | - 'foo' => '<div class="form-group"><label for="form_foo">Foo</label><input type="text" id="form_foo" name="form[foo]" class="form-control" /></div>', |
|
| 24 | - ]))->render(); |
|
| 25 | - |
|
| 26 | - $this->assertEquals(<<<'T' |
|
| 27 | -<form name="form" method="post"> |
|
| 28 | - <div class="form-group"><label for="form_foo">Foo</label><input type="text" id="form_foo" name="form[foo]" class="form-control" /></div> |
|
| 29 | -</form> |
|
| 30 | -T, $render); |
|
| 31 | - } |
|
| 32 | - |
|
| 33 | - public function testItWithInputOptions(): void |
|
| 34 | - { |
|
| 35 | - $render = (new FormBuilder([ |
|
| 36 | - 'foo' => [ |
|
| 37 | - 'type' => 'email', |
|
| 38 | - ], |
|
| 39 | - ]))->render(); |
|
| 40 | - |
|
| 41 | - $this->assertEquals(<<<'T' |
|
| 42 | -<form name="form" method="post"> |
|
| 43 | - <div class="form-group"><label for="form_foo">Foo</label><input type="email" id="form_foo" name="form[foo]" class="form-control" /></div> |
|
| 44 | -</form> |
|
| 45 | -T, $render); |
|
| 46 | - } |
|
| 47 | - |
|
| 48 | - public function testItWithInputs(): void |
|
| 49 | - { |
|
| 50 | - $render = (new FormBuilder([ |
|
| 51 | - 'foo' => [ |
|
| 52 | - 'type' => 'email', |
|
| 53 | - ], |
|
| 54 | - 'bar' => [ |
|
| 55 | - 'type' => 'textarea', |
|
| 56 | - ], |
|
| 57 | - ]))->render(); |
|
| 58 | - |
|
| 59 | - $this->assertEquals(<<<'T' |
|
| 60 | -<form name="form" method="post"> |
|
| 61 | - <div class="form-group"><label for="form_foo">Foo</label><input type="email" id="form_foo" name="form[foo]" class="form-control" /></div> |
|
| 62 | - <div class="form-group"><label for="form_bar">Bar</label><textarea id="form_bar" name="form[bar]" class="form-control"></textarea></div> |
|
| 63 | -</form> |
|
| 64 | -T, $render); |
|
| 65 | - } |
|
| 66 | - |
|
| 67 | - public function testItWithStringTemplate(): void |
|
| 68 | - { |
|
| 69 | - $render = (new FormBuilder([], null, [], '{{ form(form) }}'))->render(); |
|
| 70 | - |
|
| 71 | - $this->assertEquals(<<<'T' |
|
| 72 | -<form name="form" method="post"><div id="form"></div></form> |
|
| 73 | -T, $render); |
|
| 74 | - } |
|
| 75 | - |
|
| 76 | - public function testItWithFileTemplate(): void |
|
| 77 | - { |
|
| 78 | - $file = \sprintf('%1$s/../../Resources/Template.html.twig', __DIR__); |
|
| 79 | - |
|
| 80 | - $render = (new FormBuilder([], null, [], $file))->render(); |
|
| 81 | - |
|
| 82 | - $this->assertEquals(<<<'T' |
|
| 83 | -File: <form name="form" method="post"><div id="form"></div></form> |
|
| 84 | -T, $render); |
|
| 85 | - } |
|
| 86 | -} |
|
@@ -12,75 +12,3 @@ |
||
| 12 | 12 | $render = (new FormBuilder([]))->render(); |
| 13 | 13 | |
| 14 | 14 | $this->assertEquals(<<<'T' |
| 15 | -<form name="form" method="post"> |
|
| 16 | -</form> |
|
| 17 | -T, $render); |
|
| 18 | - } |
|
| 19 | - |
|
| 20 | - public function testItWithInputRender(): void |
|
| 21 | - { |
|
| 22 | - $render = (new FormBuilder([ |
|
| 23 | - 'foo' => '<div class="form-group"><label for="form_foo">Foo</label><input type="text" id="form_foo" name="form[foo]" class="form-control" /></div>', |
|
| 24 | - ]))->render(); |
|
| 25 | - |
|
| 26 | - $this->assertEquals(<<<'T' |
|
| 27 | -<form name="form" method="post"> |
|
| 28 | - <div class="form-group"><label for="form_foo">Foo</label><input type="text" id="form_foo" name="form[foo]" class="form-control" /></div> |
|
| 29 | -</form> |
|
| 30 | -T, $render); |
|
| 31 | - } |
|
| 32 | - |
|
| 33 | - public function testItWithInputOptions(): void |
|
| 34 | - { |
|
| 35 | - $render = (new FormBuilder([ |
|
| 36 | - 'foo' => [ |
|
| 37 | - 'type' => 'email', |
|
| 38 | - ], |
|
| 39 | - ]))->render(); |
|
| 40 | - |
|
| 41 | - $this->assertEquals(<<<'T' |
|
| 42 | -<form name="form" method="post"> |
|
| 43 | - <div class="form-group"><label for="form_foo">Foo</label><input type="email" id="form_foo" name="form[foo]" class="form-control" /></div> |
|
| 44 | -</form> |
|
| 45 | -T, $render); |
|
| 46 | - } |
|
| 47 | - |
|
| 48 | - public function testItWithInputs(): void |
|
| 49 | - { |
|
| 50 | - $render = (new FormBuilder([ |
|
| 51 | - 'foo' => [ |
|
| 52 | - 'type' => 'email', |
|
| 53 | - ], |
|
| 54 | - 'bar' => [ |
|
| 55 | - 'type' => 'textarea', |
|
| 56 | - ], |
|
| 57 | - ]))->render(); |
|
| 58 | - |
|
| 59 | - $this->assertEquals(<<<'T' |
|
| 60 | -<form name="form" method="post"> |
|
| 61 | - <div class="form-group"><label for="form_foo">Foo</label><input type="email" id="form_foo" name="form[foo]" class="form-control" /></div> |
|
| 62 | - <div class="form-group"><label for="form_bar">Bar</label><textarea id="form_bar" name="form[bar]" class="form-control"></textarea></div> |
|
| 63 | -</form> |
|
| 64 | -T, $render); |
|
| 65 | - } |
|
| 66 | - |
|
| 67 | - public function testItWithStringTemplate(): void |
|
| 68 | - { |
|
| 69 | - $render = (new FormBuilder([], null, [], '{{ form(form) }}'))->render(); |
|
| 70 | - |
|
| 71 | - $this->assertEquals(<<<'T' |
|
| 72 | -<form name="form" method="post"><div id="form"></div></form> |
|
| 73 | -T, $render); |
|
| 74 | - } |
|
| 75 | - |
|
| 76 | - public function testItWithFileTemplate(): void |
|
| 77 | - { |
|
| 78 | - $file = \sprintf('%1$s/../../Resources/Template.html.twig', __DIR__); |
|
| 79 | - |
|
| 80 | - $render = (new FormBuilder([], null, [], $file))->render(); |
|
| 81 | - |
|
| 82 | - $this->assertEquals(<<<'T' |
|
| 83 | -File: <form name="form" method="post"><div id="form"></div></form> |
|
| 84 | -T, $render); |
|
| 85 | - } |
|
| 86 | -} |
|
@@ -12,75 +12,3 @@ |
||
| 12 | 12 | $render = (new FormBuilder([]))->render(); |
| 13 | 13 | |
| 14 | 14 | $this->assertEquals(<<<'T' |
| 15 | -<form name="form" method="post"> |
|
| 16 | -</form> |
|
| 17 | -T, $render); |
|
| 18 | - } |
|
| 19 | - |
|
| 20 | - public function testItWithInputRender(): void |
|
| 21 | - { |
|
| 22 | - $render = (new FormBuilder([ |
|
| 23 | - 'foo' => '<div class="form-group"><label for="form_foo">Foo</label><input type="text" id="form_foo" name="form[foo]" class="form-control" /></div>', |
|
| 24 | - ]))->render(); |
|
| 25 | - |
|
| 26 | - $this->assertEquals(<<<'T' |
|
| 27 | -<form name="form" method="post"> |
|
| 28 | - <div class="form-group"><label for="form_foo">Foo</label><input type="text" id="form_foo" name="form[foo]" class="form-control" /></div> |
|
| 29 | -</form> |
|
| 30 | -T, $render); |
|
| 31 | - } |
|
| 32 | - |
|
| 33 | - public function testItWithInputOptions(): void |
|
| 34 | - { |
|
| 35 | - $render = (new FormBuilder([ |
|
| 36 | - 'foo' => [ |
|
| 37 | - 'type' => 'email', |
|
| 38 | - ], |
|
| 39 | - ]))->render(); |
|
| 40 | - |
|
| 41 | - $this->assertEquals(<<<'T' |
|
| 42 | -<form name="form" method="post"> |
|
| 43 | - <div class="form-group"><label for="form_foo">Foo</label><input type="email" id="form_foo" name="form[foo]" class="form-control" /></div> |
|
| 44 | -</form> |
|
| 45 | -T, $render); |
|
| 46 | - } |
|
| 47 | - |
|
| 48 | - public function testItWithInputs(): void |
|
| 49 | - { |
|
| 50 | - $render = (new FormBuilder([ |
|
| 51 | - 'foo' => [ |
|
| 52 | - 'type' => 'email', |
|
| 53 | - ], |
|
| 54 | - 'bar' => [ |
|
| 55 | - 'type' => 'textarea', |
|
| 56 | - ], |
|
| 57 | - ]))->render(); |
|
| 58 | - |
|
| 59 | - $this->assertEquals(<<<'T' |
|
| 60 | -<form name="form" method="post"> |
|
| 61 | - <div class="form-group"><label for="form_foo">Foo</label><input type="email" id="form_foo" name="form[foo]" class="form-control" /></div> |
|
| 62 | - <div class="form-group"><label for="form_bar">Bar</label><textarea id="form_bar" name="form[bar]" class="form-control"></textarea></div> |
|
| 63 | -</form> |
|
| 64 | -T, $render); |
|
| 65 | - } |
|
| 66 | - |
|
| 67 | - public function testItWithStringTemplate(): void |
|
| 68 | - { |
|
| 69 | - $render = (new FormBuilder([], null, [], '{{ form(form) }}'))->render(); |
|
| 70 | - |
|
| 71 | - $this->assertEquals(<<<'T' |
|
| 72 | -<form name="form" method="post"><div id="form"></div></form> |
|
| 73 | -T, $render); |
|
| 74 | - } |
|
| 75 | - |
|
| 76 | - public function testItWithFileTemplate(): void |
|
| 77 | - { |
|
| 78 | - $file = \sprintf('%1$s/../../Resources/Template.html.twig', __DIR__); |
|
| 79 | - |
|
| 80 | - $render = (new FormBuilder([], null, [], $file))->render(); |
|
| 81 | - |
|
| 82 | - $this->assertEquals(<<<'T' |
|
| 83 | -File: <form name="form" method="post"><div id="form"></div></form> |
|
| 84 | -T, $render); |
|
| 85 | - } |
|
| 86 | -} |
|