saveScreenshot function refactoring.

This commit is contained in:
Vincent CATILLON
2015-04-29 17:15:23 +02:00
parent 9bff0ae65f
commit 779c19486b

View File

@@ -159,7 +159,7 @@ class RawMinkContext implements MinkAwareContext
// Under Cygwin, uniqid with more_entropy must be set to true. // Under Cygwin, uniqid with more_entropy must be set to true.
// No effect in other environments. // No effect in other environments.
$filename = $filename ?: sprintf('%s_%s_%s.%s', $this->getMinkParameter('browser_name'), date('c'), uniqid('', true), 'png'); $filename = $filename ?: sprintf('%s_%s_%s.%s', $this->getMinkParameter('browser_name'), date('c'), uniqid('', true), 'png');
$filepath = $filepath ? $filepath : (ini_get('upload_tmp_dir') ? ini_get('upload_tmp_dir') : sys_get_temp_dir()); $filepath = $filepath ?: (ini_get('upload_tmp_dir') ? ini_get('upload_tmp_dir') : sys_get_temp_dir());
file_put_contents($filepath . '/' . $filename, $this->getSession()->getScreenshot()); file_put_contents($filepath . '/' . $filename, $this->getSession()->getScreenshot());
} }
} }