2015-02-08 22:05:51 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Wallabag\CoreBundle\Tests;
|
|
|
|
|
|
|
|
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
|
|
|
|
2015-02-16 20:28:49 +00:00
|
|
|
abstract class WallabagTestCase extends WebTestCase
|
2015-02-08 22:05:51 +00:00
|
|
|
{
|
|
|
|
private $client = null;
|
|
|
|
|
|
|
|
public function getClient()
|
|
|
|
{
|
|
|
|
return $this->client;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function setUp()
|
|
|
|
{
|
|
|
|
$this->client = static::createClient();
|
|
|
|
}
|
|
|
|
|
2015-02-10 21:32:42 +00:00
|
|
|
public function logInAs($username)
|
2015-02-08 22:05:51 +00:00
|
|
|
{
|
|
|
|
$crawler = $this->client->request('GET', '/login');
|
|
|
|
$form = $crawler->filter('button[type=submit]')->form();
|
|
|
|
$data = array(
|
2015-02-10 21:32:42 +00:00
|
|
|
'_username' => $username,
|
2015-02-17 20:03:23 +00:00
|
|
|
'_password' => 'mypassword',
|
2015-02-08 22:05:51 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
$this->client->submit($form, $data);
|
|
|
|
}
|
|
|
|
}
|