Bläddra i källkod

Fix unit tests

tags/v9.1.0RC1
Roeland Jago Douma 8 år sedan
förälder
incheckning
2e2ece753f
Inget konto är kopplat till bidragsgivarens mejladress

+ 18
- 3
apps/files_sharing/tests/API/Share20OCSTest.php Visa fil

@@ -433,8 +433,12 @@ class Share20OCSTest extends \Test\TestCase {
->method('getRelativePath')
->will($this->returnArgument(0));

$userFolder->method('getById')
->with($share->getNodeId())
->willReturn([$share->getNode()]);

$this->rootFolder->method('getUserFolder')
->with($share->getShareOwner())
->with($this->currentUser->getUID())
->willReturn($userFolder);

$this->urlGenerator
@@ -2006,8 +2010,19 @@ class Share20OCSTest extends \Test\TestCase {
->willReturn('myLink');


$this->rootFolder->method('getUserFolder')->with($share->getShareOwner())->will($this->returnSelf());
$this->rootFolder->method('getRelativePath')->will($this->returnArgument(0));
$this->rootFolder->method('getUserFolder')
->with($this->currentUser->getUID())
->will($this->returnSelf());

if (!$exception) {
$this->rootFolder->method('getById')
->with($share->getNodeId())
->willReturn([$share->getNode()]);

$this->rootFolder->method('getRelativePath')
->with($share->getNode()->getPath())
->will($this->returnArgument(0));
}

try {
$result = $this->invokePrivate($this->ocs, 'formatShare', [$share]);

+ 3
- 6
apps/files_sharing/tests/ApiTest.php Visa fil

@@ -764,8 +764,7 @@ class ApiTest extends TestCase {
// we should get exactly one result
$this->assertCount(1, $data);

$expectedPath = $this->folder . $this->subfolder;
$this->assertEquals($expectedPath, $data[0]['path']);
$this->assertEquals($this->subfolder, $data[0]['path']);

$this->shareManager->deleteShare($share2);
$this->shareManager->deleteShare($share1);
@@ -812,8 +811,7 @@ class ApiTest extends TestCase {
// we should get exactly one result
$this->assertCount(1, $data);

$expectedPath = $this->folder . $this->subfolder . $this->subsubfolder;
$this->assertEquals($expectedPath, $data[0]['path']);
$this->assertEquals($this->subsubfolder, $data[0]['path']);

$this->shareManager->deleteShare($share1);
$this->shareManager->deleteShare($share2);
@@ -922,8 +920,7 @@ class ApiTest extends TestCase {
// we should get exactly one result
$this->assertCount(1, $data);

$expectedPath = $this->folder.$this->subfolder.$this->filename;
$this->assertEquals($expectedPath, $data[0]['path']);
$this->assertEquals($this->filename, $data[0]['path']);

$this->shareManager->deleteShare($share1);
$this->shareManager->deleteShare($share2);

Laddar…
Avbryt
Spara