summaryrefslogtreecommitdiffstats
path: root/build/integration/features/bootstrap/ExternalStorageContext.php
blob: 90dc06cf571445ae5a8f5dc77d8bc6947c71fc35 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?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);
		}
	}
}