mirror of
https://github.com/wallabag/wallabag.git
synced 2025-09-15 18:57:05 +00:00
Change the way to login user in tests
Instead of using a HTTP request we just login user like FOSUser does. It allows us to mock service in container for functional tests. Also, fix a bad config name in fos_user for firewall And finally, add functional test to PocketImport
This commit is contained in:
parent
2bc9cad78e
commit
fdc90ceb17
6 changed files with 90 additions and 9 deletions
|
@ -36,7 +36,7 @@ class SecurityControllerTest extends WallabagCoreTestCase
|
|||
$em->persist($user);
|
||||
$em->flush();
|
||||
|
||||
$this->logInAs('admin');
|
||||
$this->logInAsUsingHttp('admin');
|
||||
$crawler = $client->request('GET', '/config');
|
||||
$this->assertContains('scheb_two_factor.trusted', $crawler->filter('body')->extract(['_text'])[0]);
|
||||
|
||||
|
|
|
@ -39,6 +39,12 @@ class TagControllerTest extends WallabagCoreTestCase
|
|||
$client->submit($form, $data);
|
||||
$this->assertEquals(302, $client->getResponse()->getStatusCode());
|
||||
|
||||
// be sure to reload the entry
|
||||
$entry = $client->getContainer()
|
||||
->get('doctrine.orm.entity_manager')
|
||||
->getRepository('WallabagCoreBundle:Entry')
|
||||
->findOneByUsernameAndNotArchived('admin');
|
||||
|
||||
$this->assertEquals(1, count($entry->getTags()));
|
||||
|
||||
# tag already exists and already assigned
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue