diff options
Diffstat (limited to 'build/integration/features/bootstrap')
-rw-r--r-- | build/integration/features/bootstrap/BasicStructure.php | 7 | ||||
-rw-r--r-- | build/integration/features/bootstrap/WebDav.php | 14 |
2 files changed, 21 insertions, 0 deletions
diff --git a/build/integration/features/bootstrap/BasicStructure.php b/build/integration/features/bootstrap/BasicStructure.php index df46d0b1983..c2a826521ad 100644 --- a/build/integration/features/bootstrap/BasicStructure.php +++ b/build/integration/features/bootstrap/BasicStructure.php @@ -313,6 +313,13 @@ trait BasicStructure { file_put_contents("../../data/$user/files" . "$filename", "$text"); } + public function createFileSpecificSize($user, $name, $size){ + $file = fopen("data/" . "$name", 'w'); + fseek($file, $size - 1 ,SEEK_CUR); + fwrite($file,'a'); // write a dummy char at SIZE position + fclose($file); + } + /** * @BeforeSuite */ diff --git a/build/integration/features/bootstrap/WebDav.php b/build/integration/features/bootstrap/WebDav.php index 02f3e82a4c3..f4904e5ae7a 100644 --- a/build/integration/features/bootstrap/WebDav.php +++ b/build/integration/features/bootstrap/WebDav.php @@ -425,6 +425,20 @@ trait WebDav { } /** + * @When User :user adds a file of :bytes bytes to :destination + * @param string $user + * @param string $bytes + * @param string $destination + */ + public function userAddsAFileTo($user, $bytes, $destination){ + $filename = "filespecificSize.txt"; + $this->createFileSpecificSize($user, $filename, $bytes); + PHPUnit_Framework_Assert::assertEquals(1, file_exists("data/$filename")); + $this->userUploadsAFileTo($user, "data/$filename", $destination); + $this->removeFile("data/", $filename); + } + + /** * @When User :user uploads file with content :content to :destination */ public function userUploadsAFileWithContentTo($user, $content, $destination) |