@@ -15,7 +15,6 @@ |
||
| 15 | 15 | /** |
| 16 | 16 | * Class UserType |
| 17 | 17 | * @package AppBundle\Form |
| 18 | - |
|
| 19 | 18 | */ |
| 20 | 19 | class RegistrationType extends AbstractType |
| 21 | 20 | { |
@@ -73,7 +73,7 @@ |
||
| 73 | 73 | { |
| 74 | 74 | $resolver->setDefaults(array( |
| 75 | 75 | 'data_class' => User::class, |
| 76 | - 'validation_groups' => array('registration','edit'), |
|
| 76 | + 'validation_groups' => array('registration', 'edit'), |
|
| 77 | 77 | )); |
| 78 | 78 | } |
| 79 | 79 | } |
@@ -15,7 +15,6 @@ |
||
| 15 | 15 | /** |
| 16 | 16 | * Class UserType |
| 17 | 17 | * @package AppBundle\Form |
| 18 | - |
|
| 19 | 18 | */ |
| 20 | 19 | class EditType extends AbstractType |
| 21 | 20 | { |
@@ -73,7 +73,7 @@ |
||
| 73 | 73 | { |
| 74 | 74 | $resolver->setDefaults(array( |
| 75 | 75 | 'data_class' => User::class, |
| 76 | - 'validation_groups' => array('registration','edit'), |
|
| 76 | + 'validation_groups' => array('registration', 'edit'), |
|
| 77 | 77 | )); |
| 78 | 78 | } |
| 79 | 79 | } |
@@ -12,7 +12,6 @@ |
||
| 12 | 12 | /** |
| 13 | 13 | * Class UserType |
| 14 | 14 | * @package AppBundle\Form |
| 15 | - |
|
| 16 | 15 | */ |
| 17 | 16 | class ActivationType extends AbstractType |
| 18 | 17 | { |
@@ -73,7 +73,7 @@ |
||
| 73 | 73 | { |
| 74 | 74 | $resolver->setDefaults(array( |
| 75 | 75 | 'data_class' => User::class, |
| 76 | - 'validation_groups' => array('registration','edit'), |
|
| 76 | + 'validation_groups' => array('registration', 'edit'), |
|
| 77 | 77 | )); |
| 78 | 78 | } |
| 79 | 79 | } |
@@ -40,7 +40,7 @@ |
||
| 40 | 40 | ->orWhere( |
| 41 | 41 | $postsQuery->expr()->like('u.email', ':name') |
| 42 | 42 | ) |
| 43 | - ->setParameter('name', '%' . $filter->name . '%'); |
|
| 43 | + ->setParameter('name', '%'.$filter->name.'%'); |
|
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | return $postsQuery->getQuery(); |
@@ -3,8 +3,6 @@ |
||
| 3 | 3 | namespace Tests\AppBundle\Controller; |
| 4 | 4 | |
| 5 | 5 | use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; |
| 6 | -use Symfony\Component\DependencyInjection\ContainerInterface; |
|
| 7 | -use Doctrine\ORM\EntityManager; |
|
| 8 | 6 | use AppBundle\Entity\User; |
| 9 | 7 | |
| 10 | 8 | class UserControllerTest extends WebTestCase |
@@ -63,7 +63,7 @@ |
||
| 63 | 63 | |
| 64 | 64 | $form = $crawler->filter('table td form')->form(); |
| 65 | 65 | $url_params = explode('/', $form->getUri()); |
| 66 | - $userid = $url_params[count($url_params)-1]; |
|
| 66 | + $userid = $url_params[count($url_params) - 1]; |
|
| 67 | 67 | |
| 68 | 68 | $client->submit($form, ['activation[enabled]' => false]); |
| 69 | 69 | $user = $em->getRepository('AppBundle:User')->findOneBy(array("id" => $userid)); |
@@ -98,9 +98,10 @@ |
||
| 98 | 98 | 'validation_groups' => array('registration'), |
| 99 | 99 | ]); |
| 100 | 100 | $form->handleRequest($request); |
| 101 | - if ($form->isSubmitted()) |
|
| 102 | - if ($form->isValid()) { |
|
| 101 | + if ($form->isSubmitted()) { |
|
| 102 | + if ($form->isValid()) { |
|
| 103 | 103 | $em->persist($user); |
| 104 | + } |
|
| 104 | 105 | $em->flush(); |
| 105 | 106 | |
| 106 | 107 | return $this->redirect($this->generateUrl("users_list")); |