From 169f970fffc8938a65009fa6d23f55e0f0e12abd Mon Sep 17 00:00:00 2001 From: Adrien Brault Date: Thu, 3 Jan 2013 18:33:16 +0100 Subject: [PATCH] Fix RawMinkContext::saveScreenshot not working --- 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 eee8e91..6c1324a 100644 --- a/src/Behat/MinkExtension/Context/RawMinkContext.php +++ b/src/Behat/MinkExtension/Context/RawMinkContext.php @@ -121,7 +121,7 @@ class RawMinkContext extends BehatContext implements MinkAwareInterface // 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 ? $filepath : (ini_get('upload_tmp_dir') ? ini_get('upload_tmp_dir') : sys_get_temp_dir()); file_put_contents($filepath . '/' . $filename, $this->getSession()->getScreenshot()); } }