From: Joas Schilling Date: Fri, 5 Jun 2020 13:10:20 +0000 (+0200) Subject: Remove old unit tests as well X-Git-Tag: v20.0.0beta1~450^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=817eff6cbf7cc777c38f76e849b3e94d79bfdb5f;p=nextcloud-server.git Remove old unit tests as well Signed-off-by: Joas Schilling --- diff --git a/apps/settings/tests/AppInfo/ApplicationTest.php b/apps/settings/tests/AppInfo/ApplicationTest.php index 794adc25d7f..66994872a3d 100644 --- a/apps/settings/tests/AppInfo/ApplicationTest.php +++ b/apps/settings/tests/AppInfo/ApplicationTest.php @@ -25,12 +25,10 @@ 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; @@ -39,8 +37,6 @@ use OCA\Settings\Middleware\SubadminMiddleware; use OCP\AppFramework\Controller; use OCP\AppFramework\IAppContainer; use OCP\AppFramework\Middleware; -use OCP\IUser; -use OCP\IUserSession; use Test\TestCase; /** @@ -72,7 +68,6 @@ class ApplicationTest extends 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], @@ -90,31 +85,4 @@ class ApplicationTest extends TestCase { 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); - } }