Tests Home

This commit is contained in:
Juan Pablo Vial
2025-04-29 21:42:57 -04:00
parent 2acf0362fa
commit dd82ac6bb7
2 changed files with 29 additions and 3 deletions

View File

@ -0,0 +1,21 @@
<?php
namespace ProVM\Integration;
use PHPUnit\Framework\TestCase;
use GuzzleHttp\Client;
class HomeTest extends TestCase
{
protected Client $client;
protected function setUp(): void
{
$this->client = new Client(['base_uri' => $_ENV['APP_URL']]);
}
public function testLoad(): void
{
$response = $this->client->get('/');
$this->assertEquals(200, $response->getStatusCode());
$this->assertStringContainsString('Incoviba', $response->getBody()->getContents());
}
}

View File

@ -1,16 +1,21 @@
<?php
namespace ProVM\Performance;
use GuzzleHttp\Client;
use PHPUnit\Framework;
use GuzzleHttp\Client;
class HomeTest extends Framework\TestCase
{
protected Client $client;
protected function setUp(): void
{
$this->client = new Client(['base_uri' => $_ENV['APP_URL']]);
}
public function testLoad(): void
{
$client = new Client(['base_uri' => 'http://proxy']);
$start = microtime(true);
$response = $client->get('');
$this->client->get('/');
$end = microtime(true);
$this->assertLessThanOrEqual(1000, $end - $start);
}