Skip to content

Commit

Permalink
Merge pull request #182 from WyriHaximus/dummy-do-not-handle-throws-r…
Browse files Browse the repository at this point in the history
…untime-exception

Dummy do not handle throws runtime exception
  • Loading branch information
WyriHaximus committed Jul 17, 2022
2 parents e733dd1 + c1454d1 commit 3a1322a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Dummy/Listener.php
Expand Up @@ -4,7 +4,7 @@

namespace WyriHaximus\Broadcast\Dummy;

use Exception;
use RuntimeException;
use WyriHaximus\Broadcast\Contracts\DoNotHandle;
use WyriHaximus\Broadcast\Contracts\Listener as ListenerContract;

Expand All @@ -29,6 +29,6 @@ public function handle(Event $event): void
#[DoNotHandle]
public function doNotHandle(Event $event): void
{
throw new Exception('Should not be called');
throw new RuntimeException('Should not be called');
}
}
2 changes: 2 additions & 0 deletions tests/Dummy/ListenerTest.php
Expand Up @@ -4,6 +4,7 @@

namespace WyriHaximus\Tests\Broadcast\Dummy;

use RuntimeException;
use Throwable;
use WyriHaximus\Broadcast\Dummy\Event;
use WyriHaximus\Broadcast\Dummy\Listener;
Expand All @@ -17,6 +18,7 @@ final class ListenerTest extends TestCase
public function doNotHandle(): void
{
self::expectException(Throwable::class);
self::expectException(RuntimeException::class);
self::expectExceptionMessage('Should not be called');

(new Listener(static fn (): bool => false))->doNotHandle(new Event());
Expand Down

0 comments on commit 3a1322a

Please sign in to comment.