diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2018-09-03 08:37:50 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2018-09-05 20:58:39 +0200 |
commit | ff58732c0d56a5269a31c132cd5bd0fe5b9ad3fa (patch) | |
tree | e2eaffa273423b047d9e4e66c12ae83244371d7f /tests/lib/Support | |
parent | 0899f2cbc43b05005dc045db001c41e199192f67 (diff) | |
download | nextcloud-server-ff58732c0d56a5269a31c132cd5bd0fe5b9ad3fa.tar.gz nextcloud-server-ff58732c0d56a5269a31c132cd5bd0fe5b9ad3fa.zip |
Add breadcrumb support to crash reporters
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'tests/lib/Support')
-rw-r--r-- | tests/lib/Support/CrashReport/RegistryTest.php | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/lib/Support/CrashReport/RegistryTest.php b/tests/lib/Support/CrashReport/RegistryTest.php index ba225ec1330..5cb15db7345 100644 --- a/tests/lib/Support/CrashReport/RegistryTest.php +++ b/tests/lib/Support/CrashReport/RegistryTest.php @@ -26,6 +26,7 @@ namespace Test\Support\CrashReport; use Exception; use OC\Support\CrashReport\Registry; +use OCP\Support\CrashReport\ICollectBreadcrumbs; use OCP\Support\CrashReport\IReporter; use Test\TestCase; @@ -50,6 +51,20 @@ class RegistryTest extends TestCase { $this->addToAssertionCount(1); } + public function testDelegateBreadcrumbCollection() { + $reporter1 = $this->createMock(IReporter::class); + $reporter2 = $this->createMock(ICollectBreadcrumbs::class); + $message = 'hello'; + $category = 'log'; + $reporter2->expects($this->once()) + ->method('collect') + ->with($message, $category); + + $this->registry->register($reporter1); + $this->registry->register($reporter2); + $this->registry->delegateBreadcrumb($message, $category); + } + public function testDelegateToAll() { $reporter1 = $this->createMock(IReporter::class); $reporter2 = $this->createMock(IReporter::class); |