Total Complexity | 5 |
Total Lines | 38 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php declare(strict_types=1); |
||
11 | class WebApplicationTest extends TestCase |
||
12 | { |
||
13 | use PhpWebServer; |
||
14 | |||
15 | private $intervalDuration = 60000; // 60 ms |
||
16 | private $numberOfRetries = 34; // max 2.04 seconds |
||
17 | |||
18 | public function testWebApplication() |
||
19 | { |
||
20 | $acceptHeader = '"Accept: application/json"'; |
||
21 | |||
22 | /** @noinspection PhpUndefinedConstantInspection */ |
||
23 | $host = PHP_WEBSERVER_HOST; |
||
1 ignored issue
–
show
|
|||
24 | /** @noinspection PhpUndefinedConstantInspection */ |
||
25 | $port = PHP_WEBSERVER_PORT; |
||
1 ignored issue
–
show
|
|||
26 | |||
27 | $process = new Process("curl -H $acceptHeader http://$host:$port/"); |
||
28 | |||
29 | $this->runProcessWithRetry($process); |
||
30 | |||
31 | self::assertContains('"name":"'. PersonLoader::PERSON_1_NAME . '"', $process->getOutput()); |
||
32 | } |
||
33 | |||
34 | private function runProcessWithRetry(Process $process): void |
||
49 | } |
||
50 | } |
||
52 |