|
@@ -3,6 +3,7 @@
|
3
|
3
|
namespace Muzich\CoreBundle\Tests\Controller;
|
4
|
4
|
|
5
|
5
|
use Muzich\CoreBundle\lib\FunctionalTest;
|
|
6
|
+use Muzich\CoreBundle\Entity\RegistrationToken;
|
6
|
7
|
|
7
|
8
|
class IndexControllerTest extends FunctionalTest
|
8
|
9
|
{
|
|
@@ -77,6 +78,13 @@ class IndexControllerTest extends FunctionalTest
|
77
|
78
|
|
78
|
79
|
$this->assertEquals('anon.', $this->getUser());
|
79
|
80
|
|
|
81
|
+ // On a besoin d'un token pour le moment
|
|
82
|
+ $token = new RegistrationToken();
|
|
83
|
+ $token->setToken('4vcsdv54svqcc3q1v54sdv6qs');
|
|
84
|
+ $em = $this->getDoctrine()->getEntityManager();
|
|
85
|
+ $em->persist($token);
|
|
86
|
+ $em->flush();
|
|
87
|
+
|
80
|
88
|
$this->exist('div.register');
|
81
|
89
|
$this->exist('form[action="'.($url = $this->generateUrl('register')).'"]');
|
82
|
90
|
$this->exist('form[action="'.$url.'"] input[id="fos_user_registration_form_username"]');
|
|
@@ -89,7 +97,8 @@ class IndexControllerTest extends FunctionalTest
|
89
|
97
|
'raoula',
|
90
|
98
|
'raoula.def4v65sds@gmail.com',
|
91
|
99
|
'toor',
|
92
|
|
- 'toor'
|
|
100
|
+ 'toor',
|
|
101
|
+ '4vcsdv54svqcc3q1v54sdv6qs'
|
93
|
102
|
);
|
94
|
103
|
}
|
95
|
104
|
|
|
@@ -101,12 +110,20 @@ class IndexControllerTest extends FunctionalTest
|
101
|
110
|
*/
|
102
|
111
|
$this->client = self::createClient();
|
103
|
112
|
|
|
113
|
+ // On a besoin d'un token pour le moment
|
|
114
|
+ $token = new RegistrationToken();
|
|
115
|
+ $token->setToken('45gf645jgf6xqz4dc');
|
|
116
|
+ $em = $this->getDoctrine()->getEntityManager();
|
|
117
|
+ $em->persist($token);
|
|
118
|
+ $em->flush();
|
|
119
|
+
|
104
|
120
|
// Mots de passe différents
|
105
|
121
|
$this->procedure_registration_failure(
|
106
|
122
|
'raoulb',
|
107
|
123
|
'raoulb.def4v65sds@gmail.com',
|
108
|
124
|
'toor',
|
109
|
|
- 'toorr'
|
|
125
|
+ 'toorr',
|
|
126
|
+ '45gf645jgf6xqz4dc'
|
110
|
127
|
);
|
111
|
128
|
|
112
|
129
|
// Pseudo trop court
|
|
@@ -114,7 +131,8 @@ class IndexControllerTest extends FunctionalTest
|
114
|
131
|
'ra',
|
115
|
132
|
'raoulb.def4v65sds@gmail.com',
|
116
|
133
|
'toor',
|
117
|
|
- 'toor'
|
|
134
|
+ 'toor',
|
|
135
|
+ '45gf645jgf6xqz4dc'
|
118
|
136
|
);
|
119
|
137
|
|
120
|
138
|
// Pseudo trop long
|
|
@@ -124,7 +142,8 @@ class IndexControllerTest extends FunctionalTest
|
124
|
142
|
.'uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuul',
|
125
|
143
|
'raoulb.def4v65sds@gmail.com',
|
126
|
144
|
'toor',
|
127
|
|
- 'toor'
|
|
145
|
+ 'toor',
|
|
146
|
+ '45gf645jgf6xqz4dc'
|
128
|
147
|
);
|
129
|
148
|
|
130
|
149
|
// Email invalide
|
|
@@ -132,7 +151,8 @@ class IndexControllerTest extends FunctionalTest
|
132
|
151
|
'raoulc',
|
133
|
152
|
'raoulb.def4v65sds@gmail',
|
134
|
153
|
'toor',
|
135
|
|
- 'toor'
|
|
154
|
+ 'toor',
|
|
155
|
+ '45gf645jgf6xqz4dc'
|
136
|
156
|
);
|
137
|
157
|
}
|
138
|
158
|
|