diff options
Diffstat (limited to 'src/Wallabag')
-rw-r--r-- | src/Wallabag/ApiBundle/DependencyInjection/WallabagApiExtension.php | 2 | ||||
-rw-r--r-- | src/Wallabag/CoreBundle/Tests/Controller/SecurityControllerTest.php | 27 |
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 @@ | |||
3 | namespace Wallabag\ApiBundle\DependencyInjection; | 3 | namespace Wallabag\ApiBundle\DependencyInjection; |
4 | 4 | ||
5 | use Symfony\Component\DependencyInjection\ContainerBuilder; | 5 | use Symfony\Component\DependencyInjection\ContainerBuilder; |
6 | use Symfony\Component\Config\FileLocator; | ||
7 | use Symfony\Component\HttpKernel\DependencyInjection\Extension; | 6 | use Symfony\Component\HttpKernel\DependencyInjection\Extension; |
8 | use Symfony\Component\DependencyInjection\Loader; | ||
9 | 7 | ||
10 | class WallabagApiExtension extends Extension | 8 | class 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(); |