From 779c19486ba5a1306c76a702391f13335a23b36c Mon Sep 17 00:00:00 2001 From: Vincent CATILLON Date: Wed, 29 Apr 2015 17:15:23 +0200 Subject: [PATCH] saveScreenshot function refactoring. --- src/Behat/MinkExtension/Context/RawMinkContext.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Behat/MinkExtension/Context/RawMinkContext.php b/src/Behat/MinkExtension/Context/RawMinkContext.php index d07610e..8e0a927 100644 --- a/src/Behat/MinkExtension/Context/RawMinkContext.php +++ b/src/Behat/MinkExtension/Context/RawMinkContext.php @@ -159,7 +159,7 @@ class RawMinkContext implements MinkAwareContext // Under Cygwin, uniqid with more_entropy must be set to true. // No effect in other environments. $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()); } }