Skip to content

Commit

Permalink
- Merge [4746].
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Apr 2, 2009
1 parent 7717325 commit 6b22040
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions PHPUnit/Framework/ComparisonFailure.php
Expand Up @@ -197,10 +197,22 @@ public static function diffEqual($expected, $actual, $message = '')

protected function diff($expected, $actual)
{
$expectedFile = tempnam('/tmp', 'expected');
file_put_contents($expectedFile, $expected);
if (defined('PHPUNIT_TMPDIR')) {
$tmpDir = PHPUNIT_TMPDIR;
}

else if (function_exists('sys_get_temp_dir')) {
$tmpDir = sys_get_temp_dir();
}

$actualFile = tempnam('/tmp', 'actual');
else {
$tmpDir = '/tmp';
}

$expectedFile = tempnam($tmpDir, 'expected');
$actualFile = tempnam($tmpDir, 'actual');

file_put_contents($expectedFile, $expected);
file_put_contents($actualFile, $actual);

$buffer = shell_exec(
Expand Down

0 comments on commit 6b22040

Please sign in to comment.