diff options
author | Arthur Schiwon <blizzz@owncloud.com> | 2016-02-09 02:51:12 +0100 |
---|---|---|
committer | Arthur Schiwon <blizzz@owncloud.com> | 2016-02-09 02:51:12 +0100 |
commit | cd00751de56800748fb47da3880decdd25a65edd (patch) | |
tree | 4ab2a1ed69b158c8dac1fe906a0029f07270a694 /tests/lib | |
parent | 850ac0cf84f2492b16204b811f58a0dc7dc43b6e (diff) | |
download | nextcloud-server-cd00751de56800748fb47da3880decdd25a65edd.tar.gz nextcloud-server-cd00751de56800748fb47da3880decdd25a65edd.zip |
Send events when enabling and disabling of apps
Diffstat (limited to 'tests/lib')
-rw-r--r-- | tests/lib/app.php | 4 | ||||
-rw-r--r-- | tests/lib/app/manager.php | 14 |
2 files changed, 11 insertions, 7 deletions
diff --git a/tests/lib/app.php b/tests/lib/app.php index 3fb42ea2382..065296827dd 100644 --- a/tests/lib/app.php +++ b/tests/lib/app.php @@ -485,7 +485,7 @@ class Test_App extends \Test\TestCase { return $appConfig; }); \OC::$server->registerService('AppManager', function (\OC\Server $c) use ($appConfig) { - return new \OC\App\AppManager($c->getUserSession(), $appConfig, $c->getGroupManager(), $c->getMemCacheFactory()); + return new \OC\App\AppManager($c->getUserSession(), $appConfig, $c->getGroupManager(), $c->getMemCacheFactory(), $c->getEventDispatcher()); }); } @@ -497,7 +497,7 @@ class Test_App extends \Test\TestCase { return new \OC\AppConfig($c->getDatabaseConnection()); }); \OC::$server->registerService('AppManager', function (\OC\Server $c) { - return new \OC\App\AppManager($c->getUserSession(), $c->getAppConfig(), $c->getGroupManager(), $c->getMemCacheFactory()); + return new \OC\App\AppManager($c->getUserSession(), $c->getAppConfig(), $c->getGroupManager(), $c->getMemCacheFactory(), $c->getEventDispatcher()); }); // Remove the cache of the mocked apps list with a forceRefresh diff --git a/tests/lib/app/manager.php b/tests/lib/app/manager.php index ee9b1f308ea..ef7c01658e1 100644 --- a/tests/lib/app/manager.php +++ b/tests/lib/app/manager.php @@ -79,6 +79,9 @@ class Manager extends TestCase { /** @var \OCP\App\IAppManager */ protected $manager; + /** @var \Symfony\Component\EventDispatcher\EventDispatcherInterface */ + protected $eventDispatcher; + protected function setUp() { parent::setUp(); @@ -87,11 +90,12 @@ class Manager extends TestCase { $this->appConfig = $this->getAppConfig(); $this->cacheFactory = $this->getMock('\OCP\ICacheFactory'); $this->cache = $this->getMock('\OCP\ICache'); + $this->eventDispatcher = $this->getMock('\Symfony\Component\EventDispatcher\EventDispatcherInterface'); $this->cacheFactory->expects($this->any()) ->method('create') ->with('settings') ->willReturn($this->cache); - $this->manager = new \OC\App\AppManager($this->userSession, $this->appConfig, $this->groupManager, $this->cacheFactory); + $this->manager = new \OC\App\AppManager($this->userSession, $this->appConfig, $this->groupManager, $this->cacheFactory, $this->eventDispatcher); } protected function expectClearCache() { @@ -149,7 +153,7 @@ class Manager extends TestCase { /** @var \OC\App\AppManager|\PHPUnit_Framework_MockObject_MockObject $manager */ $manager = $this->getMockBuilder('OC\App\AppManager') ->setConstructorArgs([ - $this->userSession, $this->appConfig, $this->groupManager, $this->cacheFactory + $this->userSession, $this->appConfig, $this->groupManager, $this->cacheFactory, $this->eventDispatcher ]) ->setMethods([ 'getAppInfo' @@ -192,7 +196,7 @@ class Manager extends TestCase { /** @var \OC\App\AppManager|\PHPUnit_Framework_MockObject_MockObject $manager */ $manager = $this->getMockBuilder('OC\App\AppManager') ->setConstructorArgs([ - $this->userSession, $this->appConfig, $this->groupManager, $this->cacheFactory + $this->userSession, $this->appConfig, $this->groupManager, $this->cacheFactory, $this->eventDispatcher ]) ->setMethods([ 'getAppInfo' @@ -301,7 +305,7 @@ class Manager extends TestCase { public function testGetAppsNeedingUpgrade() { $this->manager = $this->getMockBuilder('\OC\App\AppManager') - ->setConstructorArgs([$this->userSession, $this->appConfig, $this->groupManager, $this->cacheFactory]) + ->setConstructorArgs([$this->userSession, $this->appConfig, $this->groupManager, $this->cacheFactory, $this->eventDispatcher]) ->setMethods(['getAppInfo']) ->getMock(); @@ -342,7 +346,7 @@ class Manager extends TestCase { public function testGetIncompatibleApps() { $this->manager = $this->getMockBuilder('\OC\App\AppManager') - ->setConstructorArgs([$this->userSession, $this->appConfig, $this->groupManager, $this->cacheFactory]) + ->setConstructorArgs([$this->userSession, $this->appConfig, $this->groupManager, $this->cacheFactory, $this->eventDispatcher]) ->setMethods(['getAppInfo']) ->getMock(); |