Added functions to add files in local_storage

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
This commit is contained in:
Sergio Bertolin 2017-03-01 10:10:30 +00:00 committed by Morris Jobke
parent 528a903a7b
commit 190ceba22f
No known key found for this signature in database
GPG key ID: 9CE5ED29E7FCD38A

View file

@ -353,6 +353,30 @@ trait BasicStructure {
fclose($file);
}
public function createFileWithText($name, $text){
$file = fopen("work/" . "$name", 'w');
fwrite($file, $text);
fclose($file);
}
/**
* @Given file :filename of size :size is created in local storage
* @param string $filename
* @param string $size
*/
public function fileIsCreatedInLocalStorageWithSize($filename, $size) {
$this->createFileSpecificSize("local_storage/$filename", $size);
}
/**
* @Given file :filename with text :text is created in local storage
* @param string $filename
* @param string $text
*/
public function fileIsCreatedInLocalStorageWithText($filename, $text) {
$this->createFileWithText("local_storage/$filename", $text);
}
/**
* @When User :user empties trashbin
* @param string $user