Fix Sharing app tests with phpunit 5.2+

This commit is contained in:
Joas Schilling 2016-07-01 16:29:53 +02:00
parent fd5bdf5e1a
commit eb715dd1b6
No known key found for this signature in database
GPG Key ID: 70A0B324C41C0946
2 changed files with 4 additions and 8 deletions

View File

@ -668,7 +668,7 @@ class Share20OCSTest extends \Test\TestCase {
$user = $this->getMock('\OCP\IUser');
$this->userManager->method('userExists')->with('validUser')->willReturn(true);
$share->method('setPath')->with($path);
$share->method('setNode')->with($path);
$share->method('setPermissions')
->with(
\OCP\Constants::PERMISSION_ALL &
@ -773,7 +773,7 @@ class Share20OCSTest extends \Test\TestCase {
->method('allowGroupSharing')
->willReturn(true);
$share->method('setPath')->with($path);
$share->method('setNode')->with($path);
$share->method('setPermissions')->with(\OCP\Constants::PERMISSION_ALL);
$share->method('setShareType')->with(\OCP\Share::SHARE_TYPE_GROUP);
$share->method('setSharedWith')->with('validGroup');
@ -822,7 +822,7 @@ class Share20OCSTest extends \Test\TestCase {
->method('allowGroupSharing')
->willReturn(false);
$share->method('setPath')->with($path);
$share->method('setNode')->with($path);
$expected = new \OC_OCS_Result(null, 404, 'group sharing is disabled by the administrator');
$result = $this->ocs->createShare();

View File

@ -85,10 +85,6 @@ class ShareControllerTest extends \Test\TestCase {
$this->userManager = $this->getMock('\OCP\IUserManager');
$this->federatedShareProvider = $this->getMockBuilder('OCA\FederatedFileSharing\FederatedShareProvider')
->disableOriginalConstructor()->getMock();
$this->federatedShareProvider->expects($this->any())
->method('isOutgoingServer2serverShareEnabled')->willReturn(true);
$this->federatedShareProvider->expects($this->any())
->method('isIncomingServer2serverShareEnabled')->willReturn(true);
$this->shareController = new \OCA\Files_Sharing\Controllers\ShareController(
$this->appName,
@ -476,4 +472,4 @@ class ShareControllerTest extends \Test\TestCase {
$this->assertEquals($expectedResponse, $response);
}
}
}