Files
bodyrep-sandpit/br/src/BodyRep/Tests/Controller/AuthControllerTest.php
Alex Lewis d6e23f1b44 neh
2012-09-22 13:20:27 +10:00

48 lines
1.2 KiB
PHP

<?php
namespace Bodyrep\Tests\Controller;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\File\File;
class AuthControllerTest extends WebTestCase
{
public function testIndex()
{
$client = static::createClient();
$client->followRedirects(true);
$crawler = $client->request('GET', '/u/login');
$this->assertTrue($crawler->filter('html:contains("Username")')->count() > 0);
}
public function testLogin()
{
$client = static::createClient();
$client->followRedirects(true);
$crawler = $client->request('GET', '/u/login');
$form = $crawler->selectButton('loginbtn')->form();
$crawler = $client->submit($form, array(
'_username' => 'alexl',
'_password' => 'd559ko54'
));
$this->assertTrue($crawler->filter('html:contains("Member")')->count() > 0);
}
public function testLogout()
{
$client = static::createClient();
$client->followRedirects(true);
$crawler = $client->request('GET', '/u/logout');
$this->assertTrue($crawler->filter('html:contains("Landing")')->count() > 0);
}
}
?>