diff options
author | Kyle Fazzari <kyrofa@ubuntu.com> | 2018-02-24 08:16:42 -0800 |
---|---|---|
committer | Kyle Fazzari <kyrofa@ubuntu.com> | 2018-02-24 08:16:42 -0800 |
commit | 25c89a6feb80ded179adf995eff8b0539673d287 (patch) | |
tree | 37c160921324d911edd1c42db101f1c7ba1d78ec /apps | |
parent | a1f18241166f335b89a6cf3d002efd3d825fde19 (diff) | |
download | nextcloud-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.php | 20 |
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'); |