|
32 | 32 | */ |
33 | 33 | class DockerizedTest extends TestCase |
34 | 34 | { |
| 35 | + /** |
| 36 | + * @dataProvider dataRun |
| 37 | + * @covers \CrowdStar\BackgroundProcessing\BackgroundProcessing::run() |
| 38 | + */ |
| 39 | + public function testRun(string $expectedHttpResponse, string $expectedFinalValue, string $start, string $end): void |
| 40 | + { |
| 41 | + $client = new Client(['base_uri' => 'http://web']); |
| 42 | + $client->get('/', ['query' => ['reset' => true]]); // Wipe cached data. |
| 43 | + |
| 44 | + $this->assertSame( |
| 45 | + $expectedHttpResponse, |
| 46 | + (string) $client->get('/', ['query' => ['start' => $start, 'end' => $end]])->getBody(), |
| 47 | + "HTTP response should be {$expectedHttpResponse} while final value in APCu should be {$expectedFinalValue}" |
| 48 | + ); |
| 49 | + $this->assertSame( |
| 50 | + $expectedFinalValue, |
| 51 | + (string) $client->get('/')->getBody(), |
| 52 | + "Final value in APCu should be {$expectedFinalValue} while HTTP response should be {$expectedHttpResponse}" |
| 53 | + ); |
| 54 | + } |
| 55 | + |
35 | 56 | /** |
36 | 57 | * @return array<array<string, string>> |
37 | 58 | */ |
@@ -68,25 +89,4 @@ public static function dataRun(): array |
68 | 89 | ], |
69 | 90 | ]; |
70 | 91 | } |
71 | | - |
72 | | - /** |
73 | | - * @dataProvider dataRun |
74 | | - * @covers \CrowdStar\BackgroundProcessing\BackgroundProcessing::run() |
75 | | - */ |
76 | | - public function testRun(string $expectedHttpResponse, string $expectedFinalValue, string $start, string $end): void |
77 | | - { |
78 | | - $client = new Client(['base_uri' => 'http://web']); |
79 | | - $client->get('/', ['query' => ['reset' => true]]); // Wipe cached data. |
80 | | - |
81 | | - $this->assertSame( |
82 | | - $expectedHttpResponse, |
83 | | - (string) $client->get('/', ['query' => ['start' => $start, 'end' => $end]])->getBody(), |
84 | | - "HTTP response should be {$expectedHttpResponse} while final value in APCu should be {$expectedFinalValue}" |
85 | | - ); |
86 | | - $this->assertSame( |
87 | | - $expectedFinalValue, |
88 | | - (string) $client->get('/')->getBody(), |
89 | | - "Final value in APCu should be {$expectedFinalValue} while HTTP response should be {$expectedHttpResponse}" |
90 | | - ); |
91 | | - } |
92 | 92 | } |
0 commit comments