Merge pull request #2841 from nextcloud/integration-tests-allowing-md5-home

Integration tests allowing md5 home
This commit is contained in:
Lukas Reschke 2016-12-23 13:46:51 +01:00 committed by GitHub
commit bfdc55c80a
3 changed files with 20 additions and 6 deletions

View file

@ -343,8 +343,8 @@ trait BasicStructure {
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);

View file

@ -704,6 +704,19 @@ trait Provisioning {
$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

View file

@ -496,10 +496,11 @@ trait WebDav {
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);
}
/**