Skip to content

Commit 8ba5bdf

Browse files
committed
Normalize output and fixtures
1 parent 3e4118a commit 8ba5bdf

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

tests/Feature/Console/Commands/CurlCommandTest.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ class CurlCommandTest extends TestCase
1313
*/
1414
public function it_converts_curl_requests_to_http_client_code($fixture)
1515
{
16-
$code = Artisan::call('shift:' . trim(file_get_contents('tests/fixtures/' . $fixture . '.in')));
17-
$output = Artisan::output();
16+
$code = Artisan::call('shift:' . $this->fixture($fixture . '.in'));
17+
$output = trim(Artisan::output());
1818

1919
$this->assertSame(0, $code);
20-
$this->assertSame(file_get_contents('tests/fixtures/' . $fixture . '.out'), $output);
20+
$this->assertSame($this->fixture($fixture . '.out'), $output);
2121
}
2222

2323
public function curlCommandFixtures()
@@ -41,4 +41,9 @@ public function curlCommandFixtures()
4141
'Entire transaction timeout' => ['max-timeout'],
4242
];
4343
}
44+
45+
private function fixture(string $fixture)
46+
{
47+
return trim(file_get_contents('tests/fixtures/' . $fixture));
48+
}
4449
}

0 commit comments

Comments
 (0)