This commit is contained in:
Juan Pablo Vial
2024-03-20 13:46:56 -03:00
parent ca958b8a88
commit 6617a92f5f
8 changed files with 209 additions and 0 deletions

View File

@ -0,0 +1,22 @@
<?php
use PHPUnit\Framework;
class HomeTest extends Framework\TestCase
{
public function testLoadHome(): void
{
$client = new GuzzleHttp\Client(['base_uri' => 'http://proxy']);
$home = $client->get('');
$home = $home->getBody()->getContents();
$expected = [
'<!DOCTYPE html>',
'<title>Incoviba</title>',
'<img src="http://localhost:8080/assets/images/logo_cabezal.png" alt="logo" />',
'Bienvenid@ a Incoviba'
];
foreach ($expected as $segment) {
$this->assertStringContainsString($segment, $home);
}
}
}

View 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']);
}
}