2016-05-09 04:02:07 -04:00
|
|
|
<?php
|
2024-05-27 11:39:07 -04:00
|
|
|
|
2016-05-09 04:02:07 -04:00
|
|
|
/**
|
2024-05-27 11:39:07 -04:00
|
|
|
* SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
|
|
|
|
|
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.
|
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
2016-05-09 04:02:07 -04:00
|
|
|
*/
|
|
|
|
|
namespace OCA\Comments\Tests\Unit\AppInfo;
|
|
|
|
|
|
|
|
|
|
use OCA\Comments\AppInfo\Application;
|
2017-03-03 07:12:24 -05:00
|
|
|
use OCA\Comments\Notification\Notifier;
|
2016-05-09 04:02:07 -04:00
|
|
|
use Test\TestCase;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Class ApplicationTest
|
|
|
|
|
*
|
|
|
|
|
* @group DB
|
|
|
|
|
*
|
|
|
|
|
* @package OCA\Comments\Tests\Unit\AppInfo
|
|
|
|
|
*/
|
|
|
|
|
class ApplicationTest extends TestCase {
|
2019-11-21 10:40:38 -05:00
|
|
|
protected function setUp(): void {
|
2016-05-09 04:02:07 -04:00
|
|
|
parent::setUp();
|
|
|
|
|
\OC::$server->getUserManager()->createUser('dummy', '456');
|
|
|
|
|
\OC::$server->getUserSession()->setUser(\OC::$server->getUserManager()->get('dummy'));
|
|
|
|
|
}
|
|
|
|
|
|
2019-11-21 10:40:38 -05:00
|
|
|
protected function tearDown(): void {
|
2016-05-09 04:02:07 -04:00
|
|
|
\OC::$server->getUserManager()->get('dummy')->delete();
|
|
|
|
|
parent::tearDown();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function test(): void {
|
|
|
|
|
$app = new Application();
|
|
|
|
|
$c = $app->getContainer();
|
|
|
|
|
|
|
|
|
|
$services = [
|
2023-06-19 01:48:03 -04:00
|
|
|
'OCA\Comments\Controller\NotificationsController',
|
2016-11-18 10:51:50 -05:00
|
|
|
'OCA\Comments\Activity\Filter',
|
2016-05-09 04:02:07 -04:00
|
|
|
'OCA\Comments\Activity\Listener',
|
2016-11-18 10:51:50 -05:00
|
|
|
'OCA\Comments\Activity\Provider',
|
|
|
|
|
'OCA\Comments\Activity\Setting',
|
2017-03-03 07:12:24 -05:00
|
|
|
'OCA\Comments\Notification\Listener',
|
|
|
|
|
Notifier::class,
|
2016-05-09 04:02:07 -04:00
|
|
|
];
|
|
|
|
|
|
|
|
|
|
foreach ($services as $service) {
|
2022-03-15 12:17:36 -04:00
|
|
|
$s = $c->get($service);
|
2016-05-09 04:02:07 -04:00
|
|
|
$this->assertInstanceOf($service, $s);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|