wallabag/src/Wallabag/CoreBundle/Tests/WallabagTestCase.php

33 lines
677 B
PHP
Raw Normal View History

<?php
namespace Wallabag\CoreBundle\Tests;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
2015-02-16 20:28:49 +00:00
abstract class WallabagTestCase 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' => 'test',
);
$this->client->submit($form, $data);
}
}