Skip to content

Commit

Permalink
Merge pull request #87 from livsi/patch-1
Browse files Browse the repository at this point in the history
Customize TMP_DIR
  • Loading branch information
lchrusciel authored Jun 9, 2017
2 parents 5c9c703 + fe8ae1d commit 30c77bf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/ApiTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,9 @@ protected function showErrorInBrowserIfOccurred(Response $response)
{
if (!$response->isSuccessful()) {
$openCommand = isset($_SERVER['OPEN_BROWSER_COMMAND']) ? $_SERVER['OPEN_BROWSER_COMMAND'] : 'open %s';

$filename = PathBuilder::build(rtrim(sys_get_temp_dir(), \DIRECTORY_SEPARATOR), uniqid() . '.html');
$tmpDir = isset($_SERVER['TMP_DIR']) ? $_SERVER['TMP_DIR'] : sys_get_temp_dir();

$filename = PathBuilder::build(rtrim($tmpDir, \DIRECTORY_SEPARATOR), uniqid() . '.html');
file_put_contents($filename, $response->getContent());
system(sprintf($openCommand, escapeshellarg($filename)));

Expand Down

0 comments on commit 30c77bf

Please sign in to comment.