mirror of
https://github.com/bodyrep/bodyrep-sandpit.git
synced 2026-03-17 02:15:57 +00:00
neh
This commit is contained in:
47
br/src/BodyRep/Tests/Controller/AuthControllerTest.php
Normal file
47
br/src/BodyRep/Tests/Controller/AuthControllerTest.php
Normal file
@@ -0,0 +1,47 @@
|
||||
<?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);
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user