Selaa lähdekoodia

Add mock to setup

Signed-off-by: Kyle Fazzari <kyrofa@ubuntu.com>
tags/v14.0.0beta1
Kyle Fazzari 6 vuotta sitten
vanhempi
commit
25c89a6feb
No account linked to committer's email address
1 muutettua tiedostoa jossa 4 lisäystä ja 16 poistoa
  1. 4
    16
      apps/theming/tests/Controller/ThemingControllerTest.php

+ 4
- 16
apps/theming/tests/Controller/ThemingControllerTest.php Näytä tiedosto

@@ -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');

Loading…
Peruuta
Tallenna