Skip to content

Commit 6abcf6c

Browse files
committed
test(ExceptionNotifyManagerTest): Add test for reporting exceptions
- Add a test case for reporting exceptions in ExceptionNotifyManagerTest - Create a mock Application instance - Set up the necessary expectations and configurations - Assert that reporting an exception returns null
1 parent 3bad179 commit 6abcf6c

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tests/ExceptionNotifyManagerTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,15 @@
4444
// $mockApplication->allows('make')->with('config')->andReturn(config());
4545
$mockApplication->allows('runningInConsole')->andReturnFalse();
4646

47+
/** @noinspection PhpVoidFunctionResultUsedInspection */
48+
expect(new ExceptionNotifyManager($mockApplication))
49+
->report(new Exception())->toBeNull();
50+
51+
config()->set('exception-notify.enabled', true);
52+
$mockApplication = Mockery::mock(Application::class);
53+
$mockApplication->allows('make')->with('config')->andReturn(config());
54+
// $mockApplication->allows('runningInConsole')->andReturnFalse();
55+
4756
/** @noinspection PhpVoidFunctionResultUsedInspection */
4857
expect(new ExceptionNotifyManager($mockApplication))
4958
->report(new Exception())->toBeNull();

0 commit comments

Comments
 (0)