summaryrefslogtreecommitdiffstats
path: root/apps/theming/tests
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2018-06-07 11:42:21 +0200
committerRoeland Jago Douma <roeland@famdouma.nl>2018-06-07 11:42:21 +0200
commitf65a6e782c155e30df63420a343b865d18ba213e (patch)
tree0ac982243c8871e6b00a1192a57d4d70e4c78184 /apps/theming/tests
parent132597bbd3e3e1633fa83c77c268242d5c59a4f4 (diff)
downloadnextcloud-server-f65a6e782c155e30df63420a343b865d18ba213e.tar.gz
nextcloud-server-f65a6e782c155e30df63420a343b865d18ba213e.zip
Mock the timefactory in the theming tests
Now that the cache logic is moved to the theming controller we must properly overwrite this service. Else it could do :boom: in tests. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'apps/theming/tests')
-rw-r--r--apps/theming/tests/Controller/ThemingControllerTest.php12
1 files changed, 7 insertions, 5 deletions
diff --git a/apps/theming/tests/Controller/ThemingControllerTest.php b/apps/theming/tests/Controller/ThemingControllerTest.php
index 4a2b780076c..60ec2c1dc63 100644
--- a/apps/theming/tests/Controller/ThemingControllerTest.php
+++ b/apps/theming/tests/Controller/ThemingControllerTest.php
@@ -86,26 +86,28 @@ class ThemingControllerTest extends TestCase {
$this->request = $this->createMock(IRequest::class);
$this->config = $this->createMock(IConfig::class);
$this->themingDefaults = $this->createMock(ThemingDefaults::class);
- $this->timeFactory = $this->createMock(ITimeFactory::class);
$this->l10n = $this->createMock(L10N::class);
$this->appData = $this->createMock(IAppData::class);
$this->appManager = $this->createMock(IAppManager::class);
$this->util = new Util($this->config, $this->appManager, $this->appData);
- $this->timeFactory->expects($this->any())
- ->method('getTime')
- ->willReturn(123);
$this->tempManager = \OC::$server->getTempManager();
$this->scssCacher = $this->createMock(SCSSCacher::class);
$this->urlGenerator = $this->createMock(IURLGenerator::class);
$this->imageManager = $this->createMock(ImageManager::class);
+ $this->timeFactory = $this->createMock(ITimeFactory::class);
+ $this->timeFactory->expects($this->any())
+ ->method('getTime')
+ ->willReturn(123);
+
+ $this->overwriteService(ITimeFactory::class, $this->timeFactory);
+
$this->themingController = new ThemingController(
'theming',
$this->request,
$this->config,
$this->themingDefaults,
$this->util,
- $this->timeFactory,
$this->l10n,
$this->tempManager,
$this->appData,