diff options
author | Joas Schilling <coding@schilljs.com> | 2020-06-23 08:14:27 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2020-06-23 22:01:40 +0200 |
commit | 95652d4469431036532085a9a00ce322e80a13ec (patch) | |
tree | cf264b7ad6be6fee58244ccd1b2fef256920ce94 /tests/lib | |
parent | a29359a7267572d1b8ef2bcf34464b02a6aba9da (diff) | |
download | nextcloud-server-95652d4469431036532085a9a00ce322e80a13ec.tar.gz nextcloud-server-95652d4469431036532085a9a00ce322e80a13ec.zip |
Fix language in share notes email for users
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'tests/lib')
-rw-r--r-- | tests/lib/Share20/DefaultShareProviderTest.php | 41 |
1 files changed, 29 insertions, 12 deletions
diff --git a/tests/lib/Share20/DefaultShareProviderTest.php b/tests/lib/Share20/DefaultShareProviderTest.php index 6f8a96fab19..cb332ac186a 100644 --- a/tests/lib/Share20/DefaultShareProviderTest.php +++ b/tests/lib/Share20/DefaultShareProviderTest.php @@ -28,6 +28,7 @@ use OCP\Defaults; use OCP\Files\File; use OCP\Files\Folder; use OCP\Files\IRootFolder; +use OCP\IConfig; use OCP\IDBConnection; use OCP\IGroup; use OCP\IGroupManager; @@ -35,8 +36,10 @@ use OCP\IL10N; use OCP\IURLGenerator; use OCP\IUser; use OCP\IUserManager; +use OCP\L10N\IFactory; use OCP\Mail\IMailer; use OCP\Share\IShare; +use PHPUnit\Framework\MockObject\MockObject; /** * Class DefaultShareProviderTest @@ -64,6 +67,9 @@ class DefaultShareProviderTest extends \Test\TestCase { /** @var \PHPUnit_Framework_MockObject_MockObject|IMailer */ protected $mailer; + /** @var IFactory|MockObject */ + protected $l10nFactory; + /** @var \PHPUnit_Framework_MockObject_MockObject|IL10N */ protected $l10n; @@ -73,15 +79,20 @@ class DefaultShareProviderTest extends \Test\TestCase { /** @var \PHPUnit_Framework_MockObject_MockObject|IURLGenerator */ protected $urlGenerator; + /** @var IConfig|MockObject */ + protected $config; + protected function setUp(): void { $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->l10nFactory = $this->createMock(IFactory::class); $this->l10n = $this->createMock(IL10N::class); $this->defaults = $this->getMockBuilder(Defaults::class)->disableOriginalConstructor()->getMock(); $this->urlGenerator = $this->createMock(IURLGenerator::class); + $this->config = $this->createMock(IConfig::class); $this->userManager->expects($this->any())->method('userExists')->willReturn(true); @@ -95,8 +106,9 @@ class DefaultShareProviderTest extends \Test\TestCase { $this->rootFolder, $this->mailer, $this->defaults, - $this->l10n, - $this->urlGenerator + $this->l10nFactory, + $this->urlGenerator, + $this->config ); } @@ -454,8 +466,9 @@ class DefaultShareProviderTest extends \Test\TestCase { $this->rootFolder, $this->mailer, $this->defaults, - $this->l10n, - $this->urlGenerator + $this->l10nFactory, + $this->urlGenerator, + $this->config ]) ->setMethods(['getShareById']) ->getMock(); @@ -548,8 +561,9 @@ class DefaultShareProviderTest extends \Test\TestCase { $this->rootFolder, $this->mailer, $this->defaults, - $this->l10n, - $this->urlGenerator + $this->l10nFactory, + $this->urlGenerator, + $this->config ]) ->setMethods(['getShareById']) ->getMock(); @@ -2474,8 +2488,9 @@ class DefaultShareProviderTest extends \Test\TestCase { $rootFolder, $this->mailer, $this->defaults, - $this->l10n, - $this->urlGenerator + $this->l10nFactory, + $this->urlGenerator, + $this->config ); $password = md5(time()); @@ -2571,8 +2586,9 @@ class DefaultShareProviderTest extends \Test\TestCase { $rootFolder, $this->mailer, $this->defaults, - $this->l10n, - $this->urlGenerator + $this->l10nFactory, + $this->urlGenerator, + $this->config ); $u1 = $userManager->createUser('testShare1', 'test'); @@ -2666,8 +2682,9 @@ class DefaultShareProviderTest extends \Test\TestCase { $rootFolder, $this->mailer, $this->defaults, - $this->l10n, - $this->urlGenerator + $this->l10nFactory, + $this->urlGenerator, + $this->config ); $u1 = $userManager->createUser('testShare1', 'test'); |