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.
This commit is contained in:
Christophe Coevoet
2014-04-27 13:45:38 +02:00
parent a6c0b09153
commit 5fd83a8d15

View File

@@ -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);