forked from wallabag/wallabag
Move API stuff in ApiBundle
This commit is contained in:
32
src/Wallabag/CoreBundle/Tests/WallabagCoreTestCase.php
Normal file
32
src/Wallabag/CoreBundle/Tests/WallabagCoreTestCase.php
Normal file
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\CoreBundle\Tests;
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
||||
|
||||
abstract class WallabagCoreTestCase extends WebTestCase
|
||||
{
|
||||
private $client = null;
|
||||
|
||||
public function getClient()
|
||||
{
|
||||
return $this->client;
|
||||
}
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
$this->client = static::createClient();
|
||||
}
|
||||
|
||||
public function logInAs($username)
|
||||
{
|
||||
$crawler = $this->client->request('GET', '/login');
|
||||
$form = $crawler->filter('button[type=submit]')->form();
|
||||
$data = array(
|
||||
'_username' => $username,
|
||||
'_password' => 'mypassword',
|
||||
);
|
||||
|
||||
$this->client->submit($form, $data);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user