mirror of
https://github.com/silverstripe/silverstripe-behat-extension
synced 2024-10-22 17:05:32 +02:00
Fixed Folder::find_or_make() use
This commit is contained in:
parent
15b491ed74
commit
8d49da2609
@ -546,10 +546,12 @@ class FixtureContext extends BehatContext
|
||||
$sourcePath = $this->joinPaths($this->getFilesPath(), basename($relativeTargetPath));
|
||||
|
||||
// Create file or folder on filesystem
|
||||
$parent = \Folder::find_or_make(dirname($relativeTargetPath));
|
||||
$parent = null;
|
||||
if($class == 'Folder' || is_subclass_of($class, 'Folder')) {
|
||||
$parent = \Folder::find_or_make($relativeTargetPath);
|
||||
$targetPath = $this->joinPaths(ASSETS_PATH, $relativeTargetPath);
|
||||
} else {
|
||||
$parent = \Folder::find_or_make(dirname($relativeTargetPath));
|
||||
if(!file_exists($sourcePath)) {
|
||||
throw new \InvalidArgumentException(sprintf(
|
||||
'Source file for "%s" cannot be found in "%s"',
|
||||
|
0
tests/Context/FixtureContextTest.php
Normal file
0
tests/Context/FixtureContextTest.php
Normal file
Loading…
Reference in New Issue
Block a user