diff options
author | Julius Härtl <jus@bitgrid.net> | 2022-02-11 10:03:25 +0100 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2022-02-28 11:24:41 +0100 |
commit | 2dd96fe8da7a9479d6f98b34667d5d9e8ee2c1e2 (patch) | |
tree | e26a45db74b425cc4a72224845134271e5efb3da /tests | |
parent | eede608c0e9cd313bc672df1f0e37aca2a0ef2ad (diff) | |
download | nextcloud-server-2dd96fe8da7a9479d6f98b34667d5d9e8ee2c1e2.tar.gz nextcloud-server-2dd96fe8da7a9479d6f98b34667d5d9e8ee2c1e2.zip |
Fix tests
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/AppFramework/Http/DispatcherTest.php | 27 | ||||
-rw-r--r-- | tests/lib/Diagnostics/EventLoggerTest.php | 11 |
2 files changed, 29 insertions, 9 deletions
diff --git a/tests/lib/AppFramework/Http/DispatcherTest.php b/tests/lib/AppFramework/Http/DispatcherTest.php index 92b772dbe31..a76b78385e7 100644 --- a/tests/lib/AppFramework/Http/DispatcherTest.php +++ b/tests/lib/AppFramework/Http/DispatcherTest.php @@ -32,6 +32,7 @@ use OCP\AppFramework\Http; use OCP\AppFramework\Http\DataResponse; use OCP\AppFramework\Http\JSONResponse; use OCP\AppFramework\Http\Response; +use OCP\Diagnostics\IEventLogger; use OCP\IConfig; use OCP\IRequest; use PHPUnit\Framework\MockObject\MockObject; @@ -99,6 +100,10 @@ class DispatcherTest extends \Test\TestCase { private $config; /** @var LoggerInterface|MockObject */ private $logger; + /** + * @var IEventLogger|MockObject + */ + private $eventLogger; protected function setUp(): void { parent::setUp(); @@ -106,6 +111,7 @@ class DispatcherTest extends \Test\TestCase { $this->config = $this->createMock(IConfig::class); $this->logger = $this->createMock(LoggerInterface::class); + $this->eventLogger = $this->createMock(IEventLogger::class); $app = $this->getMockBuilder( 'OC\AppFramework\DependencyInjection\DIContainer') ->disableOriginalConstructor() @@ -143,7 +149,8 @@ class DispatcherTest extends \Test\TestCase { $this->request, $this->config, \OC::$server->getDatabaseConnection(), - $this->logger + $this->logger, + $this->eventLogger ); $this->response = $this->createMock(Response::class); @@ -321,7 +328,8 @@ class DispatcherTest extends \Test\TestCase { $this->request, $this->config, \OC::$server->getDatabaseConnection(), - $this->logger + $this->logger, + $this->eventLogger ); $controller = new TestController('app', $this->request); @@ -355,7 +363,8 @@ class DispatcherTest extends \Test\TestCase { $this->request, $this->config, \OC::$server->getDatabaseConnection(), - $this->logger + $this->logger, + $this->eventLogger ); $controller = new TestController('app', $this->request); @@ -392,7 +401,8 @@ class DispatcherTest extends \Test\TestCase { $this->request, $this->config, \OC::$server->getDatabaseConnection(), - $this->logger + $this->logger, + $this->eventLogger ); $controller = new TestController('app', $this->request); @@ -428,7 +438,8 @@ class DispatcherTest extends \Test\TestCase { $this->request, $this->config, \OC::$server->getDatabaseConnection(), - $this->logger + $this->logger, + $this->eventLogger ); $controller = new TestController('app', $this->request); @@ -465,7 +476,8 @@ class DispatcherTest extends \Test\TestCase { $this->request, $this->config, \OC::$server->getDatabaseConnection(), - $this->logger + $this->logger, + $this->eventLogger ); $controller = new TestController('app', $this->request); @@ -504,7 +516,8 @@ class DispatcherTest extends \Test\TestCase { $this->request, $this->config, \OC::$server->getDatabaseConnection(), - $this->logger + $this->logger, + $this->eventLogger ); $controller = new TestController('app', $this->request); diff --git a/tests/lib/Diagnostics/EventLoggerTest.php b/tests/lib/Diagnostics/EventLoggerTest.php index c26ca2ce202..4e24c24f225 100644 --- a/tests/lib/Diagnostics/EventLoggerTest.php +++ b/tests/lib/Diagnostics/EventLoggerTest.php @@ -21,18 +21,25 @@ namespace Test\Diagnostics; +use Psr\Log\LoggerInterface; use OC\Diagnostics\EventLogger; +use OC\Log; +use OC\SystemConfig; use Test\TestCase; class EventLoggerTest extends TestCase { /** @var \OC\Diagnostics\EventLogger */ private $logger; - + protected function setUp(): void { parent::setUp(); - $this->logger = new EventLogger(); + $this->logger = new EventLogger( + $this->createMock(SystemConfig::class), + $this->createMock(LoggerInterface::class), + $this->createMock(Log::class) + ); } public function testQueryLogger() { |