From b154c8fa394fd980fea65b5bd29b8cfb12d3f43c Mon Sep 17 00:00:00 2001 From: Sergio Bertolin Date: Tue, 9 Aug 2016 08:24:03 +0000 Subject: [PATCH] Removed extra context added needed option and remove storage after external storage scenarios --- .../features/bootstrap/BasicStructure.php | 12 ++++++++++ .../bootstrap/ExternalStorageContext.php | 24 ------------------- .../features/external-storage.feature | 2 +- build/integration/local_storage/hello.txt | 1 - build/integration/run.sh | 2 ++ 5 files changed, 15 insertions(+), 26 deletions(-) delete mode 100644 build/integration/features/bootstrap/ExternalStorageContext.php delete mode 100644 build/integration/local_storage/hello.txt diff --git a/build/integration/features/bootstrap/BasicStructure.php b/build/integration/features/bootstrap/BasicStructure.php index e9e20c047aa..4330a324ad3 100644 --- a/build/integration/features/bootstrap/BasicStructure.php +++ b/build/integration/features/bootstrap/BasicStructure.php @@ -344,4 +344,16 @@ trait BasicStructure { rmdir("../../core/skeleton/PARENT"); } } + + /** + * @AfterScenario @local_storage + */ + public static function removeFilesFromLocalStorage(){ + $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); + } + } } diff --git a/build/integration/features/bootstrap/ExternalStorageContext.php b/build/integration/features/bootstrap/ExternalStorageContext.php deleted file mode 100644 index 90dc06cf571..00000000000 --- a/build/integration/features/bootstrap/ExternalStorageContext.php +++ /dev/null @@ -1,24 +0,0 @@ -isDir() ? rmdir($file) : unlink($file); - } - } -} diff --git a/build/integration/features/external-storage.feature b/build/integration/features/external-storage.feature index ac8bd971edf..9e53b01346e 100644 --- a/build/integration/features/external-storage.feature +++ b/build/integration/features/external-storage.feature @@ -3,6 +3,7 @@ Feature: external-storage Given using api version "1" Given using dav path "remote.php/webdav" + @local_storage Scenario: Share by link a file inside a local external storage Given user "user0" exists And user "user1" exists @@ -21,6 +22,5 @@ Feature: external-storage | url | AN_URL | | token | A_TOKEN | | mimetype | httpd/unix-directory | - And Public shared file "/foo/textfile0.txt" can be downloaded diff --git a/build/integration/local_storage/hello.txt b/build/integration/local_storage/hello.txt deleted file mode 100644 index e1ec11389c7..00000000000 --- a/build/integration/local_storage/hello.txt +++ /dev/null @@ -1 +0,0 @@ -Hello local storage diff --git a/build/integration/run.sh b/build/integration/run.sh index 3a5bb1153d8..be2e7684dc6 100755 --- a/build/integration/run.sh +++ b/build/integration/run.sh @@ -42,6 +42,8 @@ OUTPUT_CREATE_STORAGE=`sudo -u $APACHE_USER ../../occ files_external:create loca ID_STORAGE=`echo $OUTPUT_CREATE_STORAGE | awk {'print $5'}` +sudo -u $APACHE_USER ../../occ files_external:option $ID_STORAGE enable_sharing true + vendor/bin/behat -f junit -f pretty $SCENARIO_TO_RUN RESULT=$?