X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=tests%2FWallabag%2FCoreBundle%2FController%2FSecurityControllerTest.php;h=395208a2fe263b3cfe977e03ad5271250f8ce016;hb=84b3bdaac00f3781929779d2ad1fb205aad1ea86;hp=03355f5abde2d02820ea5ce842c8938dccbe8dda;hpb=e408d7e895e784271a55c3a200666034db0af80a;p=github%2Fwallabag%2Fwallabag.git diff --git a/tests/Wallabag/CoreBundle/Controller/SecurityControllerTest.php b/tests/Wallabag/CoreBundle/Controller/SecurityControllerTest.php index 03355f5a..395208a2 100644 --- a/tests/Wallabag/CoreBundle/Controller/SecurityControllerTest.php +++ b/tests/Wallabag/CoreBundle/Controller/SecurityControllerTest.php @@ -6,6 +6,16 @@ use Tests\Wallabag\CoreBundle\WallabagCoreTestCase; class SecurityControllerTest extends WallabagCoreTestCase { + public function testLoginWithEmail() + { + $this->logInAsUsingHttp('bigboss@wallabag.org'); + $client = $this->getClient(); + $client->followRedirects(); + + $crawler = $client->request('GET', '/config'); + $this->assertContains('config.form_rss.description', $crawler->filter('body')->extract(['_text'])[0]); + } + public function testLoginWithout2Factor() { $this->logInAs('admin'); @@ -69,4 +79,19 @@ class SecurityControllerTest extends WallabagCoreTestCase $this->assertTrue($user->isTrustedComputer('ABCDEF')); $this->assertFalse($user->isTrustedComputer('FEDCBA')); } + + public function testEnabledRegistration() + { + $client = $this->getClient(); + + if (!$client->getContainer()->getParameter('fosuser_registration')) { + $this->markTestSkipped('fosuser_registration is not enabled.'); + + return; + } + + $client->followRedirects(); + $client->request('GET', '/register'); + $this->assertContains('registration.submit', $client->getResponse()->getContent()); + } }