aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas@loeuillet.org>2015-09-29 18:11:57 +0200
committerJeremy Benoist <jeremy.benoist@gmail.com>2015-10-03 13:30:43 +0200
commit2c13918acc3c46120bbef5e6746f3c6dc27be5df (patch)
tree6e4684c5b6832c98e3aaae915da9330379b7c595 /src/Wallabag
parent359b3f43cc42aa593cdba7dc8e1d6fa121cc3f6a (diff)
downloadwallabag-2c13918acc3c46120bbef5e6746f3c6dc27be5df.tar.gz
wallabag-2c13918acc3c46120bbef5e6746f3c6dc27be5df.tar.zst
wallabag-2c13918acc3c46120bbef5e6746f3c6dc27be5df.zip
add test for confirmed registration
Diffstat (limited to 'src/Wallabag')
-rw-r--r--src/Wallabag/ApiBundle/DependencyInjection/WallabagApiExtension.php2
-rw-r--r--src/Wallabag/CoreBundle/Tests/Controller/SecurityControllerTest.php27
2 files changed, 26 insertions, 3 deletions
diff --git a/src/Wallabag/ApiBundle/DependencyInjection/WallabagApiExtension.php b/src/Wallabag/ApiBundle/DependencyInjection/WallabagApiExtension.php
index a147e7ef..cde43aed 100644
--- a/src/Wallabag/ApiBundle/DependencyInjection/WallabagApiExtension.php
+++ b/src/Wallabag/ApiBundle/DependencyInjection/WallabagApiExtension.php
@@ -3,9 +3,7 @@
3namespace Wallabag\ApiBundle\DependencyInjection; 3namespace Wallabag\ApiBundle\DependencyInjection;
4 4
5use Symfony\Component\DependencyInjection\ContainerBuilder; 5use Symfony\Component\DependencyInjection\ContainerBuilder;
6use Symfony\Component\Config\FileLocator;
7use Symfony\Component\HttpKernel\DependencyInjection\Extension; 6use Symfony\Component\HttpKernel\DependencyInjection\Extension;
8use Symfony\Component\DependencyInjection\Loader;
9 7
10class WallabagApiExtension extends Extension 8class WallabagApiExtension extends Extension
11{ 9{
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();