+ if (!$client->getContainer()->getParameter('twofactor_auth')) {
+ $this->markTestSkipped('twofactor_auth is not enabled.');
+
+ return;
+ }
+
+ $client->followRedirects();
+
+ $em = $client->getContainer()->get('doctrine.orm.entity_manager');
+ $user = $em
+ ->getRepository('WallabagUserBundle:User')
+ ->findOneByUsername('admin');
+ $user->setTwoFactorAuthentication(true);
+ $em->persist($user);
+ $em->flush();
+
+ $this->logInAs('admin');
+ $crawler = $client->request('GET', '/config');
+ $this->assertContains('scheb_two_factor.trusted', $crawler->filter('body')->extract(['_text'])[0]);