Commit 6c539a2e authored by Vincent Petry's avatar Vincent Petry Committed by GitHub
Browse files

Merge pull request #26865 from owncloud/integration-tests-allowing-md5-home

Integration tests allowing md5 home
parents 4e067909 02ffa619
......@@ -314,7 +314,7 @@ trait BasicStructure {
}
public function createFileSpecificSize($name, $size){
$file = fopen("data/" . "$name", 'w');
$file = fopen("work/" . "$name", 'w');
fseek($file, $size - 1 ,SEEK_CUR);
fwrite($file,'a'); // write a dummy char at SIZE position
fclose($file);
......
......@@ -637,6 +637,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
......
......@@ -464,10 +464,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);
}
/**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment