Removed extra context added needed option and remove storage after external storage scenarios
This commit is contained in:
parent
85f00e2c01
commit
b154c8fa39
|
@ -344,4 +344,16 @@ trait BasicStructure {
|
||||||
rmdir("../../core/skeleton/PARENT");
|
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 api version "1"
|
||||||
Given using dav path "remote.php/webdav"
|
Given using dav path "remote.php/webdav"
|
||||||
|
|
||||||
|
@local_storage
|
||||||
Scenario: Share by link a file inside a local external storage
|
Scenario: Share by link a file inside a local external storage
|
||||||
Given user "user0" exists
|
Given user "user0" exists
|
||||||
And user "user1" exists
|
And user "user1" exists
|
||||||
|
@ -21,6 +22,5 @@ Feature: external-storage
|
||||||
| url | AN_URL |
|
| url | AN_URL |
|
||||||
| token | A_TOKEN |
|
| token | A_TOKEN |
|
||||||
| mimetype | httpd/unix-directory |
|
| 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'}`
|
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
|
vendor/bin/behat -f junit -f pretty $SCENARIO_TO_RUN
|
||||||
RESULT=$?
|
RESULT=$?
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue