- $date = new \DateTime();
- $user->addTrustedComputer('ABCDEF', $date->add(new \DateInterval('P1M')));
- $this->assertTrue($user->isTrustedComputer('ABCDEF'));
- $this->assertFalse($user->isTrustedComputer('FEDCBA'));
+ // restore user
+ $user = $em
+ ->getRepository('WallabagUserBundle:User')
+ ->findOneByUsername('admin');
+ $user->setGoogleAuthenticatorSecret(null);
+ $em->persist($user);
+ $em->flush();
+ }
+
+ 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());