Tests Home
This commit is contained in:
21
app/tests/integration/HomeTest.php
Normal file
21
app/tests/integration/HomeTest.php
Normal 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());
|
||||||
|
}
|
||||||
|
}
|
@ -1,16 +1,21 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace ProVM\Performance;
|
namespace ProVM\Performance;
|
||||||
|
|
||||||
use GuzzleHttp\Client;
|
|
||||||
use PHPUnit\Framework;
|
use PHPUnit\Framework;
|
||||||
|
use GuzzleHttp\Client;
|
||||||
|
|
||||||
class HomeTest extends Framework\TestCase
|
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
|
public function testLoad(): void
|
||||||
{
|
{
|
||||||
$client = new Client(['base_uri' => 'http://proxy']);
|
|
||||||
$start = microtime(true);
|
$start = microtime(true);
|
||||||
$response = $client->get('');
|
$this->client->get('/');
|
||||||
$end = microtime(true);
|
$end = microtime(true);
|
||||||
$this->assertLessThanOrEqual(1000, $end - $start);
|
$this->assertLessThanOrEqual(1000, $end - $start);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user