Remove old unit tests as well

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2020-06-05 15:10:20 +02:00 committed by Roeland Jago Douma
parent 499278e132
commit 817eff6cbf
No known key found for this signature in database
GPG Key ID: F941078878347C0C
1 changed files with 0 additions and 32 deletions

View File

@ -25,12 +25,10 @@
namespace OCA\Settings\Tests\AppInfo; namespace OCA\Settings\Tests\AppInfo;
use OC\User\Session;
use OCA\Settings\AppInfo\Application; use OCA\Settings\AppInfo\Application;
use OCA\Settings\Controller\AdminSettingsController; use OCA\Settings\Controller\AdminSettingsController;
use OCA\Settings\Controller\AppSettingsController; use OCA\Settings\Controller\AppSettingsController;
use OCA\Settings\Controller\AuthSettingsController; use OCA\Settings\Controller\AuthSettingsController;
use OCA\Settings\Controller\CertificateController;
use OCA\Settings\Controller\CheckSetupController; use OCA\Settings\Controller\CheckSetupController;
use OCA\Settings\Controller\LogSettingsController; use OCA\Settings\Controller\LogSettingsController;
use OCA\Settings\Controller\MailSettingsController; use OCA\Settings\Controller\MailSettingsController;
@ -39,8 +37,6 @@ use OCA\Settings\Middleware\SubadminMiddleware;
use OCP\AppFramework\Controller; use OCP\AppFramework\Controller;
use OCP\AppFramework\IAppContainer; use OCP\AppFramework\IAppContainer;
use OCP\AppFramework\Middleware; use OCP\AppFramework\Middleware;
use OCP\IUser;
use OCP\IUserSession;
use Test\TestCase; use Test\TestCase;
/** /**
@ -72,7 +68,6 @@ class ApplicationTest extends TestCase {
[AdminSettingsController::class, Controller::class], [AdminSettingsController::class, Controller::class],
[AppSettingsController::class, Controller::class], [AppSettingsController::class, Controller::class],
[AuthSettingsController::class, Controller::class], [AuthSettingsController::class, Controller::class],
// Needs session: [CertificateController::class, Controller::class],
[CheckSetupController::class, Controller::class], [CheckSetupController::class, Controller::class],
[LogSettingsController::class, Controller::class], [LogSettingsController::class, Controller::class],
[MailSettingsController::class, Controller::class], [MailSettingsController::class, Controller::class],
@ -90,31 +85,4 @@ class ApplicationTest extends TestCase {
public function testContainerQuery($service, $expected) { public function testContainerQuery($service, $expected) {
$this->assertTrue($this->container->query($service) instanceof $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);
}
} }