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
parent
commit
b154c8fa39
No known key found for this signature in database GPG Key ID: B9F6980CF6E759B1
  1. 12
      build/integration/features/bootstrap/BasicStructure.php
  2. 24
      build/integration/features/bootstrap/ExternalStorageContext.php
  3. 2
      build/integration/features/external-storage.feature
  4. 1
      build/integration/local_storage/hello.txt
  5. 2
      build/integration/run.sh

12
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);
}
}
}

24
build/integration/features/bootstrap/ExternalStorageContext.php

@ -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);
}
}
}

2
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

1
build/integration/local_storage/hello.txt

@ -1 +0,0 @@
Hello local storage

2
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=$?

Loading…
Cancel
Save