summaryrefslogtreecommitdiffstats
path: root/apps/updatenotification/tests
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2019-05-13 14:11:07 +0200
committerMorris Jobke <hey@morrisjobke.de>2019-07-10 16:19:34 +0200
commit39c28bd05ba7ec106c7e86592e00192a550e50f7 (patch)
tree9eaf1303fd0263c293b5f9336c6ce04bdb0ae189 /apps/updatenotification/tests
parente94bbfc5827b9d5ebb87bb7c5038b6d2d617d27f (diff)
downloadnextcloud-server-39c28bd05ba7ec106c7e86592e00192a550e50f7.tar.gz
nextcloud-server-39c28bd05ba7ec106c7e86592e00192a550e50f7.zip
Enterprise update channel
Allows to select the enterprise update channel for instances that have a valid subscription. Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'apps/updatenotification/tests')
-rw-r--r--apps/updatenotification/tests/Settings/AdminTest.php12
1 files changed, 11 insertions, 1 deletions
diff --git a/apps/updatenotification/tests/Settings/AdminTest.php b/apps/updatenotification/tests/Settings/AdminTest.php
index 9d40cb4d292..d2d4b503bad 100644
--- a/apps/updatenotification/tests/Settings/AdminTest.php
+++ b/apps/updatenotification/tests/Settings/AdminTest.php
@@ -35,6 +35,7 @@ use OCP\IGroupManager;
use OCP\IUserSession;
use OCP\L10N\IFactory;
use OCP\L10N\ILanguageIterator;
+use OCP\Support\Subscription\IRegistry;
use OCP\Util;
use Test\TestCase;
@@ -51,6 +52,8 @@ class AdminTest extends TestCase {
private $groupManager;
/** @var IDateTimeFormatter|\PHPUnit_Framework_MockObject_MockObject */
private $dateTimeFormatter;
+ /** @var IRegistry|\PHPUnit_Framework_MockObject_MockObject */
+ private $subscriptionRegistry;
public function setUp() {
parent::setUp();
@@ -60,9 +63,10 @@ class AdminTest extends TestCase {
$this->groupManager = $this->createMock(IGroupManager::class);
$this->dateTimeFormatter = $this->createMock(IDateTimeFormatter::class);
$this->l10nFactory = $this->createMock(IFactory::class);
+ $this->subscriptionRegistry = $this->createMock(IRegistry::class);
$this->admin = new Admin(
- $this->config, $this->updateChecker, $this->groupManager, $this->dateTimeFormatter, $this->l10nFactory
+ $this->config, $this->updateChecker, $this->groupManager, $this->dateTimeFormatter, $this->l10nFactory, $this->subscriptionRegistry
);
}
@@ -120,6 +124,11 @@ class AdminTest extends TestCase {
->with('admin')
->willReturn($group);
+ $this->subscriptionRegistry
+ ->expects($this->once())
+ ->method('delegateHasValidSubscription')
+ ->willReturn(true);
+
$params = [
'json' => json_encode([
'isNewVersionAvailable' => true,
@@ -138,6 +147,7 @@ class AdminTest extends TestCase {
'notifyGroups' => [
['value' => 'admin', 'label' => 'Administrators'],
],
+ 'hasValidSubscription' => true,
]),
];