From 38001d824b142ca9c47f2afafce91ab8b76f1a9a Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 8 Sep 2015 08:57:29 +0200 Subject: [PATCH] Move interfaces to private until they are no longer experimental --- apps/files_sharing/api/remote.php | 1 - apps/files_sharing/lib/external/manager.php | 2 +- apps/files_sharing/lib/notifier.php | 4 +- lib/private/notification/action.php | 1 - .../notification/iaction.php | 4 +- lib/{public => private}/notification/iapp.php | 4 +- .../notification/imanager.php | 4 +- .../notification/inotification.php | 4 +- .../notification/inotifier.php | 4 +- lib/private/notification/manager.php | 5 -- lib/private/notification/notification.php | 2 - lib/private/server.php | 2 +- lib/public/iservercontainer.php | 2 +- tests/lib/notification/actiontest.php | 2 +- tests/lib/notification/managertest.php | 88 +++++++++---------- tests/lib/notification/notificationtest.php | 26 +++--- tests/lib/server.php | 2 +- 17 files changed, 74 insertions(+), 83 deletions(-) rename lib/{public => private}/notification/iaction.php (97%) rename lib/{public => private}/notification/iapp.php (96%) rename lib/{public => private}/notification/imanager.php (96%) rename lib/{public => private}/notification/inotification.php (98%) rename lib/{public => private}/notification/inotifier.php (95%) diff --git a/apps/files_sharing/api/remote.php b/apps/files_sharing/api/remote.php index 404787c389..0f6d2dc265 100644 --- a/apps/files_sharing/api/remote.php +++ b/apps/files_sharing/api/remote.php @@ -23,7 +23,6 @@ namespace OCA\Files_Sharing\API; use OC\Files\Filesystem; use OCA\Files_Sharing\External\Manager; -use OCP\Notification\IManager; class Remote { diff --git a/apps/files_sharing/lib/external/manager.php b/apps/files_sharing/lib/external/manager.php index 18b9c724de..17142e9509 100644 --- a/apps/files_sharing/lib/external/manager.php +++ b/apps/files_sharing/lib/external/manager.php @@ -28,7 +28,7 @@ namespace OCA\Files_Sharing\External; use OC\Files\Filesystem; use OCP\Files; -use OCP\Notification\IManager; +use OC\Notification\IManager; class Manager { const STORAGE = '\OCA\Files_Sharing\External\Storage'; diff --git a/apps/files_sharing/lib/notifier.php b/apps/files_sharing/lib/notifier.php index e050d4d3c1..cc2deb3f43 100644 --- a/apps/files_sharing/lib/notifier.php +++ b/apps/files_sharing/lib/notifier.php @@ -22,8 +22,8 @@ namespace OCA\Files_Sharing; -use OCP\Notification\INotification; -use OCP\Notification\INotifier; +use OC\Notification\INotification; +use OC\Notification\INotifier; class Notifier implements INotifier { /** @var \OCP\L10N\IFactory */ diff --git a/lib/private/notification/action.php b/lib/private/notification/action.php index 7f654bf908..6de8a1a4bb 100644 --- a/lib/private/notification/action.php +++ b/lib/private/notification/action.php @@ -21,7 +21,6 @@ namespace OC\Notification; -use OCP\Notification\IAction; class Action implements IAction { diff --git a/lib/public/notification/iaction.php b/lib/private/notification/iaction.php similarity index 97% rename from lib/public/notification/iaction.php rename to lib/private/notification/iaction.php index 8db1eaa654..da6728f5c5 100644 --- a/lib/public/notification/iaction.php +++ b/lib/private/notification/iaction.php @@ -19,12 +19,12 @@ * */ -namespace OCP\Notification; +namespace OC\Notification; /** * Interface IAction * - * @package OCP\Notification + * @package OC\Notification * @since 8.2.0 * * DEVELOPER NOTE: diff --git a/lib/public/notification/iapp.php b/lib/private/notification/iapp.php similarity index 96% rename from lib/public/notification/iapp.php rename to lib/private/notification/iapp.php index a4718a21b6..eda66423f3 100644 --- a/lib/public/notification/iapp.php +++ b/lib/private/notification/iapp.php @@ -19,12 +19,12 @@ * */ -namespace OCP\Notification; +namespace OC\Notification; /** * Interface IApp * - * @package OCP\Notification + * @package OC\Notification * @since 8.2.0 * * DEVELOPER NOTE: diff --git a/lib/public/notification/imanager.php b/lib/private/notification/imanager.php similarity index 96% rename from lib/public/notification/imanager.php rename to lib/private/notification/imanager.php index ca1cc968b1..0cd92b3325 100644 --- a/lib/public/notification/imanager.php +++ b/lib/private/notification/imanager.php @@ -19,12 +19,12 @@ * */ -namespace OCP\Notification; +namespace OC\Notification; /** * Interface IManager * - * @package OCP\Notification + * @package OC\Notification * @since 8.2.0 * * DEVELOPER NOTE: diff --git a/lib/public/notification/inotification.php b/lib/private/notification/inotification.php similarity index 98% rename from lib/public/notification/inotification.php rename to lib/private/notification/inotification.php index 51d4a80464..faf5db1d24 100644 --- a/lib/public/notification/inotification.php +++ b/lib/private/notification/inotification.php @@ -19,12 +19,12 @@ * */ -namespace OCP\Notification; +namespace OC\Notification; /** * Interface INotification * - * @package OCP\Notification + * @package OC\Notification * @since 8.2.0 * * DEVELOPER NOTE: diff --git a/lib/public/notification/inotifier.php b/lib/private/notification/inotifier.php similarity index 95% rename from lib/public/notification/inotifier.php rename to lib/private/notification/inotifier.php index 9eefcddae1..22531229e3 100644 --- a/lib/public/notification/inotifier.php +++ b/lib/private/notification/inotifier.php @@ -19,12 +19,12 @@ * */ -namespace OCP\Notification; +namespace OC\Notification; /** * Interface INotifier * - * @package OCP\Notification + * @package OC\Notification * @since 8.2.0 * * DEVELOPER NOTE: diff --git a/lib/private/notification/manager.php b/lib/private/notification/manager.php index bafb123f76..9635925e38 100644 --- a/lib/private/notification/manager.php +++ b/lib/private/notification/manager.php @@ -22,11 +22,6 @@ namespace OC\Notification; -use OCP\Notification\IApp; -use OCP\Notification\IManager; -use OCP\Notification\INotification; -use OCP\Notification\INotifier; - class Manager implements IManager { /** @var IApp */ protected $apps; diff --git a/lib/private/notification/notification.php b/lib/private/notification/notification.php index 2f53a34728..40fe39a956 100644 --- a/lib/private/notification/notification.php +++ b/lib/private/notification/notification.php @@ -21,8 +21,6 @@ namespace OC\Notification; -use OCP\Notification\IAction; -use OCP\Notification\INotification; class Notification implements INotification { /** @var string */ diff --git a/lib/private/server.php b/lib/private/server.php index 880ab274f1..8e8444c83d 100644 --- a/lib/private/server.php +++ b/lib/private/server.php @@ -1050,7 +1050,7 @@ class Server extends SimpleContainer implements IServerContainer { /** * Get the Notification Manager * - * @return \OCP\Notification\IManager + * @return \OC\Notification\IManager * @since 8.2.0 */ public function getNotificationManager() { diff --git a/lib/public/iservercontainer.php b/lib/public/iservercontainer.php index ea08b5a78c..8be23dff21 100644 --- a/lib/public/iservercontainer.php +++ b/lib/public/iservercontainer.php @@ -459,7 +459,7 @@ interface IServerContainer { /** * Get the Notification Manager * - * @return \OCP\Notification\IManager + * @return \OC\Notification\IManager * @since 8.2.0 */ public function getNotificationManager(); diff --git a/tests/lib/notification/actiontest.php b/tests/lib/notification/actiontest.php index 994e22a2f1..e319c250cc 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 OCP\Notification\IAction; +use OC\Notification\IAction; use Test\TestCase; class ActionTest extends TestCase { diff --git a/tests/lib/notification/managertest.php b/tests/lib/notification/managertest.php index 13ac4b80b8..fa2a0586f9 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 OCP\Notification\IManager; +use OC\Notification\IManager; use Test\TestCase; class ManagerTest extends TestCase { @@ -35,7 +35,7 @@ class ManagerTest extends TestCase { } public function testRegisterApp() { - $app = $this->getMockBuilder('OCP\Notification\IApp') + $app = $this->getMockBuilder('OC\Notification\IApp') ->disableOriginalConstructor() ->getMock(); @@ -59,7 +59,7 @@ class ManagerTest extends TestCase { * @expectedException \InvalidArgumentException */ public function testRegisterAppInvalid() { - $notifier = $this->getMockBuilder('OCP\Notification\INotifier') + $notifier = $this->getMockBuilder('OC\Notification\INotifier') ->disableOriginalConstructor() ->getMock(); @@ -73,7 +73,7 @@ class ManagerTest extends TestCase { } public function testRegisterNotifier() { - $notifier = $this->getMockBuilder('OCP\Notification\INotifier') + $notifier = $this->getMockBuilder('OC\Notification\INotifier') ->disableOriginalConstructor() ->getMock(); @@ -97,7 +97,7 @@ class ManagerTest extends TestCase { * @expectedException \InvalidArgumentException */ public function testRegisterNotifierInvalid() { - $app = $this->getMockBuilder('OCP\Notification\IApp') + $app = $this->getMockBuilder('OC\Notification\IApp') ->disableOriginalConstructor() ->getMock(); @@ -112,28 +112,28 @@ class ManagerTest extends TestCase { public function testCreateNotification() { $action = $this->manager->createNotification(); - $this->assertInstanceOf('OCP\Notification\INotification', $action); + $this->assertInstanceOf('OC\Notification\INotification', $action); } public function testNotify() { - /** @var \OCP\Notification\INotification|\PHPUnit_Framework_MockObject_MockObject $notification */ - $notification = $this->getMockBuilder('OCP\Notification\INotification') + /** @var \OC\Notification\INotification|\PHPUnit_Framework_MockObject_MockObject $notification */ + $notification = $this->getMockBuilder('OC\Notification\INotification') ->disableOriginalConstructor() ->getMock(); $notification->expects($this->once()) ->method('isValid') ->willReturn(true); - /** @var \OCP\Notification\IApp|\PHPUnit_Framework_MockObject_MockObject $app */ - $app = $this->getMockBuilder('OCP\Notification\IApp') + /** @var \OC\Notification\IApp|\PHPUnit_Framework_MockObject_MockObject $app */ + $app = $this->getMockBuilder('OC\Notification\IApp') ->disableOriginalConstructor() ->getMock(); $app->expects($this->once()) ->method('notify') ->with($notification); - /** @var \OCP\Notification\IApp|\PHPUnit_Framework_MockObject_MockObject $app2 */ - $app2 = $this->getMockBuilder('OCP\Notification\IApp') + /** @var \OC\Notification\IApp|\PHPUnit_Framework_MockObject_MockObject $app2 */ + $app2 = $this->getMockBuilder('OC\Notification\IApp') ->disableOriginalConstructor() ->getMock(); $app2->expects($this->once()) @@ -154,8 +154,8 @@ class ManagerTest extends TestCase { * @expectedException \InvalidArgumentException */ public function testNotifyInvalid() { - /** @var \OCP\Notification\INotification|\PHPUnit_Framework_MockObject_MockObject $notification */ - $notification = $this->getMockBuilder('OCP\Notification\INotification') + /** @var \OC\Notification\INotification|\PHPUnit_Framework_MockObject_MockObject $notification */ + $notification = $this->getMockBuilder('OC\Notification\INotification') ->disableOriginalConstructor() ->getMock(); $notification->expects($this->once()) @@ -166,23 +166,23 @@ class ManagerTest extends TestCase { } public function testPrepare() { - /** @var \OCP\Notification\INotification|\PHPUnit_Framework_MockObject_MockObject $notification */ - $notification = $this->getMockBuilder('OCP\Notification\INotification') + /** @var \OC\Notification\INotification|\PHPUnit_Framework_MockObject_MockObject $notification */ + $notification = $this->getMockBuilder('OC\Notification\INotification') ->disableOriginalConstructor() ->getMock(); $notification->expects($this->once()) ->method('isValidParsed') ->willReturn(true); - /** @var \OCP\Notification\INotification|\PHPUnit_Framework_MockObject_MockObject $notification2 */ - $notification2 = $this->getMockBuilder('OCP\Notification\INotification') + /** @var \OC\Notification\INotification|\PHPUnit_Framework_MockObject_MockObject $notification2 */ + $notification2 = $this->getMockBuilder('OC\Notification\INotification') ->disableOriginalConstructor() ->getMock(); $notification2->expects($this->exactly(2)) ->method('isValidParsed') ->willReturn(true); - /** @var \OCP\Notification\IApp|\PHPUnit_Framework_MockObject_MockObject $notifier */ - $notifier = $this->getMockBuilder('OCP\Notification\INotifier') + /** @var \OC\Notification\IApp|\PHPUnit_Framework_MockObject_MockObject $notifier */ + $notifier = $this->getMockBuilder('OC\Notification\INotifier') ->disableOriginalConstructor() ->getMock(); $notifier->expects($this->once()) @@ -190,8 +190,8 @@ class ManagerTest extends TestCase { ->with($notification, 'en') ->willReturnArgument(0); - /** @var \OCP\Notification\IApp|\PHPUnit_Framework_MockObject_MockObject $notifier2 */ - $notifier2 = $this->getMockBuilder('OCP\Notification\INotifier') + /** @var \OC\Notification\IApp|\PHPUnit_Framework_MockObject_MockObject $notifier2 */ + $notifier2 = $this->getMockBuilder('OC\Notification\INotifier') ->disableOriginalConstructor() ->getMock(); $notifier2->expects($this->once()) @@ -213,16 +213,16 @@ class ManagerTest extends TestCase { * @expectedException \InvalidArgumentException */ public function testPrepareInvalid() { - /** @var \OCP\Notification\INotification|\PHPUnit_Framework_MockObject_MockObject $notification */ - $notification = $this->getMockBuilder('OCP\Notification\INotification') + /** @var \OC\Notification\INotification|\PHPUnit_Framework_MockObject_MockObject $notification */ + $notification = $this->getMockBuilder('OC\Notification\INotification') ->disableOriginalConstructor() ->getMock(); $notification->expects($this->once()) ->method('isValidParsed') ->willReturn(false); - /** @var \OCP\Notification\IApp|\PHPUnit_Framework_MockObject_MockObject $notifier */ - $notifier = $this->getMockBuilder('OCP\Notification\INotifier') + /** @var \OC\Notification\IApp|\PHPUnit_Framework_MockObject_MockObject $notifier */ + $notifier = $this->getMockBuilder('OC\Notification\INotifier') ->disableOriginalConstructor() ->getMock(); $notifier->expects($this->once()) @@ -238,16 +238,16 @@ class ManagerTest extends TestCase { } public function testPrepareNotifierThrows() { - /** @var \OCP\Notification\INotification|\PHPUnit_Framework_MockObject_MockObject $notification */ - $notification = $this->getMockBuilder('OCP\Notification\INotification') + /** @var \OC\Notification\INotification|\PHPUnit_Framework_MockObject_MockObject $notification */ + $notification = $this->getMockBuilder('OC\Notification\INotification') ->disableOriginalConstructor() ->getMock(); $notification->expects($this->once()) ->method('isValidParsed') ->willReturn(true); - /** @var \OCP\Notification\IApp|\PHPUnit_Framework_MockObject_MockObject $notifier */ - $notifier = $this->getMockBuilder('OCP\Notification\INotifier') + /** @var \OC\Notification\IApp|\PHPUnit_Framework_MockObject_MockObject $notifier */ + $notifier = $this->getMockBuilder('OC\Notification\INotifier') ->disableOriginalConstructor() ->getMock(); $notifier->expects($this->once()) @@ -266,8 +266,8 @@ class ManagerTest extends TestCase { * @expectedException \InvalidArgumentException */ public function testPrepareNoNotifier() { - /** @var \OCP\Notification\INotification|\PHPUnit_Framework_MockObject_MockObject $notification */ - $notification = $this->getMockBuilder('OCP\Notification\INotification') + /** @var \OC\Notification\INotification|\PHPUnit_Framework_MockObject_MockObject $notification */ + $notification = $this->getMockBuilder('OC\Notification\INotification') ->disableOriginalConstructor() ->getMock(); $notification->expects($this->once()) @@ -278,21 +278,21 @@ class ManagerTest extends TestCase { } public function testMarkProcessed() { - /** @var \OCP\Notification\INotification|\PHPUnit_Framework_MockObject_MockObject $notification */ - $notification = $this->getMockBuilder('OCP\Notification\INotification') + /** @var \OC\Notification\INotification|\PHPUnit_Framework_MockObject_MockObject $notification */ + $notification = $this->getMockBuilder('OC\Notification\INotification') ->disableOriginalConstructor() ->getMock(); - /** @var \OCP\Notification\IApp|\PHPUnit_Framework_MockObject_MockObject $app */ - $app = $this->getMockBuilder('OCP\Notification\IApp') + /** @var \OC\Notification\IApp|\PHPUnit_Framework_MockObject_MockObject $app */ + $app = $this->getMockBuilder('OC\Notification\IApp') ->disableOriginalConstructor() ->getMock(); $app->expects($this->once()) ->method('markProcessed') ->with($notification); - /** @var \OCP\Notification\IApp|\PHPUnit_Framework_MockObject_MockObject $app2 */ - $app2 = $this->getMockBuilder('OCP\Notification\IApp') + /** @var \OC\Notification\IApp|\PHPUnit_Framework_MockObject_MockObject $app2 */ + $app2 = $this->getMockBuilder('OC\Notification\IApp') ->disableOriginalConstructor() ->getMock(); $app2->expects($this->once()) @@ -310,13 +310,13 @@ class ManagerTest extends TestCase { } public function testGetCount() { - /** @var \OCP\Notification\INotification|\PHPUnit_Framework_MockObject_MockObject $notification */ - $notification = $this->getMockBuilder('OCP\Notification\INotification') + /** @var \OC\Notification\INotification|\PHPUnit_Framework_MockObject_MockObject $notification */ + $notification = $this->getMockBuilder('OC\Notification\INotification') ->disableOriginalConstructor() ->getMock(); - /** @var \OCP\Notification\IApp|\PHPUnit_Framework_MockObject_MockObject $app */ - $app = $this->getMockBuilder('OCP\Notification\IApp') + /** @var \OC\Notification\IApp|\PHPUnit_Framework_MockObject_MockObject $app */ + $app = $this->getMockBuilder('OC\Notification\IApp') ->disableOriginalConstructor() ->getMock(); $app->expects($this->once()) @@ -324,8 +324,8 @@ class ManagerTest extends TestCase { ->with($notification) ->willReturn(21); - /** @var \OCP\Notification\IApp|\PHPUnit_Framework_MockObject_MockObject $app2 */ - $app2 = $this->getMockBuilder('OCP\Notification\IApp') + /** @var \OC\Notification\IApp|\PHPUnit_Framework_MockObject_MockObject $app2 */ + $app2 = $this->getMockBuilder('OC\Notification\IApp') ->disableOriginalConstructor() ->getMock(); $app2->expects($this->once()) diff --git a/tests/lib/notification/notificationtest.php b/tests/lib/notification/notificationtest.php index 5865d2dbee..a790a53eaa 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 OCP\Notification\INotification; +use OC\Notification\INotification; use Test\TestCase; class NotificationTest extends TestCase { @@ -401,12 +401,12 @@ class NotificationTest extends TestCase { public function testCreateAction() { $action = $this->notification->createAction(); - $this->assertInstanceOf('OCP\Notification\IAction', $action); + $this->assertInstanceOf('OC\Notification\IAction', $action); } public function testAddAction() { - /** @var \OCP\Notification\IAction|\PHPUnit_Framework_MockObject_MockObject $action */ - $action = $this->getMockBuilder('OCP\Notification\IAction') + /** @var \OC\Notification\IAction|\PHPUnit_Framework_MockObject_MockObject $action */ + $action = $this->getMockBuilder('OC\Notification\IAction') ->disableOriginalConstructor() ->getMock(); $action->expects($this->once()) @@ -425,8 +425,8 @@ class NotificationTest extends TestCase { * @expectedException \InvalidArgumentException */ public function testAddActionInvalid() { - /** @var \OCP\Notification\IAction|\PHPUnit_Framework_MockObject_MockObject $action */ - $action = $this->getMockBuilder('OCP\Notification\IAction') + /** @var \OC\Notification\IAction|\PHPUnit_Framework_MockObject_MockObject $action */ + $action = $this->getMockBuilder('OC\Notification\IAction') ->disableOriginalConstructor() ->getMock(); $action->expects($this->once()) @@ -439,8 +439,8 @@ class NotificationTest extends TestCase { } public function testAddParsedAction() { - /** @var \OCP\Notification\IAction|\PHPUnit_Framework_MockObject_MockObject $action */ - $action = $this->getMockBuilder('OCP\Notification\IAction') + /** @var \OC\Notification\IAction|\PHPUnit_Framework_MockObject_MockObject $action */ + $action = $this->getMockBuilder('OC\Notification\IAction') ->disableOriginalConstructor() ->getMock(); $action->expects($this->once()) @@ -459,8 +459,8 @@ class NotificationTest extends TestCase { * @expectedException \InvalidArgumentException */ public function testAddParsedActionInvalid() { - /** @var \OCP\Notification\IAction|\PHPUnit_Framework_MockObject_MockObject $action */ - $action = $this->getMockBuilder('OCP\Notification\IAction') + /** @var \OC\Notification\IAction|\PHPUnit_Framework_MockObject_MockObject $action */ + $action = $this->getMockBuilder('OC\Notification\IAction') ->disableOriginalConstructor() ->getMock(); $action->expects($this->once()) @@ -489,7 +489,7 @@ class NotificationTest extends TestCase { * @param bool $expected */ public function testIsValid($isValidCommon, $subject, $expected) { - /** @var \OCP\Notification\INotification|\PHPUnit_Framework_MockObject_MockObject $notification */ + /** @var \OC\Notification\INotification|\PHPUnit_Framework_MockObject_MockObject $notification */ $notification = $this->getMockBuilder('\OC\Notification\Notification') ->setMethods([ 'isValidCommon', @@ -520,7 +520,7 @@ class NotificationTest extends TestCase { * @param bool $expected */ public function testIsParsedValid($isValidCommon, $subject, $expected) { - /** @var \OCP\Notification\INotification|\PHPUnit_Framework_MockObject_MockObject $notification */ + /** @var \OC\Notification\INotification|\PHPUnit_Framework_MockObject_MockObject $notification */ $notification = $this->getMockBuilder('\OC\Notification\Notification') ->setMethods([ 'isValidCommon', @@ -565,7 +565,7 @@ class NotificationTest extends TestCase { * @param bool $expected */ public function testIsValidCommon($app, $user, $timestamp, $objectType, $objectId, $expected) { - /** @var \OCP\Notification\INotification|\PHPUnit_Framework_MockObject_MockObject $notification */ + /** @var \OC\Notification\INotification|\PHPUnit_Framework_MockObject_MockObject $notification */ $notification = $this->getMockBuilder('\OC\Notification\Notification') ->setMethods([ 'getApp', diff --git a/tests/lib/server.php b/tests/lib/server.php index 78d6a0c830..96a476bd4d 100644 --- a/tests/lib/server.php +++ b/tests/lib/server.php @@ -105,7 +105,7 @@ class Server extends \Test\TestCase { ['NavigationManager', '\OC\NavigationManager'], ['NavigationManager', '\OCP\INavigationManager'], ['NotificationManager', '\OC\Notification\Manager'], - ['NotificationManager', '\OCP\Notification\IManager'], + ['NotificationManager', '\OC\Notification\IManager'], ['UserCache', '\OC\Cache\File'], ['UserCache', '\OCP\ICache'],