Skip to content

Commit dcd0e57

Browse files
authored
Test Improvements (#1005)
fix following errors: ``` 1) Laravel\Octane\Tests\ApplicationFactoryTest::test_application_can_be_created * Test code or tested code did not remove its own error handlers * Test code or tested code did not remove its own exception handlers /home/runner/work/octane/octane/tests/ApplicationFactoryTest.php:9 ``` Signed-off-by: Mior Muhammad Zaki <[email protected]>
1 parent 7be271d commit dcd0e57

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/TestCase.php

+8
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use Carbon\Laravel\ServiceProvider as CarbonServiceProvider;
66
use Illuminate\Container\Container;
7+
use Illuminate\Foundation\Bootstrap\HandleExceptions;
78
use Illuminate\Support\Facades\Facade;
89
use Laravel\Octane\ApplicationFactory;
910
use Laravel\Octane\Contracts\Client;
@@ -17,6 +18,7 @@
1718
use Swoole\Table;
1819

1920
use function Orchestra\Testbench\default_skeleton_path;
21+
use function Orchestra\Testbench\laravel_version_compare;
2022

2123
class TestCase extends BaseTestCase
2224
{
@@ -76,6 +78,12 @@ protected function tearDown(): void
7678
{
7779
parent::tearDown();
7880

81+
if (laravel_version_compare('11.0', '>=')) {
82+
HandleExceptions::flushState();
83+
} else {
84+
HandleExceptions::forgetApp();
85+
}
86+
7987
Container::setInstance(null);
8088

8189
Facade::clearResolvedInstances();

0 commit comments

Comments
 (0)