Skip to content

Commit 4968d53

Browse files
author
Giorgio Sironi
committed
Reduce IDE noise by refactoring how command line arguments are accessed
https://github.com/elifesciences/issues/issues/9169
1 parent af95746 commit 4968d53

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

test/SilexTestCase.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,15 @@ final protected function getApp() : Application
2525
*/
2626
final public function it_returns_valid_responses(Request $request, $contentType, int $statusCode = 200, $warning = [], int $expectedCount = null)
2727
{
28+
global $argv;
2829
$response = $this->getApp()->handle($request);
2930

30-
if (in_array('--debug', $_SERVER['argv'], true) && 500 === $response->getStatusCode()) {
31+
if (in_array('--debug', $argv, true) && 500 === $response->getStatusCode()) {
3132
$json = json_decode($response->getContent(), true);
3233
if (isset($json['exception'])) {
3334
$this->fail($json['exception']);
3435
}
35-
$this->fail($json);
36+
$this->fail('A 500 response was returned with: '.$response->getContent());
3637
}
3738

3839
if (is_int($expectedCount)) {

0 commit comments

Comments
 (0)