Browse Source
Removed extra context added needed option and remove storage after external storage scenarios
pull/1196/head
Sergio Bertolin
9 years ago
committed by
Lukas Reschke
No known key found for this signature in database
GPG Key ID: B9F6980CF6E759B1
5 changed files with
15 additions and
26 deletions
-
build/integration/features/bootstrap/BasicStructure.php
-
build/integration/features/bootstrap/ExternalStorageContext.php
-
build/integration/features/external-storage.feature
-
build/integration/local_storage/hello.txt
-
build/integration/run.sh
|
|
|
@ -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); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
@ -1,24 +0,0 @@ |
|
|
|
<?php |
|
|
|
|
|
|
|
|
|
|
|
require __DIR__ . '/../../vendor/autoload.php'; |
|
|
|
|
|
|
|
use Behat\Gherkin\Node\TableNode; |
|
|
|
use GuzzleHttp\Client; |
|
|
|
use GuzzleHttp\Message\ResponseInterface; |
|
|
|
|
|
|
|
class ExternalStorageContext implements \Behat\Behat\Context\Context { |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* @AfterScenario |
|
|
|
*/ |
|
|
|
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); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
@ -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 |
|
|
|
|
|
|
|
|
|
|
|
@ -1 +0,0 @@ |
|
|
|
Hello local storage |
|
|
|
@ -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=$? |
|
|
|
|
|
|
|
|