aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Tests/Controller/SecurityControllerTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/Wallabag/CoreBundle/Tests/Controller/SecurityControllerTest.php')
-rw-r--r--src/Wallabag/CoreBundle/Tests/Controller/SecurityControllerTest.php27
1 files changed, 26 insertions, 1 deletions
diff --git a/src/Wallabag/CoreBundle/Tests/Controller/SecurityControllerTest.php b/src/Wallabag/CoreBundle/Tests/Controller/SecurityControllerTest.php
index 78b4952e..7af9d5c4 100644
--- a/src/Wallabag/CoreBundle/Tests/Controller/SecurityControllerTest.php
+++ b/src/Wallabag/CoreBundle/Tests/Controller/SecurityControllerTest.php
@@ -78,7 +78,7 @@ class SecurityControllerTest extends WallabagCoreTestCase
78 'fos_user_registration_form[plainPassword][first]' => 'mypassword', 78 'fos_user_registration_form[plainPassword][first]' => 'mypassword',
79 'fos_user_registration_form[plainPassword][second]' => 'mypassword', 79 'fos_user_registration_form[plainPassword][second]' => 'mypassword',
80 ), 80 ),
81 ) 81 ),
82 ); 82 );
83 } 83 }
84 84
@@ -101,6 +101,31 @@ class SecurityControllerTest extends WallabagCoreTestCase
101 $this->assertContains('The user has been created successfully', $client->getResponse()->getContent()); 101 $this->assertContains('The user has been created successfully', $client->getResponse()->getContent());
102 } 102 }
103 103
104 public function testRegistrationConfirmation()
105 {
106 $client = $this->getClient();
107 $client->followRedirects();
108
109 $user = $client->getContainer()
110 ->get('doctrine.orm.entity_manager')
111 ->getRepository('WallabagCoreBundle:User')
112 ->findOneByUsername('newuser');
113
114 $this->assertNull($user->getConfig());
115
116 $client->request('GET', '/register/confirm/b4dT0k3n');
117 $this->assertEquals(404, $client->getResponse()->getStatusCode());
118
119 $crawler = $client->request('GET', '/register/confirm/'.$user->getConfirmationToken());
120 $this->assertEquals(200, $client->getResponse()->getStatusCode());
121
122 $user = $client->getContainer()
123 ->get('doctrine.orm.entity_manager')
124 ->getRepository('WallabagCoreBundle:User')
125 ->findOneByUsername('newuser');
126 $this->assertNotNull($user->getConfig());
127 }
128
104 public function testLogin() 129 public function testLogin()
105 { 130 {
106 $client = $this->getClient(); 131 $client = $this->getClient();