From 5fd83a8d15cd04fd06ddaada8b8416ad9788504a Mon Sep 17 00:00:00 2001 From: Christophe Coevoet Date: Sun, 27 Apr 2014 13:45:38 +0200 Subject: [PATCH] Added support of optional full paths for uploads in the trait This was implemented in the MinkContext in f4b9700 but the trait was not in sync. --- src/Behat/MinkExtension/Context/MinkDictionary.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Behat/MinkExtension/Context/MinkDictionary.php b/src/Behat/MinkExtension/Context/MinkDictionary.php index ebde70f..908298a 100644 --- a/src/Behat/MinkExtension/Context/MinkDictionary.php +++ b/src/Behat/MinkExtension/Context/MinkDictionary.php @@ -270,7 +270,10 @@ trait MinkDictionary $field = $this->fixStepArgument($field); if ($this->getMinkParameter('files_path')) { - $path = rtrim($this->getMinkParameter('files_path'), DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR.$path; + $fullPath = rtrim(realpath($this->getMinkParameter('files_path')), DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR.$path; + if (is_file($fullPath)) { + $path = $fullPath; + } } $this->getSession()->getPage()->attachFileToField($field, $path);