diff options
author | Bjoern Schiessle <bjoern@schiessle.org> | 2018-07-13 10:51:22 +0200 |
---|---|---|
committer | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2018-07-21 15:02:19 +0200 |
commit | b81962e3e865e9187d099bcb958cec9acfc7d593 (patch) | |
tree | 473931f3540814b2b93db35ad3b49b0446581223 /tests/lib/Share20 | |
parent | 2250dbec215ba6336160ae1b71102ae072863f1a (diff) | |
download | nextcloud-server-b81962e3e865e9187d099bcb958cec9acfc7d593.tar.gz nextcloud-server-b81962e3e865e9187d099bcb958cec9acfc7d593.zip |
fix unit tests
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
Diffstat (limited to 'tests/lib/Share20')
-rw-r--r-- | tests/lib/Share20/DefaultShareProviderTest.php | 52 |
1 files changed, 48 insertions, 4 deletions
diff --git a/tests/lib/Share20/DefaultShareProviderTest.php b/tests/lib/Share20/DefaultShareProviderTest.php index 230c8db40ce..19f37160627 100644 --- a/tests/lib/Share20/DefaultShareProviderTest.php +++ b/tests/lib/Share20/DefaultShareProviderTest.php @@ -22,15 +22,19 @@ namespace Test\Share20; use OCP\DB\QueryBuilder\IQueryBuilder; +use OCP\Defaults; use OCP\Files\File; use OCP\Files\Folder; use OCP\IDBConnection; use OCP\IGroup; +use OCP\IL10N; +use OCP\IURLGenerator; use OCP\IUser; use OCP\IUserManager; use OCP\IGroupManager; use OCP\Files\IRootFolder; use OC\Share20\DefaultShareProvider; +use OCP\Mail\IMailer; use OCP\Share\IShare; /** @@ -56,11 +60,27 @@ class DefaultShareProviderTest extends \Test\TestCase { /** @var DefaultShareProvider */ protected $provider; + /** @var \PHPUnit_Framework_MockObject_MockObject|IMailer */ + protected $mailer; + + /** @var \PHPUnit_Framework_MockObject_MockObject|IL10N */ + protected $l10n; + + /** @var \PHPUnit_Framework_MockObject_MockObject|Defaults */ + protected $defaults; + + /** @var \PHPUnit_Framework_MockObject_MockObject|IURLGenerator */ + protected $urlGenerator; + public function setUp() { $this->dbConn = \OC::$server->getDatabaseConnection(); $this->userManager = $this->createMock(IUserManager::class); $this->groupManager = $this->createMock(IGroupManager::class); $this->rootFolder = $this->createMock(IRootFolder::class); + $this->mailer = $this->createMock(IMailer::class); + $this->l10n = $this->createMock(IL10N::class); + $this->defaults = $this->getMockBuilder(Defaults::class)->disableOriginalConstructor()->getMock(); + $this->urlGenerator = $this->createMock(IURLGenerator::class); $this->userManager->expects($this->any())->method('userExists')->willReturn(true); @@ -71,7 +91,11 @@ class DefaultShareProviderTest extends \Test\TestCase { $this->dbConn, $this->userManager, $this->groupManager, - $this->rootFolder + $this->rootFolder, + $this->mailer, + $this->defaults, + $this->l10n, + $this->urlGenerator ); } @@ -403,6 +427,10 @@ class DefaultShareProviderTest extends \Test\TestCase { $this->userManager, $this->groupManager, $this->rootFolder, + $this->mailer, + $this->defaults, + $this->l10n, + $this->urlGenerator ]) ->setMethods(['getShareById']) ->getMock(); @@ -493,6 +521,10 @@ class DefaultShareProviderTest extends \Test\TestCase { $this->userManager, $this->groupManager, $this->rootFolder, + $this->mailer, + $this->defaults, + $this->l10n, + $this->urlGenerator ]) ->setMethods(['getShareById']) ->getMock(); @@ -2368,7 +2400,11 @@ class DefaultShareProviderTest extends \Test\TestCase { $this->dbConn, $userManager, $groupManager, - $rootFolder + $rootFolder, + $this->mailer, + $this->defaults, + $this->l10n, + $this->urlGenerator ); $password = md5(time()); @@ -2461,7 +2497,11 @@ class DefaultShareProviderTest extends \Test\TestCase { $this->dbConn, $userManager, $groupManager, - $rootFolder + $rootFolder, + $this->mailer, + $this->defaults, + $this->l10n, + $this->urlGenerator ); $u1 = $userManager->createUser('testShare1', 'test'); @@ -2552,7 +2592,11 @@ class DefaultShareProviderTest extends \Test\TestCase { $this->dbConn, $userManager, $groupManager, - $rootFolder + $rootFolder, + $this->mailer, + $this->defaults, + $this->l10n, + $this->urlGenerator ); $u1 = $userManager->createUser('testShare1', 'test'); |