Merge pull request #3615 from notFloran/3612-login-by-email

Allow login by email
This commit is contained in:
Jérémy Benoist 2018-04-03 22:08:42 +02:00 committed by GitHub
commit 11f15430ff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 2 deletions

View file

@ -12,7 +12,7 @@ security:
class: WallabagUserBundle:User class: WallabagUserBundle:User
property: username property: username
fos_userbundle: fos_userbundle:
id: fos_user.user_provider.username id: fos_user.user_provider.username_email
# the main part of the security, where you can set up firewalls # the main part of the security, where you can set up firewalls
# for specific sections of your app # for specific sections of your app

View file

@ -6,6 +6,16 @@ use Tests\Wallabag\CoreBundle\WallabagCoreTestCase;
class SecurityControllerTest extends 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() public function testLoginWithout2Factor()
{ {
$this->logInAs('admin'); $this->logInAs('admin');
@ -81,7 +91,7 @@ class SecurityControllerTest extends WallabagCoreTestCase
} }
$client->followRedirects(); $client->followRedirects();
$crawler = $client->request('GET', '/register'); $client->request('GET', '/register');
$this->assertContains('registration.submit', $client->getResponse()->getContent()); $this->assertContains('registration.submit', $client->getResponse()->getContent());
} }
} }