]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Tests/Controller/SecurityControllerTest.php
Convert english translation file
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Tests / Controller / SecurityControllerTest.php
index 3402b3402c73b33569bac7a77987cd4ad8eaf1ed..5c098cc28aa37fa6ed271b93cd68f9a8c85abfd6 100644 (file)
@@ -12,13 +12,19 @@ class SecurityControllerTest extends WallabagCoreTestCase
         $client = $this->getClient();
         $client->followRedirects();
 
-        $client->request('GET', '/config');
-        $this->assertContains('RSS', $client->getResponse()->getContent());
+        $crawler = $client->request('GET', '/config');
+        $this->assertContains('config.form_rss.description', $crawler->filter('body')->extract(array('_text'))[0]);
     }
 
     public function testLoginWith2Factor()
     {
         $client = $this->getClient();
+
+        if (!$client->getContainer()->getParameter('twofactor_auth')) {
+            $this->markTestSkipped('twofactor_auth is not enabled.');
+            return;
+        }
+
         $client->followRedirects();
 
         $em = $client->getContainer()->get('doctrine.orm.entity_manager');
@@ -30,8 +36,8 @@ class SecurityControllerTest extends WallabagCoreTestCase
         $em->flush();
 
         $this->logInAs('admin');
-        $client->request('GET', '/config');
-        $this->assertContains('trusted computer', $client->getResponse()->getContent());
+        $crawler = $client->request('GET', '/config');
+        $this->assertContains('scheb_two_factor.trusted', $crawler->filter('body')->extract(array('_text'))[0]);
 
         // restore user
         $user = $em
@@ -45,6 +51,12 @@ class SecurityControllerTest extends WallabagCoreTestCase
     public function testTrustedComputer()
     {
         $client = $this->getClient();
+
+        if (!$client->getContainer()->getParameter('twofactor_auth')) {
+            $this->markTestSkipped('twofactor_auth is not enabled.');
+            return;
+        }
+
         $em = $client->getContainer()->get('doctrine.orm.entity_manager');
         $user = $em
             ->getRepository('WallabagUserBundle:User')