From 1914bce04d5db6a581f215105420434984da4e80 Mon Sep 17 00:00:00 2001 From: Ollie Harridge Date: Wed, 20 Jul 2016 15:58:21 +0100 Subject: [PATCH] Screenshot filename has invalid characters The screenshot filename "firefox_2016-07-12T15:19:21+00:00.578f8b3deeff62.22313382.png" contains invalid characters on Windows. This PR changes it to "firefox_2016-07-20_16.31.25_578f8b3deeff62.22313382.png" --- 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 8e0a9279..05de508e 100644 --- a/src/Behat/MinkExtension/Context/RawMinkContext.php +++ b/src/Behat/MinkExtension/Context/RawMinkContext.php @@ -158,7 +158,7 @@ public function saveScreenshot($filename = null, $filepath = null) { // 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'); + $filename = $filename ?: sprintf('%s_%s_%s.%s', $this->getMinkParameter('browser_name'), date('Y-m-d_H.i.s'), uniqid('', true), 'png'); $filepath = $filepath ?: (ini_get('upload_tmp_dir') ? ini_get('upload_tmp_dir') : sys_get_temp_dir()); file_put_contents($filepath . '/' . $filename, $this->getSession()->getScreenshot()); }