Tests
This commit is contained in:
17
app/tests/performance/APITest.php
Normal file
17
app/tests/performance/APITest.php
Normal file
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
namespace ProVM\Performance;
|
||||
|
||||
use GuzzleHttp\Client;
|
||||
use PHPUnit\Framework;
|
||||
|
||||
class APITest extends Framework\TestCase
|
||||
{
|
||||
public function testLoad(): void
|
||||
{
|
||||
$client = new Client(['base_uri' => 'http://proxy']);
|
||||
$start = microtime(true);
|
||||
$response = $client->get('/api', ['headers' => ['Authorization' => 'Bearer ' . md5($_ENV['API_KEY'])]]);
|
||||
$end = microtime(true);
|
||||
$this->assertLessThanOrEqual(1000, $end - $start);
|
||||
}
|
||||
}
|
17
app/tests/performance/HomeTest.php
Normal file
17
app/tests/performance/HomeTest.php
Normal file
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
namespace ProVM\Performance;
|
||||
|
||||
use GuzzleHttp\Client;
|
||||
use PHPUnit\Framework;
|
||||
|
||||
class HomeTest extends Framework\TestCase
|
||||
{
|
||||
public function testLoad(): void
|
||||
{
|
||||
$client = new Client(['base_uri' => 'http://proxy']);
|
||||
$start = microtime(true);
|
||||
$response = $client->get('');
|
||||
$end = microtime(true);
|
||||
$this->assertLessThanOrEqual(1000, $end - $start);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user