aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2018-02-08 23:18:00 +0100
committerGitHub <noreply@github.com>2018-02-08 23:18:00 +0100
commitba9711f5d3c74f9ab46ac15cd64a4ce1e8059773 (patch)
treeb43524b26ca150cb99691673374ea99b34403ae3 /tests
parentb63ea2c77139a3af6d5b891f1674a24ce9d3d783 (diff)
parentf07d3a3b5507c99639158fbea4583a7bd5885100 (diff)
downloadnextcloud-server-ba9711f5d3c74f9ab46ac15cd64a4ce1e8059773.tar.gz
nextcloud-server-ba9711f5d3c74f9ab46ac15cd64a4ce1e8059773.zip
Merge pull request #8263 from nextcloud/fix_dev_man_link
Link to NC 14 dev manual
Diffstat (limited to 'tests')
-rw-r--r--tests/Settings/Controller/AppSettingsControllerTest.php25
1 files changed, 22 insertions, 3 deletions
diff --git a/tests/Settings/Controller/AppSettingsControllerTest.php b/tests/Settings/Controller/AppSettingsControllerTest.php
index 6631873d8ad..2f916b89707 100644
--- a/tests/Settings/Controller/AppSettingsControllerTest.php
+++ b/tests/Settings/Controller/AppSettingsControllerTest.php
@@ -30,6 +30,7 @@ use OC\Settings\Controller\AppSettingsController;
use OCP\AppFramework\Http\ContentSecurityPolicy;
use OCP\AppFramework\Http\JSONResponse;
use OCP\AppFramework\Http\TemplateResponse;
+use OCP\IURLGenerator;
use OCP\L10N\IFactory;
use Test\TestCase;
use OCP\IRequest;
@@ -66,6 +67,8 @@ class AppSettingsControllerTest extends TestCase {
private $bundleFetcher;
/** @var Installer|\PHPUnit_Framework_MockObject_MockObject */
private $installer;
+ /** @var IURLGenerator|\PHPUnit_Framework_MockObject_MockObject */
+ private $urlGenerator;
public function setUp() {
parent::setUp();
@@ -83,6 +86,7 @@ class AppSettingsControllerTest extends TestCase {
$this->l10nFactory = $this->createMock(IFactory::class);
$this->bundleFetcher = $this->createMock(BundleFetcher::class);
$this->installer = $this->createMock(Installer::class);
+ $this->urlGenerator = $this->createMock(IURLGenerator::class);
$this->appSettingsController = new AppSettingsController(
'settings',
@@ -95,7 +99,8 @@ class AppSettingsControllerTest extends TestCase {
$this->appFetcher,
$this->l10nFactory,
$this->bundleFetcher,
- $this->installer
+ $this->installer,
+ $this->urlGenerator
);
}
@@ -204,7 +209,14 @@ class AppSettingsControllerTest extends TestCase {
$policy = new ContentSecurityPolicy();
$policy->addAllowedImageDomain('https://usercontent.apps.nextcloud.com');
- $expected = new TemplateResponse('settings', 'apps', ['category' => 'installed', 'appstoreEnabled' => true], 'user');
+ $expected = new TemplateResponse('settings',
+ 'apps',
+ [
+ 'category' => 'installed',
+ 'appstoreEnabled' => true,
+ 'urlGenerator' => $this->urlGenerator,
+ ],
+ 'user');
$expected->setContentSecurityPolicy($policy);
$this->assertEquals($expected, $this->appSettingsController->viewApps());
@@ -224,7 +236,14 @@ class AppSettingsControllerTest extends TestCase {
$policy = new ContentSecurityPolicy();
$policy->addAllowedImageDomain('https://usercontent.apps.nextcloud.com');
- $expected = new TemplateResponse('settings', 'apps', ['category' => 'installed', 'appstoreEnabled' => false], 'user');
+ $expected = new TemplateResponse('settings',
+ 'apps',
+ [
+ 'category' => 'installed',
+ 'appstoreEnabled' => false,
+ 'urlGenerator' => $this->urlGenerator,
+ ],
+ 'user');
$expected->setContentSecurityPolicy($policy);
$this->assertEquals($expected, $this->appSettingsController->viewApps());