diff options
author | Joas Schilling <coding@schilljs.com> | 2016-12-02 09:37:08 +0100 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2016-12-02 09:37:08 +0100 |
commit | 5ba13dd0e41d37c4087c1d0c02fc758983e97e31 (patch) | |
tree | 7ef5d5ec3cbb6860fb77dd51c7d63e638f11364a /apps/updatenotification/tests/Notification | |
parent | 01f4c7550538a30311597d4eb9b889fbb04c4d67 (diff) | |
download | nextcloud-server-5ba13dd0e41d37c4087c1d0c02fc758983e97e31.tar.gz nextcloud-server-5ba13dd0e41d37c4087c1d0c02fc758983e97e31.zip |
Fix tests
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps/updatenotification/tests/Notification')
-rw-r--r-- | apps/updatenotification/tests/Notification/NotifierTest.php | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/apps/updatenotification/tests/Notification/NotifierTest.php b/apps/updatenotification/tests/Notification/NotifierTest.php index e5ccb291b5c..421fcada689 100644 --- a/apps/updatenotification/tests/Notification/NotifierTest.php +++ b/apps/updatenotification/tests/Notification/NotifierTest.php @@ -24,12 +24,16 @@ namespace OCA\UpdateNotification\Tests\Notification; use OCA\UpdateNotification\Notification\Notifier; +use OCP\IURLGenerator; use OCP\L10N\IFactory; use OCP\Notification\IManager; +use OCP\Notification\INotification; use Test\TestCase; class NotifierTest extends TestCase { + /** @var IURLGenerator|\PHPUnit_Framework_MockObject_MockObject */ + protected $urlGenerator; /** @var IManager|\PHPUnit_Framework_MockObject_MockObject */ protected $notificationManager; /** @var IFactory|\PHPUnit_Framework_MockObject_MockObject */ @@ -38,8 +42,9 @@ class NotifierTest extends TestCase { public function setUp() { parent::setUp(); - $this->notificationManager = $this->getMockBuilder('OCP\Notification\IManager')->getMock(); - $this->l10nFactory = $this->getMockBuilder('OCP\L10n\IFactory')->getMock(); + $this->urlGenerator = $this->createMock(IURLGenerator::class); + $this->notificationManager = $this->createMock(IManager::class); + $this->l10nFactory = $this->createMock(IFactory::class); } /** @@ -49,12 +54,14 @@ class NotifierTest extends TestCase { protected function getNotifier(array $methods = []) { if (empty($methods)) { return new Notifier( + $this->urlGenerator, $this->notificationManager, $this->l10nFactory ); } { - return $this->getMockBuilder('OCA\UpdateNotification\Notification\Notifier') + return $this->getMockBuilder(Notifier::class) ->setConstructorArgs([ + $this->urlGenerator, $this->notificationManager, $this->l10nFactory, ]) @@ -81,7 +88,7 @@ class NotifierTest extends TestCase { public function testUpdateAlreadyInstalledCheck($versionNotification, $versionInstalled, $exception) { $notifier = $this->getNotifier(); - $notification = $this->getMockBuilder('OCP\Notification\INotification')->getMock(); + $notification = $this->createMock(INotification::class); $notification->expects($this->once()) ->method('getObjectId') ->willReturn($versionNotification); |