From d3a244f9d9f3a90b7bd92a22210601c7f543441f Mon Sep 17 00:00:00 2001 From: Christoph Wurst Date: Thu, 9 May 2019 14:06:44 +0200 Subject: Allow crash reporters to catpture any message Signed-off-by: Christoph Wurst --- tests/lib/Support/CrashReport/RegistryTest.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'tests/lib') diff --git a/tests/lib/Support/CrashReport/RegistryTest.php b/tests/lib/Support/CrashReport/RegistryTest.php index 5cb15db7345..be769e257fc 100644 --- a/tests/lib/Support/CrashReport/RegistryTest.php +++ b/tests/lib/Support/CrashReport/RegistryTest.php @@ -27,6 +27,7 @@ namespace Test\Support\CrashReport; use Exception; use OC\Support\CrashReport\Registry; use OCP\Support\CrashReport\ICollectBreadcrumbs; +use OCP\Support\CrashReport\IMessageReporter; use OCP\Support\CrashReport\IReporter; use Test\TestCase; @@ -81,4 +82,17 @@ class RegistryTest extends TestCase { $this->registry->delegateReport($exception); } + public function testDelegateMessage() { + $reporter1 = $this->createMock(IReporter::class); + $reporter2 = $this->createMock(IMessageReporter::class); + $message = 'hello'; + $reporter2->expects($this->once()) + ->method('reportMessage') + ->with($message, []); + + $this->registry->register($reporter1); + $this->registry->register($reporter2); + $this->registry->delegateMessage($message); + } + } -- cgit v1.2.3