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

33 lines
687 B
PHP
Raw Normal View History

<?php
namespace Wallabag\CoreBundle\Tests;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
2015-03-29 08:53:10 +00:00
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,
2015-02-17 20:03:23 +00:00
'_password' => 'mypassword',
);
$this->client->submit($form, $data);
}
}