diff --git a/tests/Channels/MailChannelTest.php b/tests/Channels/MailChannelTest.php index 4a31e76..443448b 100644 --- a/tests/Channels/MailChannelTest.php +++ b/tests/Channels/MailChannelTest.php @@ -15,14 +15,14 @@ */ use Guanguans\LaravelExceptionNotify\ExceptionNotifyManager; +use Guanguans\LaravelExceptionNotify\Exceptions\InvalidArgumentException; use Guanguans\LaravelExceptionNotify\Mail\ReportExceptionMail; use Illuminate\Support\Facades\Mail; it('will throw `InvalidArgumentException`', function (): void { - config()->set('exception-notify.channels.mail.extender', null); - + config()->set('exception-notify.channels.mail.extender'); $this->app->make(ExceptionNotifyManager::class)->driver('mail'); -})->group(__DIR__, __FILE__)->throws(\Guanguans\LaravelExceptionNotify\Exceptions\InvalidArgumentException::class); +})->group(__DIR__, __FILE__)->throws(InvalidArgumentException::class); it('will throw `TransportException`', function (): void { config()->set( diff --git a/tests/Channels/NotifyChannelTest.php b/tests/Channels/NotifyChannelTest.php index 36d9af0..8c7a3d5 100644 --- a/tests/Channels/NotifyChannelTest.php +++ b/tests/Channels/NotifyChannelTest.php @@ -16,6 +16,7 @@ use Guanguans\LaravelExceptionNotify\Channels\NotifyChannel; use Guanguans\LaravelExceptionNotify\ExceptionNotifyManager; +use Guanguans\LaravelExceptionNotify\Exceptions\InvalidArgumentException; use Illuminate\Config\Repository; use Psr\Http\Message\ResponseInterface; @@ -25,7 +26,7 @@ 'extender' => null, ], ])); -})->group(__DIR__, __FILE__)->throws(\Guanguans\LaravelExceptionNotify\Exceptions\InvalidArgumentException::class); +})->group(__DIR__, __FILE__)->throws(InvalidArgumentException::class); it('can report', function (): void { expect(app(ExceptionNotifyManager::class)->driver('bark')) diff --git a/tests/Pest.php b/tests/Pest.php index 9969ca6..3674c1d 100644 --- a/tests/Pest.php +++ b/tests/Pest.php @@ -16,8 +16,6 @@ * @see https://github.com/guanguans/laravel-exception-notify */ -namespace Tests; - use Guanguans\LaravelExceptionNotify\ExceptionNotifyManager; use Guanguans\LaravelExceptionNotify\Tests\TestCase; diff --git a/tests/Pipes/PipeTest.php b/tests/Pipes/PipeTest.php index 382436b..cb09785 100644 --- a/tests/Pipes/PipeTest.php +++ b/tests/Pipes/PipeTest.php @@ -17,6 +17,7 @@ use Guanguans\LaravelExceptionNotify\CollectorManager; use Guanguans\LaravelExceptionNotify\Contracts\Collector; use Guanguans\LaravelExceptionNotify\Contracts\ExceptionAware; +use Guanguans\LaravelExceptionNotify\Exceptions\RuntimeException; use Guanguans\LaravelExceptionNotify\Pipes\FixPrettyJsonPipe; use Illuminate\Pipeline\Pipeline; use Illuminate\Support\Collection; @@ -28,7 +29,7 @@ collect(app(CollectorManager::class)) ->transform(static function (Collector $collector): Collector { if ($collector instanceof ExceptionAware) { - $collector->setException(new \Guanguans\LaravelExceptionNotify\Exceptions\RuntimeException); + $collector->setException(new RuntimeException); } return $collector; diff --git a/tests/Support/ExceptionContextTest.php b/tests/Support/ExceptionContextTest.php index a7de238..472a86b 100644 --- a/tests/Support/ExceptionContextTest.php +++ b/tests/Support/ExceptionContextTest.php @@ -15,10 +15,11 @@ * @see https://github.com/guanguans/laravel-exception-notify */ +use Guanguans\LaravelExceptionNotify\Exceptions\RuntimeException; use Guanguans\LaravelExceptionNotify\Support\ExceptionContext; it('can get marked exception context', function (): void { - expect(ExceptionContext::getMarked(new \Guanguans\LaravelExceptionNotify\Exceptions\RuntimeException))->toBeArray(); + expect(ExceptionContext::getMarked(new RuntimeException))->toBeArray(); try { eval('throw new Exception("eval");');