Skip to content

Commit ac46265

Browse files
committed
Slightly simplified tests
1 parent 6310d64 commit ac46265

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

tests/ApplicationTest.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -174,10 +174,9 @@ public function testBeforeAfter()
174174
$app->after($a2);
175175

176176
$_SERVER["REQUEST_URI"] = "/";
177-
178-
ob_start();
179-
$app->run();
180-
$result = ob_get_clean();
177+
$request = Request::createFromGlobals();
178+
$response = $app->handle($request);
179+
$responseText = $response->getContent();
181180

182181
$expected = [
183182
'b1',
@@ -188,7 +187,7 @@ public function testBeforeAfter()
188187
];
189188

190189
$this->assertEquals($expected, $this->indicator);
191-
$this->assertEquals("Foo", $result);
190+
$this->assertEquals("Foo", $responseText);
192191
}
193192

194193
public function testExceptionWithHandler()

0 commit comments

Comments
 (0)