Fix tests

Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
This commit is contained in:
John Molakvoæ (skjnldsv) 2021-06-03 08:37:20 +02:00
parent 9e68804049
commit ada17934d8
No known key found for this signature in database
GPG Key ID: 60C25B8C072916CF
5 changed files with 6 additions and 18 deletions

View File

@ -89,7 +89,7 @@ class CoordinatorTest extends TestCase {
->with(\OCA\Settings\AppInfo\Application::class) ->with(\OCA\Settings\AppInfo\Application::class)
->willThrowException(new QueryException("")); ->willThrowException(new QueryException(""));
$this->logger->expects($this->once()) $this->logger->expects($this->once())
->method('logException'); ->method('error');
$this->coordinator->bootApp($appId); $this->coordinator->bootApp($appId);
} }

View File

@ -60,8 +60,6 @@ class RegistrationContextTest extends TestCase {
$container->expects($this->once()) $container->expects($this->once())
->method('registerCapability') ->method('registerCapability')
->with($name); ->with($name);
$this->logger->expects($this->never())
->method('logException');
$this->context->for('myapp')->registerCapability($name); $this->context->for('myapp')->registerCapability($name);
$this->context->delegateCapabilityRegistrations([ $this->context->delegateCapabilityRegistrations([
@ -76,8 +74,6 @@ class RegistrationContextTest extends TestCase {
$dispatcher->expects($this->once()) $dispatcher->expects($this->once())
->method('addServiceListener') ->method('addServiceListener')
->with($event, $service, 0); ->with($event, $service, 0);
$this->logger->expects($this->never())
->method('logException');
$this->context->for('myapp')->registerEventListener($event, $service); $this->context->for('myapp')->registerEventListener($event, $service);
$this->context->delegateEventListenerRegistrations($dispatcher); $this->context->delegateEventListenerRegistrations($dispatcher);
@ -98,8 +94,6 @@ class RegistrationContextTest extends TestCase {
$container->expects($this->once()) $container->expects($this->once())
->method('registerService') ->method('registerService')
->with($service, $factory, $shared); ->with($service, $factory, $shared);
$this->logger->expects($this->never())
->method('logException');
$this->context->for('myapp')->registerService($service, $factory, $shared); $this->context->for('myapp')->registerService($service, $factory, $shared);
$this->context->delegateContainerRegistrations([ $this->context->delegateContainerRegistrations([
@ -117,8 +111,6 @@ class RegistrationContextTest extends TestCase {
$container->expects($this->once()) $container->expects($this->once())
->method('registerAlias') ->method('registerAlias')
->with($alias, $target); ->with($alias, $target);
$this->logger->expects($this->never())
->method('logException');
$this->context->for('myapp')->registerServiceAlias($alias, $target); $this->context->for('myapp')->registerServiceAlias($alias, $target);
$this->context->delegateContainerRegistrations([ $this->context->delegateContainerRegistrations([
@ -136,8 +128,6 @@ class RegistrationContextTest extends TestCase {
$container->expects($this->once()) $container->expects($this->once())
->method('registerParameter') ->method('registerParameter')
->with($name, $value); ->with($name, $value);
$this->logger->expects($this->never())
->method('logException');
$this->context->for('myapp')->registerParameter($name, $value); $this->context->for('myapp')->registerParameter($name, $value);
$this->context->delegateContainerRegistrations([ $this->context->delegateContainerRegistrations([
@ -154,8 +144,6 @@ class RegistrationContextTest extends TestCase {
$container->expects($this->once()) $container->expects($this->once())
->method('registerMiddleware') ->method('registerMiddleware')
->with($name); ->with($name);
$this->logger->expects($this->never())
->method('logException');
$this->context->for('myapp')->registerMiddleware($name); $this->context->for('myapp')->registerMiddleware($name);
$this->context->delegateMiddlewareRegistrations([ $this->context->delegateMiddlewareRegistrations([

View File

@ -506,7 +506,7 @@ class SecurityMiddlewareTest extends \Test\TestCase {
->willReturn('http://localhost/nextcloud/index.php/login?redirect_url=nextcloud/index.php/apps/specialapp'); ->willReturn('http://localhost/nextcloud/index.php/login?redirect_url=nextcloud/index.php/apps/specialapp');
$this->logger $this->logger
->expects($this->once()) ->expects($this->once())
->method('logException'); ->method('debug');
$response = $this->middleware->afterException( $response = $this->middleware->afterException(
$this->controller, $this->controller,
'test', 'test',
@ -576,7 +576,7 @@ class SecurityMiddlewareTest extends \Test\TestCase {
$this->middleware = $this->getMiddleware(false, false, false); $this->middleware = $this->getMiddleware(false, false, false);
$this->logger $this->logger
->expects($this->once()) ->expects($this->once())
->method('logException'); ->method('debug');
$response = $this->middleware->afterException( $response = $this->middleware->afterException(
$this->controller, $this->controller,
'test', 'test',

View File

@ -149,7 +149,7 @@ class CapabilitiesManagerTest extends TestCase {
}); });
$this->logger->expects($this->once()) $this->logger->expects($this->once())
->method('logException'); ->method('error');
$res = $this->manager->getCapabilities(); $res = $this->manager->getCapabilities();

View File

@ -82,7 +82,7 @@ class ProviderManagerTest extends TestCase {
->willThrowException(new QueryException('A meaningful error message')); ->willThrowException(new QueryException('A meaningful error message'));
$this->logger->expects($this->once()) $this->logger->expects($this->once())
->method('logException'); ->method('error');
$this->providerManager->registerResourceProvider('InvalidResourceProvider'); $this->providerManager->registerResourceProvider('InvalidResourceProvider');
$resourceProviders = $this->providerManager->getResourceProviders(); $resourceProviders = $this->providerManager->getResourceProviders();
@ -101,7 +101,7 @@ class ProviderManagerTest extends TestCase {
->willReturn($this->createMock(ResourceProvider::class)); ->willReturn($this->createMock(ResourceProvider::class));
$this->logger->expects($this->once()) $this->logger->expects($this->once())
->method('logException'); ->method('error');
$this->providerManager->registerResourceProvider('InvalidResourceProvider'); $this->providerManager->registerResourceProvider('InvalidResourceProvider');
$this->providerManager->registerResourceProvider(ResourceProvider::class); $this->providerManager->registerResourceProvider(ResourceProvider::class);