Tests
This commit is contained in:
30
app/tests/acceptance/LoginTest.php
Normal file
30
app/tests/acceptance/LoginTest.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
use PHPUnit\Framework;
|
||||
|
||||
class LoginTest extends Framework\TestCase
|
||||
{
|
||||
public function testShowLogin(): void
|
||||
{
|
||||
$client = $this->getClient();
|
||||
$response = $client->get('/login');
|
||||
$login = $response->getBody()->getContents();
|
||||
$expected = [
|
||||
'<input type="text" id="name" name="name" />',
|
||||
'<input type="password" id="password" name="password" />',
|
||||
'<button class="ui button" id="enter">Ingresar</button>'
|
||||
];
|
||||
foreach ($expected as $segment) {
|
||||
$this->assertStringContainsString($segment, $login);
|
||||
}
|
||||
}
|
||||
public function testDoLogin(): void
|
||||
{
|
||||
$client = $this->getClient();
|
||||
$response = $client->get('/login');
|
||||
}
|
||||
|
||||
protected function getClient(): GuzzleHttp\Client
|
||||
{
|
||||
return new GuzzleHttp\Client(['base_uri' => 'http://proxy']);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user