summaryrefslogtreecommitdiffstats
path: root/apps/sharebymail/tests/ShareByMailProviderTest.php
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2017-04-07 17:14:05 -0500
committerGitHub <noreply@github.com>2017-04-07 17:14:05 -0500
commitca9d25169dcdd2923a356e2a797d8704506a3787 (patch)
tree5d94aed1a5f79a5b0abe33d8732fc60e0a4054b3 /apps/sharebymail/tests/ShareByMailProviderTest.php
parent9adfa60eb38f6c39ae075e1fa68037375c8789de (diff)
parentbf30090be5e3d339c9188d81a900ed2fe4bd6318 (diff)
downloadnextcloud-server-ca9d25169dcdd2923a356e2a797d8704506a3787.tar.gz
nextcloud-server-ca9d25169dcdd2923a356e2a797d8704506a3787.zip
Merge pull request #4136 from nextcloud/expire-date-for-all-shares
Unified sharing options
Diffstat (limited to 'apps/sharebymail/tests/ShareByMailProviderTest.php')
-rw-r--r--apps/sharebymail/tests/ShareByMailProviderTest.php15
1 files changed, 10 insertions, 5 deletions
diff --git a/apps/sharebymail/tests/ShareByMailProviderTest.php b/apps/sharebymail/tests/ShareByMailProviderTest.php
index 65eded3eb7d..288ebb4bb45 100644
--- a/apps/sharebymail/tests/ShareByMailProviderTest.php
+++ b/apps/sharebymail/tests/ShareByMailProviderTest.php
@@ -23,7 +23,7 @@
namespace OCA\ShareByMail\Tests;
-use OC\HintException;
+use OCA\ShareByMail\Settings\SettingsManager;
use OCA\ShareByMail\ShareByMailProvider;
use OCP\Files\IRootFolder;
use OCP\IDBConnection;
@@ -33,7 +33,6 @@ use OCP\IURLGenerator;
use OCP\IUserManager;
use OCP\Mail\IMailer;
use OCP\Security\ISecureRandom;
-use OCP\Share\Exceptions\ShareNotFound;
use OCP\Share\IManager;
use OCP\Share\IShare;
use Test\TestCase;
@@ -79,6 +78,9 @@ class ShareByMailProviderTest extends TestCase {
/** @var \OCP\Activity\IManager | \PHPUnit_Framework_MockObject_MockObject */
private $activityManager;
+ /** @var SettingsManager | \PHPUnit_Framework_MockObject_MockObject */
+ private $settingsManager;
+
public function setUp() {
parent::setUp();
@@ -98,6 +100,7 @@ class ShareByMailProviderTest extends TestCase {
$this->urlGenerator = $this->getMockBuilder('\OCP\IUrlGenerator')->getMock();
$this->share = $this->getMockBuilder('\OCP\Share\IShare')->getMock();
$this->activityManager = $this->getMockBuilder('OCP\Activity\IManager')->getMock();
+ $this->settingsManager = $this->getMockBuilder(SettingsManager::class)->disableOriginalConstructor()->getMock();
$this->userManager->expects($this->any())->method('userExists')->willReturn(true);
}
@@ -121,7 +124,8 @@ class ShareByMailProviderTest extends TestCase {
$this->logger,
$this->mailer,
$this->urlGenerator,
- $this->activityManager
+ $this->activityManager,
+ $this->settingsManager
]
);
@@ -139,7 +143,8 @@ class ShareByMailProviderTest extends TestCase {
$this->logger,
$this->mailer,
$this->urlGenerator,
- $this->activityManager
+ $this->activityManager,
+ $this->settingsManager
);
}
@@ -311,7 +316,7 @@ class ShareByMailProviderTest extends TestCase {
$this->share->expects($this->once())->method('getPermissions')->willReturn($permissions + 1);
$this->share->expects($this->once())->method('getShareOwner')->willReturn($uidOwner);
$this->share->expects($this->once())->method('getSharedBy')->willReturn($sharedBy);
- $this->share->expects($this->once())->method('getId')->willReturn($id);
+ $this->share->expects($this->atLeastOnce())->method('getId')->willReturn($id);
$this->assertSame($this->share,
$instance->update($this->share)