namespace OCA\Settings\Tests\AppInfo;
-use OC\User\Session;
use OCA\Settings\AppInfo\Application;
use OCA\Settings\Controller\AdminSettingsController;
use OCA\Settings\Controller\AppSettingsController;
use OCA\Settings\Controller\AuthSettingsController;
-use OCA\Settings\Controller\CertificateController;
use OCA\Settings\Controller\CheckSetupController;
use OCA\Settings\Controller\LogSettingsController;
use OCA\Settings\Controller\MailSettingsController;
use OCP\AppFramework\Controller;
use OCP\AppFramework\IAppContainer;
use OCP\AppFramework\Middleware;
-use OCP\IUser;
-use OCP\IUserSession;
use Test\TestCase;
/**
[AdminSettingsController::class, Controller::class],
[AppSettingsController::class, Controller::class],
[AuthSettingsController::class, Controller::class],
- // Needs session: [CertificateController::class, Controller::class],
[CheckSetupController::class, Controller::class],
[LogSettingsController::class, Controller::class],
[MailSettingsController::class, Controller::class],
public function testContainerQuery($service, $expected) {
$this->assertTrue($this->container->query($service) instanceof $expected);
}
-
- public function dataContainerQueryRequiresSession() {
- return [
- [CertificateController::class, Controller::class],
- ];
- }
-
- /**
- * @dataProvider dataContainerQueryRequiresSession
- * @param string $service
- * @param string $expected
- */
- public function testContainerQueryRequiresSession($service, $expected) {
- $user = $this->createMock(IUser::class);
- $user->expects($this->once())
- ->method('getUID')
- ->willReturn('test');
-
- $session = $this->createMock(IUserSession::class);
- $session->expects($this->once())
- ->method('getUser')
- ->willReturn($user);
-
- $this->overwriteService(Session::class, $session);
- $this->assertTrue($this->container->query($service) instanceof $expected);
- $this->restoreService(Session::class);
- }
}