diff options
author | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2015-09-29 18:11:57 +0200 |
---|---|---|
committer | Jeremy Benoist <jeremy.benoist@gmail.com> | 2015-10-03 13:30:43 +0200 |
commit | 2c13918acc3c46120bbef5e6746f3c6dc27be5df (patch) | |
tree | 6e4684c5b6832c98e3aaae915da9330379b7c595 /src/Wallabag/CoreBundle/Tests | |
parent | 359b3f43cc42aa593cdba7dc8e1d6fa121cc3f6a (diff) | |
download | wallabag-2c13918acc3c46120bbef5e6746f3c6dc27be5df.tar.gz wallabag-2c13918acc3c46120bbef5e6746f3c6dc27be5df.tar.zst wallabag-2c13918acc3c46120bbef5e6746f3c6dc27be5df.zip |
add test for confirmed registration
Diffstat (limited to 'src/Wallabag/CoreBundle/Tests')
-rw-r--r-- | src/Wallabag/CoreBundle/Tests/Controller/SecurityControllerTest.php | 27 |
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(); |