mirror of
https://github.com/wallabag/wallabag.git
synced 2025-07-17 17:08:37 +00:00
Add some fixtures
Improve test, so user can login Fix some leftJoin Cleanup EntryController
This commit is contained in:
parent
d91691573f
commit
3b815d2de5
11 changed files with 361 additions and 54 deletions
|
@ -0,0 +1,40 @@
|
|||
<?php
|
||||
|
||||
namespace Wallabag\CoreBundle\Tests\Controller;
|
||||
|
||||
use Wallabag\CoreBundle\Tests\WallabagTestCase;
|
||||
|
||||
class SecurityControllerTest extends WallabagTestCase
|
||||
{
|
||||
public function testLogin()
|
||||
{
|
||||
$client = $this->getClient();
|
||||
|
||||
$crawler = $client->request('GET', '/new');
|
||||
|
||||
$this->assertEquals(302, $client->getResponse()->getStatusCode());
|
||||
$this->assertContains('login', $client->getResponse()->headers->get('location'));
|
||||
}
|
||||
|
||||
public function testLoginFail()
|
||||
{
|
||||
$client = $this->getClient();
|
||||
|
||||
$crawler = $client->request('GET', '/login');
|
||||
|
||||
$form = $crawler->filter('button[type=submit]')->form();
|
||||
$data = array(
|
||||
'_username' => 'admin',
|
||||
'_password' => 'admin',
|
||||
);
|
||||
|
||||
$client->submit($form, $data);
|
||||
|
||||
$this->assertEquals(302, $client->getResponse()->getStatusCode());
|
||||
$this->assertContains('login', $client->getResponse()->headers->get('location'));
|
||||
|
||||
$crawler = $client->followRedirect();
|
||||
|
||||
$this->assertContains('Bad credentials', $client->getResponse()->getContent());
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue