From 7106129baac765c7296ccebf70910a83058ae3d7 Mon Sep 17 00:00:00 2001 From: Sergio BertolĂ­n Date: Fri, 26 Aug 2016 07:57:48 +0000 Subject: External storage was not enabled and content was not deleted before scenarios --- build/integration/features/bootstrap/BasicStructure.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'build/integration/features') diff --git a/build/integration/features/bootstrap/BasicStructure.php b/build/integration/features/bootstrap/BasicStructure.php index 4330a324ad3..758a2d5d455 100644 --- a/build/integration/features/bootstrap/BasicStructure.php +++ b/build/integration/features/bootstrap/BasicStructure.php @@ -345,10 +345,22 @@ trait BasicStructure { } } + /** + * @BeforeScenario @local_storage + */ + public static function removeFilesFromLocalStorageBefore(){ + $dir = "./local_storage/"; + $di = new RecursiveDirectoryIterator($dir, FilesystemIterator::SKIP_DOTS); + $ri = new RecursiveIteratorIterator($di, RecursiveIteratorIterator::CHILD_FIRST); + foreach ( $ri as $file ) { + $file->isDir() ? rmdir($file) : unlink($file); + } + } + /** * @AfterScenario @local_storage */ - public static function removeFilesFromLocalStorage(){ + public static function removeFilesFromLocalStorageAfter(){ $dir = "./local_storage/"; $di = new RecursiveDirectoryIterator($dir, FilesystemIterator::SKIP_DOTS); $ri = new RecursiveIteratorIterator($di, RecursiveIteratorIterator::CHILD_FIRST); -- cgit v1.2.3