Creating the folder when the tests run

Conflicts:
	build/integration/features/bootstrap/BasicStructure.php
	build/integration/run.sh
This commit is contained in:
Sergio Bertolín 2016-08-30 10:53:19 +00:00 committed by Lukas Reschke
parent e8a014be34
commit 884c7a6b6b
No known key found for this signature in database
GPG Key ID: B9F6980CF6E759B1
2 changed files with 36 additions and 0 deletions

View File

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

View File

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