Move the notification API to public namespace

This commit is contained in:
Joas Schilling 2016-01-14 14:35:24 +01:00
parent e2e5eedb40
commit ee02165005
16 changed files with 90 additions and 100 deletions

View File

@ -28,7 +28,7 @@ namespace OCA\Files_Sharing\External;
use OC\Files\Filesystem; use OC\Files\Filesystem;
use OCP\Files; use OCP\Files;
use OC\Notification\IManager; use OCP\Notification\IManager;
class Manager { class Manager {
const STORAGE = '\OCA\Files_Sharing\External\Storage'; const STORAGE = '\OCA\Files_Sharing\External\Storage';

View File

@ -22,8 +22,8 @@
namespace OCA\Files_Sharing; namespace OCA\Files_Sharing;
use OC\Notification\INotification; use OCP\Notification\INotification;
use OC\Notification\INotifier; use OCP\Notification\INotifier;
class Notifier implements INotifier { class Notifier implements INotifier {
/** @var \OCP\L10N\IFactory */ /** @var \OCP\L10N\IFactory */

View File

@ -22,6 +22,8 @@
namespace OC\Notification; namespace OC\Notification;
use OCP\Notification\IAction;
class Action implements IAction { class Action implements IAction {
/** @var string */ /** @var string */

View File

@ -22,6 +22,11 @@
namespace OC\Notification; namespace OC\Notification;
use OCP\Notification\IApp;
use OCP\Notification\IManager;
use OCP\Notification\INotification;
use OCP\Notification\INotifier;
class Manager implements IManager { class Manager implements IManager {
/** @var IApp */ /** @var IApp */
protected $apps; protected $apps;

View File

@ -22,6 +22,9 @@
namespace OC\Notification; namespace OC\Notification;
use OCP\Notification\IAction;
use OCP\Notification\INotification;
class Notification implements INotification { class Notification implements INotification {
/** @var string */ /** @var string */
protected $app; protected $app;

View File

@ -1152,7 +1152,7 @@ class Server extends ServerContainer implements IServerContainer {
/** /**
* Get the Notification Manager * Get the Notification Manager
* *
* @return \OC\Notification\IManager * @return \OCP\Notification\IManager
* @since 8.2.0 * @since 8.2.0
*/ */
public function getNotificationManager() { public function getNotificationManager() {

View File

@ -468,7 +468,7 @@ interface IServerContainer {
/** /**
* Get the Notification Manager * Get the Notification Manager
* *
* @return \OC\Notification\IManager * @return \OCP\Notification\IManager
* @since 8.2.0 * @since 8.2.0
*/ */
public function getNotificationManager(); public function getNotificationManager();

View File

@ -19,17 +19,13 @@
* *
*/ */
namespace OC\Notification; namespace OCP\Notification;
/** /**
* Interface IAction * Interface IAction
* *
* @package OC\Notification * @package OCP\Notification
* @since 8.2.0 * @since 8.2.0
*
* DEVELOPER NOTE:
* The notification api is experimental only in 8.2.0! Do not start using it,
* if you can not prepare an update for the next version afterwards.
*/ */
interface IAction { interface IAction {
/** /**

View File

@ -19,17 +19,13 @@
* *
*/ */
namespace OC\Notification; namespace OCP\Notification;
/** /**
* Interface IApp * Interface IApp
* *
* @package OC\Notification * @package OCP\Notification
* @since 8.2.0 * @since 8.2.0
*
* DEVELOPER NOTE:
* The notification api is experimental only in 8.2.0! Do not start using it,
* if you can not prepare an update for the next version afterwards.
*/ */
interface IApp { interface IApp {
/** /**

View File

@ -19,17 +19,13 @@
* *
*/ */
namespace OC\Notification; namespace OCP\Notification;
/** /**
* Interface IManager * Interface IManager
* *
* @package OC\Notification * @package OCP\Notification
* @since 8.2.0 * @since 8.2.0
*
* DEVELOPER NOTE:
* The notification api is experimental only in 8.2.0! Do not start using it,
* if you can not prepare an update for the next version afterwards.
*/ */
interface IManager extends IApp, INotifier { interface IManager extends IApp, INotifier {
/** /**

View File

@ -19,17 +19,13 @@
* *
*/ */
namespace OC\Notification; namespace OCP\Notification;
/** /**
* Interface INotification * Interface INotification
* *
* @package OC\Notification * @package OCP\Notification
* @since 8.2.0 * @since 8.2.0
*
* DEVELOPER NOTE:
* The notification api is experimental only in 8.2.0! Do not start using it,
* if you can not prepare an update for the next version afterwards.
*/ */
interface INotification { interface INotification {
/** /**

View File

@ -19,17 +19,13 @@
* *
*/ */
namespace OC\Notification; namespace OCP\Notification;
/** /**
* Interface INotifier * Interface INotifier
* *
* @package OC\Notification * @package OCP\Notification
* @since 8.2.0 * @since 8.2.0
*
* DEVELOPER NOTE:
* The notification api is experimental only in 8.2.0! Do not start using it,
* if you can not prepare an update for the next version afterwards.
*/ */
interface INotifier { interface INotifier {
/** /**

View File

@ -23,7 +23,7 @@ namespace Test\Notification;
use OC\Notification\Action; use OC\Notification\Action;
use OC\Notification\IAction; use OCP\Notification\IAction;
use Test\TestCase; use Test\TestCase;
class ActionTest extends TestCase { class ActionTest extends TestCase {

View File

@ -22,7 +22,7 @@
namespace Test\Notification; namespace Test\Notification;
use OC\Notification\Manager; use OC\Notification\Manager;
use OC\Notification\IManager; use OCP\Notification\IManager;
use Test\TestCase; use Test\TestCase;
class ManagerTest extends TestCase { class ManagerTest extends TestCase {
@ -35,7 +35,7 @@ class ManagerTest extends TestCase {
} }
public function testRegisterApp() { public function testRegisterApp() {
$app = $this->getMockBuilder('OC\Notification\IApp') $app = $this->getMockBuilder('OCP\Notification\IApp')
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
@ -59,7 +59,7 @@ class ManagerTest extends TestCase {
* @expectedException \InvalidArgumentException * @expectedException \InvalidArgumentException
*/ */
public function testRegisterAppInvalid() { public function testRegisterAppInvalid() {
$notifier = $this->getMockBuilder('OC\Notification\INotifier') $notifier = $this->getMockBuilder('OCP\Notification\INotifier')
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
@ -73,7 +73,7 @@ class ManagerTest extends TestCase {
} }
public function testRegisterNotifier() { public function testRegisterNotifier() {
$notifier = $this->getMockBuilder('OC\Notification\INotifier') $notifier = $this->getMockBuilder('OCP\Notification\INotifier')
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
@ -105,7 +105,7 @@ class ManagerTest extends TestCase {
* @expectedException \InvalidArgumentException * @expectedException \InvalidArgumentException
*/ */
public function testRegisterNotifierInvalid() { public function testRegisterNotifierInvalid() {
$app = $this->getMockBuilder('OC\Notification\IApp') $app = $this->getMockBuilder('OCP\Notification\IApp')
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
@ -136,7 +136,7 @@ class ManagerTest extends TestCase {
* @param mixed $data * @param mixed $data
*/ */
public function testRegisterNotifierInfoInvalid($data) { public function testRegisterNotifierInfoInvalid($data) {
$app = $this->getMockBuilder('OC\Notification\IApp') $app = $this->getMockBuilder('OCP\Notification\IApp')
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
@ -156,7 +156,7 @@ class ManagerTest extends TestCase {
* @expectedExceptionMessage The given notifier ID test1 is already in use * @expectedExceptionMessage The given notifier ID test1 is already in use
*/ */
public function testRegisterNotifierInfoDuplicate() { public function testRegisterNotifierInfoDuplicate() {
$app = $this->getMockBuilder('OC\Notification\IApp') $app = $this->getMockBuilder('OCP\Notification\IApp')
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
@ -177,28 +177,28 @@ class ManagerTest extends TestCase {
public function testCreateNotification() { public function testCreateNotification() {
$action = $this->manager->createNotification(); $action = $this->manager->createNotification();
$this->assertInstanceOf('OC\Notification\INotification', $action); $this->assertInstanceOf('OCP\Notification\INotification', $action);
} }
public function testNotify() { public function testNotify() {
/** @var \OC\Notification\INotification|\PHPUnit_Framework_MockObject_MockObject $notification */ /** @var \OCP\Notification\INotification|\PHPUnit_Framework_MockObject_MockObject $notification */
$notification = $this->getMockBuilder('OC\Notification\INotification') $notification = $this->getMockBuilder('OCP\Notification\INotification')
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
$notification->expects($this->once()) $notification->expects($this->once())
->method('isValid') ->method('isValid')
->willReturn(true); ->willReturn(true);
/** @var \OC\Notification\IApp|\PHPUnit_Framework_MockObject_MockObject $app */ /** @var \OCP\Notification\IApp|\PHPUnit_Framework_MockObject_MockObject $app */
$app = $this->getMockBuilder('OC\Notification\IApp') $app = $this->getMockBuilder('OCP\Notification\IApp')
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
$app->expects($this->once()) $app->expects($this->once())
->method('notify') ->method('notify')
->with($notification); ->with($notification);
/** @var \OC\Notification\IApp|\PHPUnit_Framework_MockObject_MockObject $app2 */ /** @var \OCP\Notification\IApp|\PHPUnit_Framework_MockObject_MockObject $app2 */
$app2 = $this->getMockBuilder('OC\Notification\IApp') $app2 = $this->getMockBuilder('OCP\Notification\IApp')
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
$app2->expects($this->once()) $app2->expects($this->once())
@ -219,8 +219,8 @@ class ManagerTest extends TestCase {
* @expectedException \InvalidArgumentException * @expectedException \InvalidArgumentException
*/ */
public function testNotifyInvalid() { public function testNotifyInvalid() {
/** @var \OC\Notification\INotification|\PHPUnit_Framework_MockObject_MockObject $notification */ /** @var \OCP\Notification\INotification|\PHPUnit_Framework_MockObject_MockObject $notification */
$notification = $this->getMockBuilder('OC\Notification\INotification') $notification = $this->getMockBuilder('OCP\Notification\INotification')
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
$notification->expects($this->once()) $notification->expects($this->once())
@ -231,23 +231,23 @@ class ManagerTest extends TestCase {
} }
public function testPrepare() { public function testPrepare() {
/** @var \OC\Notification\INotification|\PHPUnit_Framework_MockObject_MockObject $notification */ /** @var \OCP\Notification\INotification|\PHPUnit_Framework_MockObject_MockObject $notification */
$notification = $this->getMockBuilder('OC\Notification\INotification') $notification = $this->getMockBuilder('OCP\Notification\INotification')
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
$notification->expects($this->once()) $notification->expects($this->once())
->method('isValidParsed') ->method('isValidParsed')
->willReturn(true); ->willReturn(true);
/** @var \OC\Notification\INotification|\PHPUnit_Framework_MockObject_MockObject $notification2 */ /** @var \OCP\Notification\INotification|\PHPUnit_Framework_MockObject_MockObject $notification2 */
$notification2 = $this->getMockBuilder('OC\Notification\INotification') $notification2 = $this->getMockBuilder('OCP\Notification\INotification')
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
$notification2->expects($this->exactly(2)) $notification2->expects($this->exactly(2))
->method('isValidParsed') ->method('isValidParsed')
->willReturn(true); ->willReturn(true);
/** @var \OC\Notification\IApp|\PHPUnit_Framework_MockObject_MockObject $notifier */ /** @var \OCP\Notification\IApp|\PHPUnit_Framework_MockObject_MockObject $notifier */
$notifier = $this->getMockBuilder('OC\Notification\INotifier') $notifier = $this->getMockBuilder('OCP\Notification\INotifier')
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
$notifier->expects($this->once()) $notifier->expects($this->once())
@ -255,8 +255,8 @@ class ManagerTest extends TestCase {
->with($notification, 'en') ->with($notification, 'en')
->willReturnArgument(0); ->willReturnArgument(0);
/** @var \OC\Notification\IApp|\PHPUnit_Framework_MockObject_MockObject $notifier2 */ /** @var \OCP\Notification\IApp|\PHPUnit_Framework_MockObject_MockObject $notifier2 */
$notifier2 = $this->getMockBuilder('OC\Notification\INotifier') $notifier2 = $this->getMockBuilder('OCP\Notification\INotifier')
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
$notifier2->expects($this->once()) $notifier2->expects($this->once())
@ -282,16 +282,16 @@ class ManagerTest extends TestCase {
* @expectedException \InvalidArgumentException * @expectedException \InvalidArgumentException
*/ */
public function testPrepareInvalid() { public function testPrepareInvalid() {
/** @var \OC\Notification\INotification|\PHPUnit_Framework_MockObject_MockObject $notification */ /** @var \OCP\Notification\INotification|\PHPUnit_Framework_MockObject_MockObject $notification */
$notification = $this->getMockBuilder('OC\Notification\INotification') $notification = $this->getMockBuilder('OCP\Notification\INotification')
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
$notification->expects($this->once()) $notification->expects($this->once())
->method('isValidParsed') ->method('isValidParsed')
->willReturn(false); ->willReturn(false);
/** @var \OC\Notification\IApp|\PHPUnit_Framework_MockObject_MockObject $notifier */ /** @var \OCP\Notification\IApp|\PHPUnit_Framework_MockObject_MockObject $notifier */
$notifier = $this->getMockBuilder('OC\Notification\INotifier') $notifier = $this->getMockBuilder('OCP\Notification\INotifier')
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
$notifier->expects($this->once()) $notifier->expects($this->once())
@ -309,16 +309,16 @@ class ManagerTest extends TestCase {
} }
public function testPrepareNotifierThrows() { public function testPrepareNotifierThrows() {
/** @var \OC\Notification\INotification|\PHPUnit_Framework_MockObject_MockObject $notification */ /** @var \OCP\Notification\INotification|\PHPUnit_Framework_MockObject_MockObject $notification */
$notification = $this->getMockBuilder('OC\Notification\INotification') $notification = $this->getMockBuilder('OCP\Notification\INotification')
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
$notification->expects($this->once()) $notification->expects($this->once())
->method('isValidParsed') ->method('isValidParsed')
->willReturn(true); ->willReturn(true);
/** @var \OC\Notification\IApp|\PHPUnit_Framework_MockObject_MockObject $notifier */ /** @var \OCP\Notification\IApp|\PHPUnit_Framework_MockObject_MockObject $notifier */
$notifier = $this->getMockBuilder('OC\Notification\INotifier') $notifier = $this->getMockBuilder('OCP\Notification\INotifier')
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
$notifier->expects($this->once()) $notifier->expects($this->once())
@ -339,8 +339,8 @@ class ManagerTest extends TestCase {
* @expectedException \InvalidArgumentException * @expectedException \InvalidArgumentException
*/ */
public function testPrepareNoNotifier() { public function testPrepareNoNotifier() {
/** @var \OC\Notification\INotification|\PHPUnit_Framework_MockObject_MockObject $notification */ /** @var \OCP\Notification\INotification|\PHPUnit_Framework_MockObject_MockObject $notification */
$notification = $this->getMockBuilder('OC\Notification\INotification') $notification = $this->getMockBuilder('OCP\Notification\INotification')
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
$notification->expects($this->once()) $notification->expects($this->once())
@ -351,21 +351,21 @@ class ManagerTest extends TestCase {
} }
public function testMarkProcessed() { public function testMarkProcessed() {
/** @var \OC\Notification\INotification|\PHPUnit_Framework_MockObject_MockObject $notification */ /** @var \OCP\Notification\INotification|\PHPUnit_Framework_MockObject_MockObject $notification */
$notification = $this->getMockBuilder('OC\Notification\INotification') $notification = $this->getMockBuilder('OCP\Notification\INotification')
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
/** @var \OC\Notification\IApp|\PHPUnit_Framework_MockObject_MockObject $app */ /** @var \OCP\Notification\IApp|\PHPUnit_Framework_MockObject_MockObject $app */
$app = $this->getMockBuilder('OC\Notification\IApp') $app = $this->getMockBuilder('OCP\Notification\IApp')
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
$app->expects($this->once()) $app->expects($this->once())
->method('markProcessed') ->method('markProcessed')
->with($notification); ->with($notification);
/** @var \OC\Notification\IApp|\PHPUnit_Framework_MockObject_MockObject $app2 */ /** @var \OCP\Notification\IApp|\PHPUnit_Framework_MockObject_MockObject $app2 */
$app2 = $this->getMockBuilder('OC\Notification\IApp') $app2 = $this->getMockBuilder('OCP\Notification\IApp')
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
$app2->expects($this->once()) $app2->expects($this->once())
@ -383,13 +383,13 @@ class ManagerTest extends TestCase {
} }
public function testGetCount() { public function testGetCount() {
/** @var \OC\Notification\INotification|\PHPUnit_Framework_MockObject_MockObject $notification */ /** @var \OCP\Notification\INotification|\PHPUnit_Framework_MockObject_MockObject $notification */
$notification = $this->getMockBuilder('OC\Notification\INotification') $notification = $this->getMockBuilder('OCP\Notification\INotification')
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
/** @var \OC\Notification\IApp|\PHPUnit_Framework_MockObject_MockObject $app */ /** @var \OCP\Notification\IApp|\PHPUnit_Framework_MockObject_MockObject $app */
$app = $this->getMockBuilder('OC\Notification\IApp') $app = $this->getMockBuilder('OCP\Notification\IApp')
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
$app->expects($this->once()) $app->expects($this->once())
@ -397,8 +397,8 @@ class ManagerTest extends TestCase {
->with($notification) ->with($notification)
->willReturn(21); ->willReturn(21);
/** @var \OC\Notification\IApp|\PHPUnit_Framework_MockObject_MockObject $app2 */ /** @var \OCP\Notification\IApp|\PHPUnit_Framework_MockObject_MockObject $app2 */
$app2 = $this->getMockBuilder('OC\Notification\IApp') $app2 = $this->getMockBuilder('OCP\Notification\IApp')
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
$app2->expects($this->once()) $app2->expects($this->once())

View File

@ -23,7 +23,7 @@ namespace Test\Notification;
use OC\Notification\Notification; use OC\Notification\Notification;
use OC\Notification\INotification; use OCP\Notification\INotification;
use Test\TestCase; use Test\TestCase;
class NotificationTest extends TestCase { class NotificationTest extends TestCase {
@ -388,12 +388,12 @@ class NotificationTest extends TestCase {
public function testCreateAction() { public function testCreateAction() {
$action = $this->notification->createAction(); $action = $this->notification->createAction();
$this->assertInstanceOf('OC\Notification\IAction', $action); $this->assertInstanceOf('OCP\Notification\IAction', $action);
} }
public function testAddAction() { public function testAddAction() {
/** @var \OC\Notification\IAction|\PHPUnit_Framework_MockObject_MockObject $action */ /** @var \OCP\Notification\IAction|\PHPUnit_Framework_MockObject_MockObject $action */
$action = $this->getMockBuilder('OC\Notification\IAction') $action = $this->getMockBuilder('OCP\Notification\IAction')
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
$action->expects($this->once()) $action->expects($this->once())
@ -412,8 +412,8 @@ class NotificationTest extends TestCase {
* @expectedException \InvalidArgumentException * @expectedException \InvalidArgumentException
*/ */
public function testAddActionInvalid() { public function testAddActionInvalid() {
/** @var \OC\Notification\IAction|\PHPUnit_Framework_MockObject_MockObject $action */ /** @var \OCP\Notification\IAction|\PHPUnit_Framework_MockObject_MockObject $action */
$action = $this->getMockBuilder('OC\Notification\IAction') $action = $this->getMockBuilder('OCP\Notification\IAction')
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
$action->expects($this->once()) $action->expects($this->once())
@ -426,8 +426,8 @@ class NotificationTest extends TestCase {
} }
public function testAddActionSecondPrimary() { public function testAddActionSecondPrimary() {
/** @var \OC\Notification\IAction|\PHPUnit_Framework_MockObject_MockObject $action */ /** @var \OCP\Notification\IAction|\PHPUnit_Framework_MockObject_MockObject $action */
$action = $this->getMockBuilder('OC\Notification\IAction') $action = $this->getMockBuilder('OCP\Notification\IAction')
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
$action->expects($this->exactly(2)) $action->expects($this->exactly(2))
@ -444,8 +444,8 @@ class NotificationTest extends TestCase {
} }
public function testAddParsedAction() { public function testAddParsedAction() {
/** @var \OC\Notification\IAction|\PHPUnit_Framework_MockObject_MockObject $action */ /** @var \OCP\Notification\IAction|\PHPUnit_Framework_MockObject_MockObject $action */
$action = $this->getMockBuilder('OC\Notification\IAction') $action = $this->getMockBuilder('OCP\Notification\IAction')
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
$action->expects($this->once()) $action->expects($this->once())
@ -464,8 +464,8 @@ class NotificationTest extends TestCase {
* @expectedException \InvalidArgumentException * @expectedException \InvalidArgumentException
*/ */
public function testAddParsedActionInvalid() { public function testAddParsedActionInvalid() {
/** @var \OC\Notification\IAction|\PHPUnit_Framework_MockObject_MockObject $action */ /** @var \OCP\Notification\IAction|\PHPUnit_Framework_MockObject_MockObject $action */
$action = $this->getMockBuilder('OC\Notification\IAction') $action = $this->getMockBuilder('OCP\Notification\IAction')
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
$action->expects($this->once()) $action->expects($this->once())
@ -478,8 +478,8 @@ class NotificationTest extends TestCase {
} }
public function testAddActionSecondParsedPrimary() { public function testAddActionSecondParsedPrimary() {
/** @var \OC\Notification\IAction|\PHPUnit_Framework_MockObject_MockObject $action */ /** @var \OCP\Notification\IAction|\PHPUnit_Framework_MockObject_MockObject $action */
$action = $this->getMockBuilder('OC\Notification\IAction') $action = $this->getMockBuilder('OCP\Notification\IAction')
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
$action->expects($this->exactly(2)) $action->expects($this->exactly(2))
@ -512,7 +512,7 @@ class NotificationTest extends TestCase {
* @param bool $expected * @param bool $expected
*/ */
public function testIsValid($isValidCommon, $subject, $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') $notification = $this->getMockBuilder('\OC\Notification\Notification')
->setMethods([ ->setMethods([
'isValidCommon', 'isValidCommon',
@ -543,7 +543,7 @@ class NotificationTest extends TestCase {
* @param bool $expected * @param bool $expected
*/ */
public function testIsParsedValid($isValidCommon, $subject, $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') $notification = $this->getMockBuilder('\OC\Notification\Notification')
->setMethods([ ->setMethods([
'isValidCommon', 'isValidCommon',
@ -588,7 +588,7 @@ class NotificationTest extends TestCase {
* @param bool $expected * @param bool $expected
*/ */
public function testIsValidCommon($app, $user, $timestamp, $objectType, $objectId, $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') $notification = $this->getMockBuilder('\OC\Notification\Notification')
->setMethods([ ->setMethods([
'getApp', 'getApp',

View File

@ -116,7 +116,7 @@ class Server extends \Test\TestCase {
['NavigationManager', '\OC\NavigationManager'], ['NavigationManager', '\OC\NavigationManager'],
['NavigationManager', '\OCP\INavigationManager'], ['NavigationManager', '\OCP\INavigationManager'],
['NotificationManager', '\OC\Notification\Manager'], ['NotificationManager', '\OC\Notification\Manager'],
['NotificationManager', '\OC\Notification\IManager'], ['NotificationManager', '\OCP\Notification\IManager'],
['UserCache', '\OC\Cache\File'], ['UserCache', '\OC\Cache\File'],
['UserCache', '\OCP\ICache'], ['UserCache', '\OCP\ICache'],