From 338106124f249965d67c26b292e61e2113e304c1 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 25 May 2016 12:11:51 +0200 Subject: [PATCH] Fix failing update notifications tests --- .../tests/Controller/AdminControllerTest.php | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/apps/updatenotification/tests/Controller/AdminControllerTest.php b/apps/updatenotification/tests/Controller/AdminControllerTest.php index d8fc2dd335..71364de480 100644 --- a/apps/updatenotification/tests/Controller/AdminControllerTest.php +++ b/apps/updatenotification/tests/Controller/AdminControllerTest.php @@ -95,10 +95,12 @@ class AdminControllerTest extends TestCase { } $this->config - ->expects($this->once()) + ->expects($this->exactly(2)) ->method('getAppValue') - ->with('core', 'lastupdatedat') - ->willReturn('12345'); + ->willReturnMap([ + ['core', 'lastupdatedat', '', '12345'], + ['updatenotification', 'notify_groups', '["admin"]', '["admin"]'], + ]); $this->dateTimeFormatter ->expects($this->once()) ->method('formatDateTime') @@ -115,6 +117,7 @@ class AdminControllerTest extends TestCase { 'currentChannel' => \OCP\Util::getChannel(), 'channels' => $channels, 'newVersionString' => '8.1.2', + 'notify_groups' => 'admin', ]; $expected = new TemplateResponse('updatenotification', 'admin', $params, ''); @@ -136,10 +139,12 @@ class AdminControllerTest extends TestCase { } $this->config - ->expects($this->once()) + ->expects($this->exactly(2)) ->method('getAppValue') - ->with('core', 'lastupdatedat') - ->willReturn('12345'); + ->willReturnMap([ + ['core', 'lastupdatedat', '', '12345'], + ['updatenotification', 'notify_groups', '["admin"]', '["admin"]'], + ]); $this->dateTimeFormatter ->expects($this->once()) ->method('formatDateTime') @@ -156,6 +161,7 @@ class AdminControllerTest extends TestCase { 'currentChannel' => \OCP\Util::getChannel(), 'channels' => $channels, 'newVersionString' => '', + 'notify_groups' => 'admin', ]; $expected = new TemplateResponse('updatenotification', 'admin', $params, '');