$data = [
'config[theme]' => 'baggy',
'config[items_per_page]' => '30',
- 'config[reading_speed]' => '0.5',
+ 'config[reading_speed]' => '100',
'config[action_mark_as_read]' => '0',
'config[language]' => 'en',
];
$crawler = $client->request('GET', '/config');
$form = $crawler->filter('button[id=config_save]')->form();
$data = [
- 'config[reading_speed]' => '2',
+ 'config[reading_speed]' => '400',
];
$client->submit($form, $data);
$crawler = $client->request('GET', '/config');
$form = $crawler->filter('button[id=config_save]')->form();
$data = [
- 'config[reading_speed]' => '0.5',
+ 'config[reading_speed]' => '100',
];
$client->submit($form, $data);
}
$config->setTheme('material');
$config->setItemsPerPage(30);
- $config->setReadingSpeed(1);
+ $config->setReadingSpeed(200);
$config->setLanguage('en');
$config->setPocketConsumerKey('xxxxx');
$em->flush();
}
+ public function testUserDisable2faEmail()
+ {
+ $this->logInAs('admin');
+ $client = $this->getClient();
+
+ $crawler = $client->request('GET', '/config/otp/email/disable');
+
+ $this->assertSame(302, $client->getResponse()->getStatusCode());
+
+ $crawler = $client->followRedirect();
+
+ $this->assertGreaterThan(1, $alert = $crawler->filter('body')->extract(['_text']));
+ $this->assertContains('flashes.config.notice.otp_disabled', $alert[0]);
+
+ // restore user
+ $em = $this->getEntityManager();
+ $user = $em
+ ->getRepository('WallabagUserBundle:User')
+ ->findOneByUsername('admin');
+
+ $this->assertFalse($user->isEmailTwoFactor());
+ }
+
public function testUserEnable2faGoogle()
{
$this->logInAs('admin');
$this->assertEmpty($user->getBackupCodes());
}
+ public function testUserDisable2faGoogle()
+ {
+ $this->logInAs('admin');
+ $client = $this->getClient();
+
+ $crawler = $client->request('GET', '/config/otp/app/disable');
+
+ $this->assertSame(302, $client->getResponse()->getStatusCode());
+
+ $crawler = $client->followRedirect();
+
+ $this->assertGreaterThan(1, $alert = $crawler->filter('body')->extract(['_text']));
+ $this->assertContains('flashes.config.notice.otp_disabled', $alert[0]);
+
+ // restore user
+ $em = $this->getEntityManager();
+ $user = $em
+ ->getRepository('WallabagUserBundle:User')
+ ->findOneByUsername('admin');
+
+ $this->assertEmpty($user->getGoogleAuthenticatorSecret());
+ $this->assertEmpty($user->getBackupCodes());
+ }
+
public function testExportTaggingRule()
{
$this->logInAs('admin');