aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/files/tests/activitytest.php4
-rw-r--r--lib/private/Activity/Manager.php (renamed from lib/private/ActivityManager.php)5
-rw-r--r--lib/private/Server.php2
-rw-r--r--tests/lib/activity/managertest.php (renamed from tests/lib/activitymanager.php)32
-rw-r--r--tests/lib/server.php2
5 files changed, 24 insertions, 21 deletions
diff --git a/apps/files/tests/activitytest.php b/apps/files/tests/activitytest.php
index 5e73ff0b5dd..bc062dd0542 100644
--- a/apps/files/tests/activitytest.php
+++ b/apps/files/tests/activitytest.php
@@ -33,7 +33,7 @@ use Test\TestCase;
*/
class ActivityTest extends TestCase {
- /** @var \OC\ActivityManager */
+ /** @var \OCP\Activity\IManager */
private $activityManager;
/** @var \OCP\IRequest|\PHPUnit_Framework_MockObject_MockObject */
@@ -70,7 +70,7 @@ class ActivityTest extends TestCase {
->disableOriginalConstructor()
->getMock();
- $this->activityManager = new \OC\ActivityManager(
+ $this->activityManager = new \OC\Activity\Manager(
$this->request,
$this->session,
$this->config
diff --git a/lib/private/ActivityManager.php b/lib/private/Activity/Manager.php
index e522dca9e3b..e68802b2abb 100644
--- a/lib/private/ActivityManager.php
+++ b/lib/private/Activity/Manager.php
@@ -20,10 +20,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
-namespace OC;
+namespace OC\Activity;
-use OC\Activity\Event;
use OCP\Activity\IConsumer;
use OCP\Activity\IEvent;
use OCP\Activity\IExtension;
@@ -33,7 +32,7 @@ use OCP\IRequest;
use OCP\IUser;
use OCP\IUserSession;
-class ActivityManager implements IManager {
+class Manager implements IManager {
/** @var IRequest */
protected $request;
diff --git a/lib/private/Server.php b/lib/private/Server.php
index 11cce494418..17cb7ee39cc 100644
--- a/lib/private/Server.php
+++ b/lib/private/Server.php
@@ -313,7 +313,7 @@ class Server extends ServerContainer implements IServerContainer {
);
});
$this->registerService('ActivityManager', function (Server $c) {
- return new ActivityManager(
+ return new \OC\Activity\Manager(
$c->getRequest(),
$c->getUserSession(),
$c->getConfig()
diff --git a/tests/lib/activitymanager.php b/tests/lib/activity/managertest.php
index 26759d46270..cf855dd2813 100644
--- a/tests/lib/activitymanager.php
+++ b/tests/lib/activity/managertest.php
@@ -8,18 +8,22 @@
*
*/
-class Test_ActivityManager extends \Test\TestCase {
+namespace Test\Activity;
- /** @var \OC\ActivityManager */
+use Test\TestCase;
+
+class ManagerTest extends TestCase {
+
+ /** @var \OC\Activity\Manager */
private $activityManager;
- /** @var \PHPUnit_Framework_MockObject_MockObject */
+ /** @var \OCP\IRequest|\PHPUnit_Framework_MockObject_MockObject */
protected $request;
- /** @var \PHPUnit_Framework_MockObject_MockObject */
+ /** @var \OCP\IUserSession|\PHPUnit_Framework_MockObject_MockObject */
protected $session;
- /** @var \PHPUnit_Framework_MockObject_MockObject */
+ /** @var \OCP\IConfig|\PHPUnit_Framework_MockObject_MockObject */
protected $config;
protected function setUp() {
@@ -35,7 +39,7 @@ class Test_ActivityManager extends \Test\TestCase {
->disableOriginalConstructor()
->getMock();
- $this->activityManager = new \OC\ActivityManager(
+ $this->activityManager = new \OC\Activity\Manager(
$this->request,
$this->session,
$this->config
@@ -71,7 +75,7 @@ class Test_ActivityManager extends \Test\TestCase {
*/
public function testGetConsumersInvalidConsumer() {
$this->activityManager->registerConsumer(function() {
- return new StdClass();
+ return new \stdClass();
});
$this->invokePrivate($this->activityManager, 'getConsumers');
@@ -88,7 +92,7 @@ class Test_ActivityManager extends \Test\TestCase {
*/
public function testGetExtensionsInvalidExtension() {
$this->activityManager->registerExtension(function() {
- return new StdClass();
+ return new \stdClass();
});
$this->invokePrivate($this->activityManager, 'getExtensions');
@@ -119,10 +123,10 @@ class Test_ActivityManager extends \Test\TestCase {
}
public function testTranslate() {
- $result = $this->activityManager->translate('APP0', '', '', array(), false, false, 'en');
+ $result = $this->activityManager->translate('APP0', '', array(), false, false, 'en');
$this->assertEquals('Stupid translation', $result);
- $result = $this->activityManager->translate('APP1', '', '', array(), false, false, 'en');
+ $result = $this->activityManager->translate('APP1', '', array(), false, false, 'en');
$this->assertFalse($result);
}
@@ -259,7 +263,7 @@ class Test_ActivityManager extends \Test\TestCase {
}
/**
- * @expectedException BadMethodCallException
+ * @expectedException \BadMethodCallException
* @expectedExceptionMessage App not set
* @expectedExceptionCode 10
*/
@@ -269,7 +273,7 @@ class Test_ActivityManager extends \Test\TestCase {
}
/**
- * @expectedException BadMethodCallException
+ * @expectedException \BadMethodCallException
* @expectedExceptionMessage Type not set
* @expectedExceptionCode 11
*/
@@ -280,7 +284,7 @@ class Test_ActivityManager extends \Test\TestCase {
}
/**
- * @expectedException BadMethodCallException
+ * @expectedException \BadMethodCallException
* @expectedExceptionMessage Affected user not set
* @expectedExceptionCode 12
*/
@@ -292,7 +296,7 @@ class Test_ActivityManager extends \Test\TestCase {
}
/**
- * @expectedException BadMethodCallException
+ * @expectedException \BadMethodCallException
* @expectedExceptionMessage Subject not set
* @expectedExceptionCode 13
*/
diff --git a/tests/lib/server.php b/tests/lib/server.php
index d13f9be0c9e..fe3c6fd5ee8 100644
--- a/tests/lib/server.php
+++ b/tests/lib/server.php
@@ -44,7 +44,7 @@ class Server extends \Test\TestCase {
public function dataTestQuery() {
return [
- ['ActivityManager', '\OC\ActivityManager'],
+ ['ActivityManager', '\OC\Activity\Manager'],
['ActivityManager', '\OCP\Activity\IManager'],
['AllConfig', '\OC\AllConfig'],
['AllConfig', '\OCP\IConfig'],