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

33 lines
683 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,
2015-02-17 20:03:23 +00:00
'_password' => 'mypassword',
);
$this->client->submit($form, $data);
}
}