Revert "Fixed Folder::find_or_make() use"

This reverts commit 8d49da2609.
This commit is contained in:
Jeffrey Guo 2016-02-05 16:21:04 +13:00
parent 3a292d796b
commit 0571432095
2 changed files with 1 additions and 3 deletions

View File

@ -553,13 +553,11 @@ class FixtureContext extends BehatContext
$sourcePath = $this->joinPaths($this->getFilesPath(), basename($relativeTargetPath)); $sourcePath = $this->joinPaths($this->getFilesPath(), basename($relativeTargetPath));
// Create file or folder on filesystem // Create file or folder on filesystem
$parent = null; $parent = \Folder::find_or_make(dirname($relativeTargetPath));
if($class == 'Folder' || is_subclass_of($class, 'Folder')) { if($class == 'Folder' || is_subclass_of($class, 'Folder')) {
$parent = \Folder::find_or_make($relativeTargetPath);
$targetPath = $this->joinPaths(ASSETS_PATH, $relativeTargetPath); $targetPath = $this->joinPaths(ASSETS_PATH, $relativeTargetPath);
$data['ID'] = $parent->ID; $data['ID'] = $parent->ID;
} else { } else {
$parent = \Folder::find_or_make(dirname($relativeTargetPath));
if(!file_exists($sourcePath)) { if(!file_exists($sourcePath)) {
throw new \InvalidArgumentException(sprintf( throw new \InvalidArgumentException(sprintf(
'Source file for "%s" cannot be found in "%s"', 'Source file for "%s" cannot be found in "%s"',