diff options
author | Joas Schilling <nickvergessen@owncloud.com> | 2016-01-14 14:35:24 +0100 |
---|---|---|
committer | Joas Schilling <nickvergessen@owncloud.com> | 2016-01-22 10:32:42 +0100 |
commit | ee02165005f3fd24e1a17fdb3faeedda036d93c7 (patch) | |
tree | 1fd047788bb8f439665ff3e61d135bb6a62856c9 /tests/lib/notification | |
parent | e2e5eedb40a15ef3a6971e2145abec24873c4400 (diff) | |
download | nextcloud-server-ee02165005f3fd24e1a17fdb3faeedda036d93c7.tar.gz nextcloud-server-ee02165005f3fd24e1a17fdb3faeedda036d93c7.zip |
Move the notification API to public namespace
Diffstat (limited to 'tests/lib/notification')
-rw-r--r-- | tests/lib/notification/actiontest.php | 2 | ||||
-rw-r--r-- | tests/lib/notification/managertest.php | 92 | ||||
-rw-r--r-- | tests/lib/notification/notificationtest.php | 34 |
3 files changed, 64 insertions, 64 deletions
diff --git a/tests/lib/notification/actiontest.php b/tests/lib/notification/actiontest.php index 0044df82cd1..74c995280c9 100644 --- a/tests/lib/notification/actiontest.php +++ b/tests/lib/notification/actiontest.php @@ -23,7 +23,7 @@ namespace Test\Notification; use OC\Notification\Action; -use OC\Notification\IAction; +use OCP\Notification\IAction; use Test\TestCase; class ActionTest extends TestCase { diff --git a/tests/lib/notification/managertest.php b/tests/lib/notification/managertest.php index 1f411bc74ee..4410781bc31 100644 --- a/tests/lib/notification/managertest.php +++ b/tests/lib/notification/managertest.php @@ -22,7 +22,7 @@ namespace Test\Notification; use OC\Notification\Manager; -use OC\Notification\IManager; +use OCP\Notification\IManager; use Test\TestCase; class ManagerTest extends TestCase { @@ -35,7 +35,7 @@ class ManagerTest extends TestCase { } public function testRegisterApp() { - $app = $this->getMockBuilder('OC\Notification\IApp') + $app = $this->getMockBuilder('OCP\Notification\IApp') ->disableOriginalConstructor() ->getMock(); @@ -59,7 +59,7 @@ class ManagerTest extends TestCase { * @expectedException \InvalidArgumentException */ public function testRegisterAppInvalid() { - $notifier = $this->getMockBuilder('OC\Notification\INotifier') + $notifier = $this->getMockBuilder('OCP\Notification\INotifier') ->disableOriginalConstructor() ->getMock(); @@ -73,7 +73,7 @@ class ManagerTest extends TestCase { } public function testRegisterNotifier() { - $notifier = $this->getMockBuilder('OC\Notification\INotifier') + $notifier = $this->getMockBuilder('OCP\Notification\INotifier') ->disableOriginalConstructor() ->getMock(); @@ -105,7 +105,7 @@ class ManagerTest extends TestCase { * @expectedException \InvalidArgumentException */ public function testRegisterNotifierInvalid() { - $app = $this->getMockBuilder('OC\Notification\IApp') + $app = $this->getMockBuilder('OCP\Notification\IApp') ->disableOriginalConstructor() ->getMock(); @@ -136,7 +136,7 @@ class ManagerTest extends TestCase { * @param mixed $data */ public function testRegisterNotifierInfoInvalid($data) { - $app = $this->getMockBuilder('OC\Notification\IApp') + $app = $this->getMockBuilder('OCP\Notification\IApp') ->disableOriginalConstructor() ->getMock(); @@ -156,7 +156,7 @@ class ManagerTest extends TestCase { * @expectedExceptionMessage The given notifier ID test1 is already in use */ public function testRegisterNotifierInfoDuplicate() { - $app = $this->getMockBuilder('OC\Notification\IApp') + $app = $this->getMockBuilder('OCP\Notification\IApp') ->disableOriginalConstructor() ->getMock(); @@ -177,28 +177,28 @@ class ManagerTest extends TestCase { public function testCreateNotification() { $action = $this->manager->createNotification(); - $this->assertInstanceOf('OC\Notification\INotification', $action); + $this->assertInstanceOf('OCP\Notification\INotification', $action); } public function testNotify() { - /** @var \OC\Notification\INotification|\PHPUnit_Framework_MockObject_MockObject $notification */ - $notification = $this->getMockBuilder('OC\Notification\INotification') + /** @var \OCP\Notification\INotification|\PHPUnit_Framework_MockObject_MockObject $notification */ + $notification = $this->getMockBuilder('OCP\Notification\INotification') ->disableOriginalConstructor() ->getMock(); $notification->expects($this->once()) ->method('isValid') ->willReturn(true); - /** @var \OC\Notification\IApp|\PHPUnit_Framework_MockObject_MockObject $app */ - $app = $this->getMockBuilder('OC\Notification\IApp') + /** @var \OCP\Notification\IApp|\PHPUnit_Framework_MockObject_MockObject $app */ + $app = $this->getMockBuilder('OCP\Notification\IApp') ->disableOriginalConstructor() ->getMock(); $app->expects($this->once()) ->method('notify') ->with($notification); - /** @var \OC\Notification\IApp|\PHPUnit_Framework_MockObject_MockObject $app2 */ - $app2 = $this->getMockBuilder('OC\Notification\IApp') + /** @var \OCP\Notification\IApp|\PHPUnit_Framework_MockObject_MockObject $app2 */ + $app2 = $this->getMockBuilder('OCP\Notification\IApp') ->disableOriginalConstructor() ->getMock(); $app2->expects($this->once()) @@ -219,8 +219,8 @@ class ManagerTest extends TestCase { * @expectedException \InvalidArgumentException */ public function testNotifyInvalid() { - /** @var \OC\Notification\INotification|\PHPUnit_Framework_MockObject_MockObject $notification */ - $notification = $this->getMockBuilder('OC\Notification\INotification') + /** @var \OCP\Notification\INotification|\PHPUnit_Framework_MockObject_MockObject $notification */ + $notification = $this->getMockBuilder('OCP\Notification\INotification') ->disableOriginalConstructor() ->getMock(); $notification->expects($this->once()) @@ -231,23 +231,23 @@ class ManagerTest extends TestCase { } public function testPrepare() { - /** @var \OC\Notification\INotification|\PHPUnit_Framework_MockObject_MockObject $notification */ - $notification = $this->getMockBuilder('OC\Notification\INotification') + /** @var \OCP\Notification\INotification|\PHPUnit_Framework_MockObject_MockObject $notification */ + $notification = $this->getMockBuilder('OCP\Notification\INotification') ->disableOriginalConstructor() ->getMock(); $notification->expects($this->once()) ->method('isValidParsed') ->willReturn(true); - /** @var \OC\Notification\INotification|\PHPUnit_Framework_MockObject_MockObject $notification2 */ - $notification2 = $this->getMockBuilder('OC\Notification\INotification') + /** @var \OCP\Notification\INotification|\PHPUnit_Framework_MockObject_MockObject $notification2 */ + $notification2 = $this->getMockBuilder('OCP\Notification\INotification') ->disableOriginalConstructor() ->getMock(); $notification2->expects($this->exactly(2)) ->method('isValidParsed') ->willReturn(true); - /** @var \OC\Notification\IApp|\PHPUnit_Framework_MockObject_MockObject $notifier */ - $notifier = $this->getMockBuilder('OC\Notification\INotifier') + /** @var \OCP\Notification\IApp|\PHPUnit_Framework_MockObject_MockObject $notifier */ + $notifier = $this->getMockBuilder('OCP\Notification\INotifier') ->disableOriginalConstructor() ->getMock(); $notifier->expects($this->once()) @@ -255,8 +255,8 @@ class ManagerTest extends TestCase { ->with($notification, 'en') ->willReturnArgument(0); - /** @var \OC\Notification\IApp|\PHPUnit_Framework_MockObject_MockObject $notifier2 */ - $notifier2 = $this->getMockBuilder('OC\Notification\INotifier') + /** @var \OCP\Notification\IApp|\PHPUnit_Framework_MockObject_MockObject $notifier2 */ + $notifier2 = $this->getMockBuilder('OCP\Notification\INotifier') ->disableOriginalConstructor() ->getMock(); $notifier2->expects($this->once()) @@ -282,16 +282,16 @@ class ManagerTest extends TestCase { * @expectedException \InvalidArgumentException */ public function testPrepareInvalid() { - /** @var \OC\Notification\INotification|\PHPUnit_Framework_MockObject_MockObject $notification */ - $notification = $this->getMockBuilder('OC\Notification\INotification') + /** @var \OCP\Notification\INotification|\PHPUnit_Framework_MockObject_MockObject $notification */ + $notification = $this->getMockBuilder('OCP\Notification\INotification') ->disableOriginalConstructor() ->getMock(); $notification->expects($this->once()) ->method('isValidParsed') ->willReturn(false); - /** @var \OC\Notification\IApp|\PHPUnit_Framework_MockObject_MockObject $notifier */ - $notifier = $this->getMockBuilder('OC\Notification\INotifier') + /** @var \OCP\Notification\IApp|\PHPUnit_Framework_MockObject_MockObject $notifier */ + $notifier = $this->getMockBuilder('OCP\Notification\INotifier') ->disableOriginalConstructor() ->getMock(); $notifier->expects($this->once()) @@ -309,16 +309,16 @@ class ManagerTest extends TestCase { } public function testPrepareNotifierThrows() { - /** @var \OC\Notification\INotification|\PHPUnit_Framework_MockObject_MockObject $notification */ - $notification = $this->getMockBuilder('OC\Notification\INotification') + /** @var \OCP\Notification\INotification|\PHPUnit_Framework_MockObject_MockObject $notification */ + $notification = $this->getMockBuilder('OCP\Notification\INotification') ->disableOriginalConstructor() ->getMock(); $notification->expects($this->once()) ->method('isValidParsed') ->willReturn(true); - /** @var \OC\Notification\IApp|\PHPUnit_Framework_MockObject_MockObject $notifier */ - $notifier = $this->getMockBuilder('OC\Notification\INotifier') + /** @var \OCP\Notification\IApp|\PHPUnit_Framework_MockObject_MockObject $notifier */ + $notifier = $this->getMockBuilder('OCP\Notification\INotifier') ->disableOriginalConstructor() ->getMock(); $notifier->expects($this->once()) @@ -339,8 +339,8 @@ class ManagerTest extends TestCase { * @expectedException \InvalidArgumentException */ public function testPrepareNoNotifier() { - /** @var \OC\Notification\INotification|\PHPUnit_Framework_MockObject_MockObject $notification */ - $notification = $this->getMockBuilder('OC\Notification\INotification') + /** @var \OCP\Notification\INotification|\PHPUnit_Framework_MockObject_MockObject $notification */ + $notification = $this->getMockBuilder('OCP\Notification\INotification') ->disableOriginalConstructor() ->getMock(); $notification->expects($this->once()) @@ -351,21 +351,21 @@ class ManagerTest extends TestCase { } public function testMarkProcessed() { - /** @var \OC\Notification\INotification|\PHPUnit_Framework_MockObject_MockObject $notification */ - $notification = $this->getMockBuilder('OC\Notification\INotification') + /** @var \OCP\Notification\INotification|\PHPUnit_Framework_MockObject_MockObject $notification */ + $notification = $this->getMockBuilder('OCP\Notification\INotification') ->disableOriginalConstructor() ->getMock(); - /** @var \OC\Notification\IApp|\PHPUnit_Framework_MockObject_MockObject $app */ - $app = $this->getMockBuilder('OC\Notification\IApp') + /** @var \OCP\Notification\IApp|\PHPUnit_Framework_MockObject_MockObject $app */ + $app = $this->getMockBuilder('OCP\Notification\IApp') ->disableOriginalConstructor() ->getMock(); $app->expects($this->once()) ->method('markProcessed') ->with($notification); - /** @var \OC\Notification\IApp|\PHPUnit_Framework_MockObject_MockObject $app2 */ - $app2 = $this->getMockBuilder('OC\Notification\IApp') + /** @var \OCP\Notification\IApp|\PHPUnit_Framework_MockObject_MockObject $app2 */ + $app2 = $this->getMockBuilder('OCP\Notification\IApp') ->disableOriginalConstructor() ->getMock(); $app2->expects($this->once()) @@ -383,13 +383,13 @@ class ManagerTest extends TestCase { } public function testGetCount() { - /** @var \OC\Notification\INotification|\PHPUnit_Framework_MockObject_MockObject $notification */ - $notification = $this->getMockBuilder('OC\Notification\INotification') + /** @var \OCP\Notification\INotification|\PHPUnit_Framework_MockObject_MockObject $notification */ + $notification = $this->getMockBuilder('OCP\Notification\INotification') ->disableOriginalConstructor() ->getMock(); - /** @var \OC\Notification\IApp|\PHPUnit_Framework_MockObject_MockObject $app */ - $app = $this->getMockBuilder('OC\Notification\IApp') + /** @var \OCP\Notification\IApp|\PHPUnit_Framework_MockObject_MockObject $app */ + $app = $this->getMockBuilder('OCP\Notification\IApp') ->disableOriginalConstructor() ->getMock(); $app->expects($this->once()) @@ -397,8 +397,8 @@ class ManagerTest extends TestCase { ->with($notification) ->willReturn(21); - /** @var \OC\Notification\IApp|\PHPUnit_Framework_MockObject_MockObject $app2 */ - $app2 = $this->getMockBuilder('OC\Notification\IApp') + /** @var \OCP\Notification\IApp|\PHPUnit_Framework_MockObject_MockObject $app2 */ + $app2 = $this->getMockBuilder('OCP\Notification\IApp') ->disableOriginalConstructor() ->getMock(); $app2->expects($this->once()) diff --git a/tests/lib/notification/notificationtest.php b/tests/lib/notification/notificationtest.php index 91fa1de8b42..ee9454c77a0 100644 --- a/tests/lib/notification/notificationtest.php +++ b/tests/lib/notification/notificationtest.php @@ -23,7 +23,7 @@ namespace Test\Notification; use OC\Notification\Notification; -use OC\Notification\INotification; +use OCP\Notification\INotification; use Test\TestCase; class NotificationTest extends TestCase { @@ -388,12 +388,12 @@ class NotificationTest extends TestCase { public function testCreateAction() { $action = $this->notification->createAction(); - $this->assertInstanceOf('OC\Notification\IAction', $action); + $this->assertInstanceOf('OCP\Notification\IAction', $action); } public function testAddAction() { - /** @var \OC\Notification\IAction|\PHPUnit_Framework_MockObject_MockObject $action */ - $action = $this->getMockBuilder('OC\Notification\IAction') + /** @var \OCP\Notification\IAction|\PHPUnit_Framework_MockObject_MockObject $action */ + $action = $this->getMockBuilder('OCP\Notification\IAction') ->disableOriginalConstructor() ->getMock(); $action->expects($this->once()) @@ -412,8 +412,8 @@ class NotificationTest extends TestCase { * @expectedException \InvalidArgumentException */ public function testAddActionInvalid() { - /** @var \OC\Notification\IAction|\PHPUnit_Framework_MockObject_MockObject $action */ - $action = $this->getMockBuilder('OC\Notification\IAction') + /** @var \OCP\Notification\IAction|\PHPUnit_Framework_MockObject_MockObject $action */ + $action = $this->getMockBuilder('OCP\Notification\IAction') ->disableOriginalConstructor() ->getMock(); $action->expects($this->once()) @@ -426,8 +426,8 @@ class NotificationTest extends TestCase { } public function testAddActionSecondPrimary() { - /** @var \OC\Notification\IAction|\PHPUnit_Framework_MockObject_MockObject $action */ - $action = $this->getMockBuilder('OC\Notification\IAction') + /** @var \OCP\Notification\IAction|\PHPUnit_Framework_MockObject_MockObject $action */ + $action = $this->getMockBuilder('OCP\Notification\IAction') ->disableOriginalConstructor() ->getMock(); $action->expects($this->exactly(2)) @@ -444,8 +444,8 @@ class NotificationTest extends TestCase { } public function testAddParsedAction() { - /** @var \OC\Notification\IAction|\PHPUnit_Framework_MockObject_MockObject $action */ - $action = $this->getMockBuilder('OC\Notification\IAction') + /** @var \OCP\Notification\IAction|\PHPUnit_Framework_MockObject_MockObject $action */ + $action = $this->getMockBuilder('OCP\Notification\IAction') ->disableOriginalConstructor() ->getMock(); $action->expects($this->once()) @@ -464,8 +464,8 @@ class NotificationTest extends TestCase { * @expectedException \InvalidArgumentException */ public function testAddParsedActionInvalid() { - /** @var \OC\Notification\IAction|\PHPUnit_Framework_MockObject_MockObject $action */ - $action = $this->getMockBuilder('OC\Notification\IAction') + /** @var \OCP\Notification\IAction|\PHPUnit_Framework_MockObject_MockObject $action */ + $action = $this->getMockBuilder('OCP\Notification\IAction') ->disableOriginalConstructor() ->getMock(); $action->expects($this->once()) @@ -478,8 +478,8 @@ class NotificationTest extends TestCase { } public function testAddActionSecondParsedPrimary() { - /** @var \OC\Notification\IAction|\PHPUnit_Framework_MockObject_MockObject $action */ - $action = $this->getMockBuilder('OC\Notification\IAction') + /** @var \OCP\Notification\IAction|\PHPUnit_Framework_MockObject_MockObject $action */ + $action = $this->getMockBuilder('OCP\Notification\IAction') ->disableOriginalConstructor() ->getMock(); $action->expects($this->exactly(2)) @@ -512,7 +512,7 @@ class NotificationTest extends TestCase { * @param bool $expected */ public function testIsValid($isValidCommon, $subject, $expected) { - /** @var \OC\Notification\INotification|\PHPUnit_Framework_MockObject_MockObject $notification */ + /** @var \OCP\Notification\INotification|\PHPUnit_Framework_MockObject_MockObject $notification */ $notification = $this->getMockBuilder('\OC\Notification\Notification') ->setMethods([ 'isValidCommon', @@ -543,7 +543,7 @@ class NotificationTest extends TestCase { * @param bool $expected */ public function testIsParsedValid($isValidCommon, $subject, $expected) { - /** @var \OC\Notification\INotification|\PHPUnit_Framework_MockObject_MockObject $notification */ + /** @var \OCP\Notification\INotification|\PHPUnit_Framework_MockObject_MockObject $notification */ $notification = $this->getMockBuilder('\OC\Notification\Notification') ->setMethods([ 'isValidCommon', @@ -588,7 +588,7 @@ class NotificationTest extends TestCase { * @param bool $expected */ public function testIsValidCommon($app, $user, $timestamp, $objectType, $objectId, $expected) { - /** @var \OC\Notification\INotification|\PHPUnit_Framework_MockObject_MockObject $notification */ + /** @var \OCP\Notification\INotification|\PHPUnit_Framework_MockObject_MockObject $notification */ $notification = $this->getMockBuilder('\OC\Notification\Notification') ->setMethods([ 'getApp', |