11<?php
2+ namespace Barryvdh \Form \Tests ;
23
34use Barryvdh \Form \Facade \FormFactory ;
5+ use Barryvdh \Form \Tests \Types \UserFormType ;
46use Symfony \Component \Form \Extension \Core \Type \FormType ;
57use Symfony \Component \Form \Extension \Core \Type \TextType ;
68use Symfony \Component \Form \Extension \Core \Type \EmailType ;
@@ -22,11 +24,7 @@ protected function getEnvironmentSetUp($app)
2224 $ app ['router ' ]->any ('create ' , function () {
2325 $ user = [];
2426
25- $ form = FormFactory::create (FormType::class, $ user )
26- ->add ('name ' , TextType::class)
27- ->add ('email ' , EmailType::class, [
28- 'rules ' => 'email ' ,
29- ])
27+ $ form = FormFactory::create (UserFormType::class, $ user )
3028 ->add ('save ' , SubmitType::class, ['label ' => 'Save user ' ]);
3129
3230 $ form ->handleRequest ();
@@ -52,7 +50,7 @@ public function testInlineForm()
5250 {
5351 $ crawler = $ this ->call ('GET ' , 'create ' );
5452
55- $ this ->assertContains ('<form name="form " method="post"> ' , $ crawler ->getContent ());
53+ $ this ->assertContains ('<form name="user_form " method="post"> ' , $ crawler ->getContent ());
5654 }
5755
5856 /**
@@ -63,7 +61,7 @@ public function testInlineForm()
6361 public function testPostFormInvalid ()
6462 {
6563 $ crawler = $ this ->call ('POST ' , 'create ' , [
66- 'form ' => ['save ' => true ]
64+ 'user_form ' => ['save ' => true ]
6765 ]);
6866
6967 $ this ->assertEquals ('invalid ' , $ crawler ->getContent ());
@@ -77,7 +75,7 @@ public function testPostFormInvalid()
7775 public function testPostForm ()
7876 {
7977 $ crawler = $ this ->call ('POST ' , 'create ' , [
80- 'form ' => [
78+ 'user_form ' => [
8179 'name ' => 'Barry ' ,
8280 'email ' => 'barryvdh@gmail.com ' ,
8381 'save ' => true
0 commit comments