summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorKyle Fazzari <kyrofa@ubuntu.com>2018-02-24 08:16:42 -0800
committerKyle Fazzari <kyrofa@ubuntu.com>2018-02-24 08:16:42 -0800
commit25c89a6feb80ded179adf995eff8b0539673d287 (patch)
tree37c160921324d911edd1c42db101f1c7ba1d78ec /apps
parenta1f18241166f335b89a6cf3d002efd3d825fde19 (diff)
downloadnextcloud-server-25c89a6feb80ded179adf995eff8b0539673d287.tar.gz
nextcloud-server-25c89a6feb80ded179adf995eff8b0539673d287.zip
Add mock to setup
Signed-off-by: Kyle Fazzari <kyrofa@ubuntu.com>
Diffstat (limited to 'apps')
-rw-r--r--apps/theming/tests/Controller/ThemingControllerTest.php20
1 files changed, 4 insertions, 16 deletions
diff --git a/apps/theming/tests/Controller/ThemingControllerTest.php b/apps/theming/tests/Controller/ThemingControllerTest.php
index 9ab8d7a06e9..debc1b71e47 100644
--- a/apps/theming/tests/Controller/ThemingControllerTest.php
+++ b/apps/theming/tests/Controller/ThemingControllerTest.php
@@ -106,7 +106,8 @@ class ThemingControllerTest extends TestCase {
$this->tempManager,
$this->appData,
$this->scssCacher,
- $this->urlGenerator
+ $this->urlGenerator,
+ $this->appManager
);
return parent::setUp();
@@ -798,7 +799,7 @@ class ThemingControllerTest extends TestCase {
public function testGetStylesheet() {
-
+ $this->appManager->expects($this->once())->method('getAppPath')->with('theming')->willReturn(\OC::$SERVERROOT . '/theming');
$file = $this->createMock(ISimpleFile::class);
$file->expects($this->any())->method('getName')->willReturn('theming.css');
$file->expects($this->any())->method('getContent')->willReturn('compiled');
@@ -818,6 +819,7 @@ class ThemingControllerTest extends TestCase {
}
public function testGetStylesheetFails() {
+ $this->appManager->expects($this->once())->method('getAppPath')->with('theming')->willReturn(\OC::$SERVERROOT . '/theming');
$file = $this->createMock(ISimpleFile::class);
$file->expects($this->any())->method('getName')->willReturn('theming.css');
$file->expects($this->any())->method('getContent')->willReturn('compiled');
@@ -830,20 +832,6 @@ class ThemingControllerTest extends TestCase {
}
public function testGetStylesheetOutsideServerroot() {
- $this->themingController = new ThemingController(
- 'theming',
- $this->request,
- $this->config,
- $this->themingDefaults,
- $this->util,
- $this->timeFactory,
- $this->l10n,
- $this->tempManager,
- $this->appData,
- $this->scssCacher,
- $this->urlGenerator,
- $this->appManager
- );
$this->appManager->expects($this->once())->method('getAppPath')->with('theming')->willReturn('/outside/serverroot/theming');
$file = $this->createMock(ISimpleFile::class);
$file->expects($this->any())->method('getName')->willReturn('theming.css');