diff --git a/app/tests/integration/AbstractIntegration.php b/app/tests/integration/AbstractIntegration.php new file mode 100644 index 0000000..b33a4c6 --- /dev/null +++ b/app/tests/integration/AbstractIntegration.php @@ -0,0 +1,15 @@ +client = new Client(['base_uri' => $_ENV['APP_URL']]); + } +} \ No newline at end of file diff --git a/app/tests/integration/HomeTest.php b/app/tests/integration/HomeTest.php index fc5a6fd..946f0ce 100644 --- a/app/tests/integration/HomeTest.php +++ b/app/tests/integration/HomeTest.php @@ -1,17 +1,10 @@ client = new Client(['base_uri' => $_ENV['APP_URL']]); - } - public function testLoad(): void { $response = $this->client->get('/'); diff --git a/app/tests/performance/AbstractPerformance.php b/app/tests/performance/AbstractPerformance.php new file mode 100644 index 0000000..937575e --- /dev/null +++ b/app/tests/performance/AbstractPerformance.php @@ -0,0 +1,17 @@ +startTime = microtime(true); + } + protected function end(): float + { + return microtime(true) - $this->startTime; + } +} \ No newline at end of file diff --git a/app/tests/performance/HomeTest.php b/app/tests/performance/HomeTest.php index 820c2a7..92b699f 100644 --- a/app/tests/performance/HomeTest.php +++ b/app/tests/performance/HomeTest.php @@ -1,10 +1,11 @@ start(); $this->client->get('/'); - $end = microtime(true); - $this->assertLessThanOrEqual(1000, $end - $start); + $time = $this->end(); + $this->assertLessThanOrEqual(1000, $time); } }