diff --git a/build/integration/features/bootstrap/BasicStructure.php b/build/integration/features/bootstrap/BasicStructure.php index 0999000f2e..b1b7fd5525 100644 --- a/build/integration/features/bootstrap/BasicStructure.php +++ b/build/integration/features/bootstrap/BasicStructure.php @@ -334,5 +334,30 @@ trait BasicStructure { rmdir("../../core/skeleton/PARENT"); } } + + /** + * @BeforeScenario @local_storage + */ + public static function removeFilesFromLocalStorageBefore(){ + $dir = "./work/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 removeFilesFromLocalStorageAfter(){ + $dir = "./work/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); + } + } + } diff --git a/build/integration/run.sh b/build/integration/run.sh index eccb378eec..cd65225d26 100755 --- a/build/integration/run.sh +++ b/build/integration/run.sh @@ -36,6 +36,17 @@ echo $PHPPID_FED export TEST_SERVER_URL="http://localhost:$PORT/ocs/" export TEST_SERVER_FED_URL="http://localhost:$PORT_FED/ocs/" + +#Enable external storage app +../../occ app:enable files_external + +mkdir -p work/local_storage +OUTPUT_CREATE_STORAGE=`../../occ files_external:create local_storage local null::null -c datadir=./build/integration/work/local_storage` + +ID_STORAGE=`echo $OUTPUT_CREATE_STORAGE | awk {'print $5'}` + +../../occ files_external:option $ID_STORAGE enable_sharing true + vendor/bin/behat -f junit -f pretty $SCENARIO_TO_RUN RESULT=$?