Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions build/integration/features/bootstrap/BasicStructure.php
Original file line number Diff line number Diff line change
Expand Up @@ -343,8 +343,8 @@ public function modifyTextOfFile($user, $filename, $text) {
file_put_contents("../../data/$user/files" . "$filename", "$text");
}

public function createFileSpecificSize($name, $size){
$file = fopen("data/" . "$name", 'w');
public function createFileSpecificSize($name, $size) {
$file = fopen("work/" . "$name", 'w');
fseek($file, $size - 1 ,SEEK_CUR);
fwrite($file,'a'); // write a dummy char at SIZE position
fclose($file);
Expand Down
13 changes: 13 additions & 0 deletions build/integration/features/bootstrap/Provisioning.php
Original file line number Diff line number Diff line change
Expand Up @@ -704,6 +704,19 @@ public function userHasUnlimitedQuota($user)
$this->userHasAQuotaOf($user, 'none');
}

/**
* Returns home path of the given user
* @param string $user
*/
public function getUserHome($user) {
$fullUrl = $this->baseUrl . "v{$this->apiVersion}.php/cloud/users/$user";
$client = new Client();
$options = [];
$options['auth'] = $this->adminUser;
$this->response = $client->get($fullUrl, $options);
return $this->response->xml()->data[0]->home;
}

/**
* @BeforeScenario
* @AfterScenario
Expand Down
9 changes: 5 additions & 4 deletions build/integration/features/bootstrap/WebDav.php
Original file line number Diff line number Diff line change
Expand Up @@ -496,10 +496,11 @@ public function userUploadsAFileTo($user, $source, $destination)
public function userAddsAFileTo($user, $bytes, $destination){
$filename = "filespecificSize.txt";
$this->createFileSpecificSize($filename, $bytes);
PHPUnit_Framework_Assert::assertEquals(1, file_exists("data/$filename"));
$this->userUploadsAFileTo($user, "data/$filename", $destination);
$this->removeFile("data/", $filename);
PHPUnit_Framework_Assert::assertEquals(1, file_exists("../../data/$user/files$destination"));
PHPUnit_Framework_Assert::assertEquals(1, file_exists("work/$filename"));
$this->userUploadsAFileTo($user, "work/$filename", $destination);
$this->removeFile("work/", $filename);
$expectedElements = new \Behat\Gherkin\Node\TableNode([["$destination"]]);
$this->checkElementList($user, $expectedElements);
}

/**
Expand Down