Move interfaces to private until they are no longer experimental
This commit is contained in:
parent
59f37a8dfb
commit
38001d824b
|
@ -23,7 +23,6 @@ namespace OCA\Files_Sharing\API;
|
||||||
|
|
||||||
use OC\Files\Filesystem;
|
use OC\Files\Filesystem;
|
||||||
use OCA\Files_Sharing\External\Manager;
|
use OCA\Files_Sharing\External\Manager;
|
||||||
use OCP\Notification\IManager;
|
|
||||||
|
|
||||||
class Remote {
|
class Remote {
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@ namespace OCA\Files_Sharing\External;
|
||||||
|
|
||||||
use OC\Files\Filesystem;
|
use OC\Files\Filesystem;
|
||||||
use OCP\Files;
|
use OCP\Files;
|
||||||
use OCP\Notification\IManager;
|
use OC\Notification\IManager;
|
||||||
|
|
||||||
class Manager {
|
class Manager {
|
||||||
const STORAGE = '\OCA\Files_Sharing\External\Storage';
|
const STORAGE = '\OCA\Files_Sharing\External\Storage';
|
||||||
|
|
|
@ -22,8 +22,8 @@
|
||||||
namespace OCA\Files_Sharing;
|
namespace OCA\Files_Sharing;
|
||||||
|
|
||||||
|
|
||||||
use OCP\Notification\INotification;
|
use OC\Notification\INotification;
|
||||||
use OCP\Notification\INotifier;
|
use OC\Notification\INotifier;
|
||||||
|
|
||||||
class Notifier implements INotifier {
|
class Notifier implements INotifier {
|
||||||
/** @var \OCP\L10N\IFactory */
|
/** @var \OCP\L10N\IFactory */
|
||||||
|
|
|
@ -21,7 +21,6 @@
|
||||||
|
|
||||||
namespace OC\Notification;
|
namespace OC\Notification;
|
||||||
|
|
||||||
use OCP\Notification\IAction;
|
|
||||||
|
|
||||||
class Action implements IAction {
|
class Action implements IAction {
|
||||||
|
|
||||||
|
|
|
@ -19,12 +19,12 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace OCP\Notification;
|
namespace OC\Notification;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interface IAction
|
* Interface IAction
|
||||||
*
|
*
|
||||||
* @package OCP\Notification
|
* @package OC\Notification
|
||||||
* @since 8.2.0
|
* @since 8.2.0
|
||||||
*
|
*
|
||||||
* DEVELOPER NOTE:
|
* DEVELOPER NOTE:
|
|
@ -19,12 +19,12 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace OCP\Notification;
|
namespace OC\Notification;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interface IApp
|
* Interface IApp
|
||||||
*
|
*
|
||||||
* @package OCP\Notification
|
* @package OC\Notification
|
||||||
* @since 8.2.0
|
* @since 8.2.0
|
||||||
*
|
*
|
||||||
* DEVELOPER NOTE:
|
* DEVELOPER NOTE:
|
|
@ -19,12 +19,12 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace OCP\Notification;
|
namespace OC\Notification;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interface IManager
|
* Interface IManager
|
||||||
*
|
*
|
||||||
* @package OCP\Notification
|
* @package OC\Notification
|
||||||
* @since 8.2.0
|
* @since 8.2.0
|
||||||
*
|
*
|
||||||
* DEVELOPER NOTE:
|
* DEVELOPER NOTE:
|
|
@ -19,12 +19,12 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace OCP\Notification;
|
namespace OC\Notification;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interface INotification
|
* Interface INotification
|
||||||
*
|
*
|
||||||
* @package OCP\Notification
|
* @package OC\Notification
|
||||||
* @since 8.2.0
|
* @since 8.2.0
|
||||||
*
|
*
|
||||||
* DEVELOPER NOTE:
|
* DEVELOPER NOTE:
|
|
@ -19,12 +19,12 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace OCP\Notification;
|
namespace OC\Notification;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interface INotifier
|
* Interface INotifier
|
||||||
*
|
*
|
||||||
* @package OCP\Notification
|
* @package OC\Notification
|
||||||
* @since 8.2.0
|
* @since 8.2.0
|
||||||
*
|
*
|
||||||
* DEVELOPER NOTE:
|
* DEVELOPER NOTE:
|
|
@ -22,11 +22,6 @@
|
||||||
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;
|
||||||
|
|
|
@ -21,8 +21,6 @@
|
||||||
|
|
||||||
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 */
|
||||||
|
|
|
@ -1050,7 +1050,7 @@ class Server extends SimpleContainer implements IServerContainer {
|
||||||
/**
|
/**
|
||||||
* Get the Notification Manager
|
* Get the Notification Manager
|
||||||
*
|
*
|
||||||
* @return \OCP\Notification\IManager
|
* @return \OC\Notification\IManager
|
||||||
* @since 8.2.0
|
* @since 8.2.0
|
||||||
*/
|
*/
|
||||||
public function getNotificationManager() {
|
public function getNotificationManager() {
|
||||||
|
|
|
@ -459,7 +459,7 @@ interface IServerContainer {
|
||||||
/**
|
/**
|
||||||
* Get the Notification Manager
|
* Get the Notification Manager
|
||||||
*
|
*
|
||||||
* @return \OCP\Notification\IManager
|
* @return \OC\Notification\IManager
|
||||||
* @since 8.2.0
|
* @since 8.2.0
|
||||||
*/
|
*/
|
||||||
public function getNotificationManager();
|
public function getNotificationManager();
|
||||||
|
|
|
@ -23,7 +23,7 @@ namespace Test\Notification;
|
||||||
|
|
||||||
|
|
||||||
use OC\Notification\Action;
|
use OC\Notification\Action;
|
||||||
use OCP\Notification\IAction;
|
use OC\Notification\IAction;
|
||||||
use Test\TestCase;
|
use Test\TestCase;
|
||||||
|
|
||||||
class ActionTest extends TestCase {
|
class ActionTest extends TestCase {
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
namespace Test\Notification;
|
namespace Test\Notification;
|
||||||
|
|
||||||
use OC\Notification\Manager;
|
use OC\Notification\Manager;
|
||||||
use OCP\Notification\IManager;
|
use OC\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('OCP\Notification\IApp')
|
$app = $this->getMockBuilder('OC\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('OCP\Notification\INotifier')
|
$notifier = $this->getMockBuilder('OC\Notification\INotifier')
|
||||||
->disableOriginalConstructor()
|
->disableOriginalConstructor()
|
||||||
->getMock();
|
->getMock();
|
||||||
|
|
||||||
|
@ -73,7 +73,7 @@ class ManagerTest extends TestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testRegisterNotifier() {
|
public function testRegisterNotifier() {
|
||||||
$notifier = $this->getMockBuilder('OCP\Notification\INotifier')
|
$notifier = $this->getMockBuilder('OC\Notification\INotifier')
|
||||||
->disableOriginalConstructor()
|
->disableOriginalConstructor()
|
||||||
->getMock();
|
->getMock();
|
||||||
|
|
||||||
|
@ -97,7 +97,7 @@ class ManagerTest extends TestCase {
|
||||||
* @expectedException \InvalidArgumentException
|
* @expectedException \InvalidArgumentException
|
||||||
*/
|
*/
|
||||||
public function testRegisterNotifierInvalid() {
|
public function testRegisterNotifierInvalid() {
|
||||||
$app = $this->getMockBuilder('OCP\Notification\IApp')
|
$app = $this->getMockBuilder('OC\Notification\IApp')
|
||||||
->disableOriginalConstructor()
|
->disableOriginalConstructor()
|
||||||
->getMock();
|
->getMock();
|
||||||
|
|
||||||
|
@ -112,28 +112,28 @@ class ManagerTest extends TestCase {
|
||||||
|
|
||||||
public function testCreateNotification() {
|
public function testCreateNotification() {
|
||||||
$action = $this->manager->createNotification();
|
$action = $this->manager->createNotification();
|
||||||
$this->assertInstanceOf('OCP\Notification\INotification', $action);
|
$this->assertInstanceOf('OC\Notification\INotification', $action);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testNotify() {
|
public function testNotify() {
|
||||||
/** @var \OCP\Notification\INotification|\PHPUnit_Framework_MockObject_MockObject $notification */
|
/** @var \OC\Notification\INotification|\PHPUnit_Framework_MockObject_MockObject $notification */
|
||||||
$notification = $this->getMockBuilder('OCP\Notification\INotification')
|
$notification = $this->getMockBuilder('OC\Notification\INotification')
|
||||||
->disableOriginalConstructor()
|
->disableOriginalConstructor()
|
||||||
->getMock();
|
->getMock();
|
||||||
$notification->expects($this->once())
|
$notification->expects($this->once())
|
||||||
->method('isValid')
|
->method('isValid')
|
||||||
->willReturn(true);
|
->willReturn(true);
|
||||||
|
|
||||||
/** @var \OCP\Notification\IApp|\PHPUnit_Framework_MockObject_MockObject $app */
|
/** @var \OC\Notification\IApp|\PHPUnit_Framework_MockObject_MockObject $app */
|
||||||
$app = $this->getMockBuilder('OCP\Notification\IApp')
|
$app = $this->getMockBuilder('OC\Notification\IApp')
|
||||||
->disableOriginalConstructor()
|
->disableOriginalConstructor()
|
||||||
->getMock();
|
->getMock();
|
||||||
$app->expects($this->once())
|
$app->expects($this->once())
|
||||||
->method('notify')
|
->method('notify')
|
||||||
->with($notification);
|
->with($notification);
|
||||||
|
|
||||||
/** @var \OCP\Notification\IApp|\PHPUnit_Framework_MockObject_MockObject $app2 */
|
/** @var \OC\Notification\IApp|\PHPUnit_Framework_MockObject_MockObject $app2 */
|
||||||
$app2 = $this->getMockBuilder('OCP\Notification\IApp')
|
$app2 = $this->getMockBuilder('OC\Notification\IApp')
|
||||||
->disableOriginalConstructor()
|
->disableOriginalConstructor()
|
||||||
->getMock();
|
->getMock();
|
||||||
$app2->expects($this->once())
|
$app2->expects($this->once())
|
||||||
|
@ -154,8 +154,8 @@ class ManagerTest extends TestCase {
|
||||||
* @expectedException \InvalidArgumentException
|
* @expectedException \InvalidArgumentException
|
||||||
*/
|
*/
|
||||||
public function testNotifyInvalid() {
|
public function testNotifyInvalid() {
|
||||||
/** @var \OCP\Notification\INotification|\PHPUnit_Framework_MockObject_MockObject $notification */
|
/** @var \OC\Notification\INotification|\PHPUnit_Framework_MockObject_MockObject $notification */
|
||||||
$notification = $this->getMockBuilder('OCP\Notification\INotification')
|
$notification = $this->getMockBuilder('OC\Notification\INotification')
|
||||||
->disableOriginalConstructor()
|
->disableOriginalConstructor()
|
||||||
->getMock();
|
->getMock();
|
||||||
$notification->expects($this->once())
|
$notification->expects($this->once())
|
||||||
|
@ -166,23 +166,23 @@ class ManagerTest extends TestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testPrepare() {
|
public function testPrepare() {
|
||||||
/** @var \OCP\Notification\INotification|\PHPUnit_Framework_MockObject_MockObject $notification */
|
/** @var \OC\Notification\INotification|\PHPUnit_Framework_MockObject_MockObject $notification */
|
||||||
$notification = $this->getMockBuilder('OCP\Notification\INotification')
|
$notification = $this->getMockBuilder('OC\Notification\INotification')
|
||||||
->disableOriginalConstructor()
|
->disableOriginalConstructor()
|
||||||
->getMock();
|
->getMock();
|
||||||
$notification->expects($this->once())
|
$notification->expects($this->once())
|
||||||
->method('isValidParsed')
|
->method('isValidParsed')
|
||||||
->willReturn(true);
|
->willReturn(true);
|
||||||
/** @var \OCP\Notification\INotification|\PHPUnit_Framework_MockObject_MockObject $notification2 */
|
/** @var \OC\Notification\INotification|\PHPUnit_Framework_MockObject_MockObject $notification2 */
|
||||||
$notification2 = $this->getMockBuilder('OCP\Notification\INotification')
|
$notification2 = $this->getMockBuilder('OC\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 \OCP\Notification\IApp|\PHPUnit_Framework_MockObject_MockObject $notifier */
|
/** @var \OC\Notification\IApp|\PHPUnit_Framework_MockObject_MockObject $notifier */
|
||||||
$notifier = $this->getMockBuilder('OCP\Notification\INotifier')
|
$notifier = $this->getMockBuilder('OC\Notification\INotifier')
|
||||||
->disableOriginalConstructor()
|
->disableOriginalConstructor()
|
||||||
->getMock();
|
->getMock();
|
||||||
$notifier->expects($this->once())
|
$notifier->expects($this->once())
|
||||||
|
@ -190,8 +190,8 @@ class ManagerTest extends TestCase {
|
||||||
->with($notification, 'en')
|
->with($notification, 'en')
|
||||||
->willReturnArgument(0);
|
->willReturnArgument(0);
|
||||||
|
|
||||||
/** @var \OCP\Notification\IApp|\PHPUnit_Framework_MockObject_MockObject $notifier2 */
|
/** @var \OC\Notification\IApp|\PHPUnit_Framework_MockObject_MockObject $notifier2 */
|
||||||
$notifier2 = $this->getMockBuilder('OCP\Notification\INotifier')
|
$notifier2 = $this->getMockBuilder('OC\Notification\INotifier')
|
||||||
->disableOriginalConstructor()
|
->disableOriginalConstructor()
|
||||||
->getMock();
|
->getMock();
|
||||||
$notifier2->expects($this->once())
|
$notifier2->expects($this->once())
|
||||||
|
@ -213,16 +213,16 @@ class ManagerTest extends TestCase {
|
||||||
* @expectedException \InvalidArgumentException
|
* @expectedException \InvalidArgumentException
|
||||||
*/
|
*/
|
||||||
public function testPrepareInvalid() {
|
public function testPrepareInvalid() {
|
||||||
/** @var \OCP\Notification\INotification|\PHPUnit_Framework_MockObject_MockObject $notification */
|
/** @var \OC\Notification\INotification|\PHPUnit_Framework_MockObject_MockObject $notification */
|
||||||
$notification = $this->getMockBuilder('OCP\Notification\INotification')
|
$notification = $this->getMockBuilder('OC\Notification\INotification')
|
||||||
->disableOriginalConstructor()
|
->disableOriginalConstructor()
|
||||||
->getMock();
|
->getMock();
|
||||||
$notification->expects($this->once())
|
$notification->expects($this->once())
|
||||||
->method('isValidParsed')
|
->method('isValidParsed')
|
||||||
->willReturn(false);
|
->willReturn(false);
|
||||||
|
|
||||||
/** @var \OCP\Notification\IApp|\PHPUnit_Framework_MockObject_MockObject $notifier */
|
/** @var \OC\Notification\IApp|\PHPUnit_Framework_MockObject_MockObject $notifier */
|
||||||
$notifier = $this->getMockBuilder('OCP\Notification\INotifier')
|
$notifier = $this->getMockBuilder('OC\Notification\INotifier')
|
||||||
->disableOriginalConstructor()
|
->disableOriginalConstructor()
|
||||||
->getMock();
|
->getMock();
|
||||||
$notifier->expects($this->once())
|
$notifier->expects($this->once())
|
||||||
|
@ -238,16 +238,16 @@ class ManagerTest extends TestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testPrepareNotifierThrows() {
|
public function testPrepareNotifierThrows() {
|
||||||
/** @var \OCP\Notification\INotification|\PHPUnit_Framework_MockObject_MockObject $notification */
|
/** @var \OC\Notification\INotification|\PHPUnit_Framework_MockObject_MockObject $notification */
|
||||||
$notification = $this->getMockBuilder('OCP\Notification\INotification')
|
$notification = $this->getMockBuilder('OC\Notification\INotification')
|
||||||
->disableOriginalConstructor()
|
->disableOriginalConstructor()
|
||||||
->getMock();
|
->getMock();
|
||||||
$notification->expects($this->once())
|
$notification->expects($this->once())
|
||||||
->method('isValidParsed')
|
->method('isValidParsed')
|
||||||
->willReturn(true);
|
->willReturn(true);
|
||||||
|
|
||||||
/** @var \OCP\Notification\IApp|\PHPUnit_Framework_MockObject_MockObject $notifier */
|
/** @var \OC\Notification\IApp|\PHPUnit_Framework_MockObject_MockObject $notifier */
|
||||||
$notifier = $this->getMockBuilder('OCP\Notification\INotifier')
|
$notifier = $this->getMockBuilder('OC\Notification\INotifier')
|
||||||
->disableOriginalConstructor()
|
->disableOriginalConstructor()
|
||||||
->getMock();
|
->getMock();
|
||||||
$notifier->expects($this->once())
|
$notifier->expects($this->once())
|
||||||
|
@ -266,8 +266,8 @@ class ManagerTest extends TestCase {
|
||||||
* @expectedException \InvalidArgumentException
|
* @expectedException \InvalidArgumentException
|
||||||
*/
|
*/
|
||||||
public function testPrepareNoNotifier() {
|
public function testPrepareNoNotifier() {
|
||||||
/** @var \OCP\Notification\INotification|\PHPUnit_Framework_MockObject_MockObject $notification */
|
/** @var \OC\Notification\INotification|\PHPUnit_Framework_MockObject_MockObject $notification */
|
||||||
$notification = $this->getMockBuilder('OCP\Notification\INotification')
|
$notification = $this->getMockBuilder('OC\Notification\INotification')
|
||||||
->disableOriginalConstructor()
|
->disableOriginalConstructor()
|
||||||
->getMock();
|
->getMock();
|
||||||
$notification->expects($this->once())
|
$notification->expects($this->once())
|
||||||
|
@ -278,21 +278,21 @@ class ManagerTest extends TestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testMarkProcessed() {
|
public function testMarkProcessed() {
|
||||||
/** @var \OCP\Notification\INotification|\PHPUnit_Framework_MockObject_MockObject $notification */
|
/** @var \OC\Notification\INotification|\PHPUnit_Framework_MockObject_MockObject $notification */
|
||||||
$notification = $this->getMockBuilder('OCP\Notification\INotification')
|
$notification = $this->getMockBuilder('OC\Notification\INotification')
|
||||||
->disableOriginalConstructor()
|
->disableOriginalConstructor()
|
||||||
->getMock();
|
->getMock();
|
||||||
|
|
||||||
/** @var \OCP\Notification\IApp|\PHPUnit_Framework_MockObject_MockObject $app */
|
/** @var \OC\Notification\IApp|\PHPUnit_Framework_MockObject_MockObject $app */
|
||||||
$app = $this->getMockBuilder('OCP\Notification\IApp')
|
$app = $this->getMockBuilder('OC\Notification\IApp')
|
||||||
->disableOriginalConstructor()
|
->disableOriginalConstructor()
|
||||||
->getMock();
|
->getMock();
|
||||||
$app->expects($this->once())
|
$app->expects($this->once())
|
||||||
->method('markProcessed')
|
->method('markProcessed')
|
||||||
->with($notification);
|
->with($notification);
|
||||||
|
|
||||||
/** @var \OCP\Notification\IApp|\PHPUnit_Framework_MockObject_MockObject $app2 */
|
/** @var \OC\Notification\IApp|\PHPUnit_Framework_MockObject_MockObject $app2 */
|
||||||
$app2 = $this->getMockBuilder('OCP\Notification\IApp')
|
$app2 = $this->getMockBuilder('OC\Notification\IApp')
|
||||||
->disableOriginalConstructor()
|
->disableOriginalConstructor()
|
||||||
->getMock();
|
->getMock();
|
||||||
$app2->expects($this->once())
|
$app2->expects($this->once())
|
||||||
|
@ -310,13 +310,13 @@ class ManagerTest extends TestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testGetCount() {
|
public function testGetCount() {
|
||||||
/** @var \OCP\Notification\INotification|\PHPUnit_Framework_MockObject_MockObject $notification */
|
/** @var \OC\Notification\INotification|\PHPUnit_Framework_MockObject_MockObject $notification */
|
||||||
$notification = $this->getMockBuilder('OCP\Notification\INotification')
|
$notification = $this->getMockBuilder('OC\Notification\INotification')
|
||||||
->disableOriginalConstructor()
|
->disableOriginalConstructor()
|
||||||
->getMock();
|
->getMock();
|
||||||
|
|
||||||
/** @var \OCP\Notification\IApp|\PHPUnit_Framework_MockObject_MockObject $app */
|
/** @var \OC\Notification\IApp|\PHPUnit_Framework_MockObject_MockObject $app */
|
||||||
$app = $this->getMockBuilder('OCP\Notification\IApp')
|
$app = $this->getMockBuilder('OC\Notification\IApp')
|
||||||
->disableOriginalConstructor()
|
->disableOriginalConstructor()
|
||||||
->getMock();
|
->getMock();
|
||||||
$app->expects($this->once())
|
$app->expects($this->once())
|
||||||
|
@ -324,8 +324,8 @@ class ManagerTest extends TestCase {
|
||||||
->with($notification)
|
->with($notification)
|
||||||
->willReturn(21);
|
->willReturn(21);
|
||||||
|
|
||||||
/** @var \OCP\Notification\IApp|\PHPUnit_Framework_MockObject_MockObject $app2 */
|
/** @var \OC\Notification\IApp|\PHPUnit_Framework_MockObject_MockObject $app2 */
|
||||||
$app2 = $this->getMockBuilder('OCP\Notification\IApp')
|
$app2 = $this->getMockBuilder('OC\Notification\IApp')
|
||||||
->disableOriginalConstructor()
|
->disableOriginalConstructor()
|
||||||
->getMock();
|
->getMock();
|
||||||
$app2->expects($this->once())
|
$app2->expects($this->once())
|
||||||
|
|
|
@ -23,7 +23,7 @@ namespace Test\Notification;
|
||||||
|
|
||||||
|
|
||||||
use OC\Notification\Notification;
|
use OC\Notification\Notification;
|
||||||
use OCP\Notification\INotification;
|
use OC\Notification\INotification;
|
||||||
use Test\TestCase;
|
use Test\TestCase;
|
||||||
|
|
||||||
class NotificationTest extends TestCase {
|
class NotificationTest extends TestCase {
|
||||||
|
@ -401,12 +401,12 @@ class NotificationTest extends TestCase {
|
||||||
|
|
||||||
public function testCreateAction() {
|
public function testCreateAction() {
|
||||||
$action = $this->notification->createAction();
|
$action = $this->notification->createAction();
|
||||||
$this->assertInstanceOf('OCP\Notification\IAction', $action);
|
$this->assertInstanceOf('OC\Notification\IAction', $action);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testAddAction() {
|
public function testAddAction() {
|
||||||
/** @var \OCP\Notification\IAction|\PHPUnit_Framework_MockObject_MockObject $action */
|
/** @var \OC\Notification\IAction|\PHPUnit_Framework_MockObject_MockObject $action */
|
||||||
$action = $this->getMockBuilder('OCP\Notification\IAction')
|
$action = $this->getMockBuilder('OC\Notification\IAction')
|
||||||
->disableOriginalConstructor()
|
->disableOriginalConstructor()
|
||||||
->getMock();
|
->getMock();
|
||||||
$action->expects($this->once())
|
$action->expects($this->once())
|
||||||
|
@ -425,8 +425,8 @@ class NotificationTest extends TestCase {
|
||||||
* @expectedException \InvalidArgumentException
|
* @expectedException \InvalidArgumentException
|
||||||
*/
|
*/
|
||||||
public function testAddActionInvalid() {
|
public function testAddActionInvalid() {
|
||||||
/** @var \OCP\Notification\IAction|\PHPUnit_Framework_MockObject_MockObject $action */
|
/** @var \OC\Notification\IAction|\PHPUnit_Framework_MockObject_MockObject $action */
|
||||||
$action = $this->getMockBuilder('OCP\Notification\IAction')
|
$action = $this->getMockBuilder('OC\Notification\IAction')
|
||||||
->disableOriginalConstructor()
|
->disableOriginalConstructor()
|
||||||
->getMock();
|
->getMock();
|
||||||
$action->expects($this->once())
|
$action->expects($this->once())
|
||||||
|
@ -439,8 +439,8 @@ class NotificationTest extends TestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testAddParsedAction() {
|
public function testAddParsedAction() {
|
||||||
/** @var \OCP\Notification\IAction|\PHPUnit_Framework_MockObject_MockObject $action */
|
/** @var \OC\Notification\IAction|\PHPUnit_Framework_MockObject_MockObject $action */
|
||||||
$action = $this->getMockBuilder('OCP\Notification\IAction')
|
$action = $this->getMockBuilder('OC\Notification\IAction')
|
||||||
->disableOriginalConstructor()
|
->disableOriginalConstructor()
|
||||||
->getMock();
|
->getMock();
|
||||||
$action->expects($this->once())
|
$action->expects($this->once())
|
||||||
|
@ -459,8 +459,8 @@ class NotificationTest extends TestCase {
|
||||||
* @expectedException \InvalidArgumentException
|
* @expectedException \InvalidArgumentException
|
||||||
*/
|
*/
|
||||||
public function testAddParsedActionInvalid() {
|
public function testAddParsedActionInvalid() {
|
||||||
/** @var \OCP\Notification\IAction|\PHPUnit_Framework_MockObject_MockObject $action */
|
/** @var \OC\Notification\IAction|\PHPUnit_Framework_MockObject_MockObject $action */
|
||||||
$action = $this->getMockBuilder('OCP\Notification\IAction')
|
$action = $this->getMockBuilder('OC\Notification\IAction')
|
||||||
->disableOriginalConstructor()
|
->disableOriginalConstructor()
|
||||||
->getMock();
|
->getMock();
|
||||||
$action->expects($this->once())
|
$action->expects($this->once())
|
||||||
|
@ -489,7 +489,7 @@ class NotificationTest extends TestCase {
|
||||||
* @param bool $expected
|
* @param bool $expected
|
||||||
*/
|
*/
|
||||||
public function testIsValid($isValidCommon, $subject, $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')
|
$notification = $this->getMockBuilder('\OC\Notification\Notification')
|
||||||
->setMethods([
|
->setMethods([
|
||||||
'isValidCommon',
|
'isValidCommon',
|
||||||
|
@ -520,7 +520,7 @@ class NotificationTest extends TestCase {
|
||||||
* @param bool $expected
|
* @param bool $expected
|
||||||
*/
|
*/
|
||||||
public function testIsParsedValid($isValidCommon, $subject, $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')
|
$notification = $this->getMockBuilder('\OC\Notification\Notification')
|
||||||
->setMethods([
|
->setMethods([
|
||||||
'isValidCommon',
|
'isValidCommon',
|
||||||
|
@ -565,7 +565,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 \OCP\Notification\INotification|\PHPUnit_Framework_MockObject_MockObject $notification */
|
/** @var \OC\Notification\INotification|\PHPUnit_Framework_MockObject_MockObject $notification */
|
||||||
$notification = $this->getMockBuilder('\OC\Notification\Notification')
|
$notification = $this->getMockBuilder('\OC\Notification\Notification')
|
||||||
->setMethods([
|
->setMethods([
|
||||||
'getApp',
|
'getApp',
|
||||||
|
|
|
@ -105,7 +105,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', '\OCP\Notification\IManager'],
|
['NotificationManager', '\OC\Notification\IManager'],
|
||||||
['UserCache', '\OC\Cache\File'],
|
['UserCache', '\OC\Cache\File'],
|
||||||
['UserCache', '\OCP\ICache'],
|
['UserCache', '\OCP\ICache'],
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue