Fix tests

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
Roeland Jago Douma 2018-08-24 18:20:04 +02:00
parent 7ce520e83e
commit 79a88ed458
No known key found for this signature in database
GPG Key ID: F941078878347C0C
1 changed files with 7 additions and 2 deletions

View File

@ -280,8 +280,13 @@ class ShareesAPIControllerTest extends TestCase {
$this->shareManager->expects($this->any())
->method('shareProviderExists')
->with(\OCP\Share::SHARE_TYPE_EMAIL)
->willReturn($emailSharingEnabled);
->will($this->returnCallback(function($shareType) use ($emailSharingEnabled) {
if ($shareType === \OCP\Share::SHARE_TYPE_EMAIL) {
return $emailSharingEnabled;
} else {
return false;
}
}));
$this->assertInstanceOf(Http\DataResponse::class, $sharees->search($search, $itemType, $page, $perPage, $shareType));