summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2019-05-09 14:06:44 +0200
committerChristoph Wurst <christoph@winzerhof-wurst.at>2019-05-09 14:06:44 +0200
commitd3a244f9d9f3a90b7bd92a22210601c7f543441f (patch)
tree414cd462f3aa50801f0e7be515e73add464237d5 /tests
parent35b31110efce6799b1926c9485a246a1c60782dd (diff)
downloadnextcloud-server-d3a244f9d9f3a90b7bd92a22210601c7f543441f.tar.gz
nextcloud-server-d3a244f9d9f3a90b7bd92a22210601c7f543441f.zip
Allow crash reporters to catpture any message
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/Support/CrashReport/RegistryTest.php14
1 files changed, 14 insertions, 0 deletions
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);
+ }
+
}