Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'apps/theming/tests/Settings/AdminTest.php')
-rw-r--r--apps/theming/tests/Settings/AdminTest.php31
1 files changed, 15 insertions, 16 deletions
diff --git a/apps/theming/tests/Settings/AdminTest.php b/apps/theming/tests/Settings/AdminTest.php
index ee49cf0f1f6..4eac689fb3f 100644
--- a/apps/theming/tests/Settings/AdminTest.php
+++ b/apps/theming/tests/Settings/AdminTest.php
@@ -27,6 +27,7 @@
namespace OCA\Theming\Tests\Settings;
+use OCA\Theming\ImageManager;
use OCA\Theming\Settings\Admin;
use OCA\Theming\ThemingDefaults;
use OCP\AppFramework\Http\TemplateResponse;
@@ -44,21 +45,25 @@ class AdminTest extends TestCase {
private $themingDefaults;
/** @var IURLGenerator */
private $urlGenerator;
+ /** @var ImageManager */
+ private $imageManager;
/** @var IL10N */
private $l10n;
public function setUp() {
parent::setUp();
- $this->config = $this->getMockBuilder(IConfig::class)->getMock();
- $this->l10n = $this->getMockBuilder(IL10N::class)->getMock();
- $this->themingDefaults = $this->getMockBuilder('\OCA\Theming\ThemingDefaults')->disableOriginalConstructor()->getMock();
- $this->urlGenerator = $this->getMockBuilder(IURLGenerator::class)->getMock();
+ $this->config = $this->createMock(IConfig::class);
+ $this->l10n = $this->createMock(IL10N::class);
+ $this->themingDefaults = $this->createMock(ThemingDefaults::class);
+ $this->urlGenerator = $this->createMock(IURLGenerator::class);
+ $this->imageManager = $this->createMock(ImageManager::class);
$this->admin = new Admin(
$this->config,
$this->l10n,
$this->themingDefaults,
- $this->urlGenerator
+ $this->urlGenerator,
+ $this->imageManager
);
}
@@ -87,7 +92,7 @@ class AdminTest extends TestCase {
$this->urlGenerator
->expects($this->once())
->method('linkToRoute')
- ->with('theming.Theming.updateLogo')
+ ->with('theming.Theming.uploadImage')
->willReturn('/my/route');
$params = [
'themable' => true,
@@ -97,12 +102,9 @@ class AdminTest extends TestCase {
'slogan' => 'MySlogan',
'color' => '#fff',
'uploadLogoRoute' => '/my/route',
- 'logo' => null,
- 'logoMime' => null,
- 'background' => null,
- 'backgroundMime' => null,
'canThemeIcons' => null,
'iconDocs' => null,
+ 'images' => [],
];
$expected = new TemplateResponse('theming', 'settings-admin', $params, '');
@@ -139,7 +141,7 @@ class AdminTest extends TestCase {
$this->urlGenerator
->expects($this->once())
->method('linkToRoute')
- ->with('theming.Theming.updateLogo')
+ ->with('theming.Theming.uploadImage')
->willReturn('/my/route');
$params = [
'themable' => false,
@@ -149,12 +151,9 @@ class AdminTest extends TestCase {
'slogan' => 'MySlogan',
'color' => '#fff',
'uploadLogoRoute' => '/my/route',
- 'logo' => null,
- 'logoMime' => null,
- 'background' => null,
- 'backgroundMime' => null,
'canThemeIcons' => null,
- 'iconDocs' => null,
+ 'iconDocs' => '',
+ 'images' => [],
];
$expected = new TemplateResponse('theming', 'settings-admin', $params, '');