mirror of
https://github.com/bodyrep/bodyrep-sandpit.git
synced 2026-03-16 01:45:31 +00:00
48 lines
1.2 KiB
PHP
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);
|
|
}
|
|
|
|
}
|
|
?>
|