From f4b97003555945966f65798ef9b3175346bb8565 Mon Sep 17 00:00:00 2001 From: Konstantin Kudryashov Date: Sun, 3 Jun 2012 20:17:20 +0300 Subject: [PATCH] allow optional full path usage even if `files_path` option set --- src/Behat/MinkExtension/Context/MinkContext.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Behat/MinkExtension/Context/MinkContext.php b/src/Behat/MinkExtension/Context/MinkContext.php index ec7eb99..0850ce3 100644 --- a/src/Behat/MinkExtension/Context/MinkContext.php +++ b/src/Behat/MinkExtension/Context/MinkContext.php @@ -167,7 +167,10 @@ class MinkContext extends RawMinkContext implements TranslatedContextInterface $field = $this->fixStepArgument($field); if ($this->getMinkParameter('files_path')) { - $path = rtrim($this->getMinkParameter('files_path'), DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR.$path; + $fullPath = rtrim($this->getMinkParameter('files_path'), DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR.$path; + if (is_file($fullPath)) { + $path = $fullPath; + } } $this->getSession()->getPage()->attachFileToField($field, $path);