diff --git a/config/flare.php b/config/flare.php index d4f90ea..1c3ad40 100644 --- a/config/flare.php +++ b/config/flare.php @@ -7,38 +7,38 @@ use Spatie\Ignition\Solutions\SolutionProviders\BadMethodCallSolutionProvider; use Spatie\Ignition\Solutions\SolutionProviders\MergeConflictSolutionProvider; use Spatie\Ignition\Solutions\SolutionProviders\UndefinedPropertySolutionProvider; -use Spatie\LaravelIgnition\FlareMiddleware\AddDumps; -use Spatie\LaravelIgnition\FlareMiddleware\AddEnvironmentInformation; -use Spatie\LaravelIgnition\FlareMiddleware\AddExceptionHandledStatus; -use Spatie\LaravelIgnition\FlareMiddleware\AddExceptionInformation; -use Spatie\LaravelIgnition\FlareMiddleware\AddJobs; -use Spatie\LaravelIgnition\FlareMiddleware\AddLogs; -use Spatie\LaravelIgnition\FlareMiddleware\AddQueries; -use Spatie\LaravelIgnition\FlareMiddleware\AddContext; -use Spatie\LaravelIgnition\FlareMiddleware\AddNotifierName; -use Spatie\LaravelIgnition\Recorders\DumpRecorder\DumpRecorder; -use Spatie\LaravelIgnition\Recorders\JobRecorder\JobRecorder; -use Spatie\LaravelIgnition\Recorders\LogRecorder\LogRecorder; -use Spatie\LaravelIgnition\Recorders\QueryRecorder\QueryRecorder; -use Spatie\LaravelIgnition\Solutions\SolutionProviders\DefaultDbNameSolutionProvider; -use Spatie\LaravelIgnition\Solutions\SolutionProviders\GenericLaravelExceptionSolutionProvider; -use Spatie\LaravelIgnition\Solutions\SolutionProviders\IncorrectValetDbCredentialsSolutionProvider; -use Spatie\LaravelIgnition\Solutions\SolutionProviders\InvalidRouteActionSolutionProvider; -use Spatie\LaravelIgnition\Solutions\SolutionProviders\MissingAppKeySolutionProvider; -use Spatie\LaravelIgnition\Solutions\SolutionProviders\MissingColumnSolutionProvider; -use Spatie\LaravelIgnition\Solutions\SolutionProviders\MissingImportSolutionProvider; -use Spatie\LaravelIgnition\Solutions\SolutionProviders\MissingLivewireComponentSolutionProvider; -use Spatie\LaravelIgnition\Solutions\SolutionProviders\MissingMixManifestSolutionProvider; -use Spatie\LaravelIgnition\Solutions\SolutionProviders\MissingViteManifestSolutionProvider; -use Spatie\LaravelIgnition\Solutions\SolutionProviders\OpenAiSolutionProvider; -use Spatie\LaravelIgnition\Solutions\SolutionProviders\RunningLaravelDuskInProductionProvider; -use Spatie\LaravelIgnition\Solutions\SolutionProviders\SailNetworkSolutionProvider; -use Spatie\LaravelIgnition\Solutions\SolutionProviders\TableNotFoundSolutionProvider; -use Spatie\LaravelIgnition\Solutions\SolutionProviders\UndefinedViewVariableSolutionProvider; -use Spatie\LaravelIgnition\Solutions\SolutionProviders\UnknownMariadbCollationSolutionProvider; -use Spatie\LaravelIgnition\Solutions\SolutionProviders\UnknownMysql8CollationSolutionProvider; -use Spatie\LaravelIgnition\Solutions\SolutionProviders\UnknownValidationSolutionProvider; -use Spatie\LaravelIgnition\Solutions\SolutionProviders\ViewNotFoundSolutionProvider; +use Spatie\LaravelFlare\FlareMiddleware\AddDumps; +use Spatie\LaravelFlare\FlareMiddleware\AddEnvironmentInformation; +use Spatie\LaravelFlare\FlareMiddleware\AddExceptionHandledStatus; +use Spatie\LaravelFlare\FlareMiddleware\AddExceptionInformation; +use Spatie\LaravelFlare\FlareMiddleware\AddJobs; +use Spatie\LaravelFlare\FlareMiddleware\AddLogs; +use Spatie\LaravelFlare\FlareMiddleware\AddQueries; +use Spatie\LaravelFlare\FlareMiddleware\AddContext; +use Spatie\LaravelFlare\FlareMiddleware\AddNotifierName; +use Spatie\LaravelFlare\Recorders\DumpRecorder\DumpRecorder; +use Spatie\LaravelFlare\Recorders\JobRecorder\JobRecorder; +use Spatie\LaravelFlare\Recorders\LogRecorder\LogRecorder; +use Spatie\LaravelFlare\Recorders\QueryRecorder\QueryRecorder; +use Spatie\LaravelFlare\Solutions\SolutionProviders\DefaultDbNameSolutionProvider; +use Spatie\LaravelFlare\Solutions\SolutionProviders\GenericLaravelExceptionSolutionProvider; +use Spatie\LaravelFlare\Solutions\SolutionProviders\IncorrectValetDbCredentialsSolutionProvider; +use Spatie\LaravelFlare\Solutions\SolutionProviders\InvalidRouteActionSolutionProvider; +use Spatie\LaravelFlare\Solutions\SolutionProviders\MissingAppKeySolutionProvider; +use Spatie\LaravelFlare\Solutions\SolutionProviders\MissingColumnSolutionProvider; +use Spatie\LaravelFlare\Solutions\SolutionProviders\MissingImportSolutionProvider; +use Spatie\LaravelFlare\Solutions\SolutionProviders\MissingLivewireComponentSolutionProvider; +use Spatie\LaravelFlare\Solutions\SolutionProviders\MissingMixManifestSolutionProvider; +use Spatie\LaravelFlare\Solutions\SolutionProviders\MissingViteManifestSolutionProvider; +use Spatie\LaravelFlare\Solutions\SolutionProviders\OpenAiSolutionProvider; +use Spatie\LaravelFlare\Solutions\SolutionProviders\RunningLaravelDuskInProductionProvider; +use Spatie\LaravelFlare\Solutions\SolutionProviders\SailNetworkSolutionProvider; +use Spatie\LaravelFlare\Solutions\SolutionProviders\TableNotFoundSolutionProvider; +use Spatie\LaravelFlare\Solutions\SolutionProviders\UndefinedViewVariableSolutionProvider; +use Spatie\LaravelFlare\Solutions\SolutionProviders\UnknownMariadbCollationSolutionProvider; +use Spatie\LaravelFlare\Solutions\SolutionProviders\UnknownMysql8CollationSolutionProvider; +use Spatie\LaravelFlare\Solutions\SolutionProviders\UnknownValidationSolutionProvider; +use Spatie\LaravelFlare\Solutions\SolutionProviders\ViewNotFoundSolutionProvider; return [ /* @@ -222,8 +222,8 @@ \Spatie\Backtrace\Arguments\Reducers\DateTimeArgumentReducer::class, \Spatie\Backtrace\Arguments\Reducers\DateTimeZoneArgumentReducer::class, \Spatie\Backtrace\Arguments\Reducers\SymphonyRequestArgumentReducer::class, - \Spatie\LaravelIgnition\ArgumentReducers\ModelArgumentReducer::class, - \Spatie\LaravelIgnition\ArgumentReducers\CollectionArgumentReducer::class, + \Spatie\LaravelFlare\ArgumentReducers\ModelArgumentReducer::class, + \Spatie\LaravelFlare\ArgumentReducers\CollectionArgumentReducer::class, \Spatie\Backtrace\Arguments\Reducers\StringableArgumentReducer::class, ], ]; diff --git a/src/Solutions/GenerateAppKeySolution.php b/src/Solutions/GenerateAppKeySolution.php index ebc5d51..1e224cb 100644 --- a/src/Solutions/GenerateAppKeySolution.php +++ b/src/Solutions/GenerateAppKeySolution.php @@ -22,6 +22,6 @@ public function getDocumentationLinks(): array public function getSolutionDescription(): string { - return ''; + return 'Generate your application encryption key using `php artisan key:generate`.'; } } diff --git a/tests/Arguments/ArgumentReducersTest.php b/tests/Arguments/ArgumentReducersTest.php index da21a5b..547877d 100644 --- a/tests/Arguments/ArgumentReducersTest.php +++ b/tests/Arguments/ArgumentReducersTest.php @@ -2,8 +2,8 @@ use Illuminate\Foundation\Auth\User; use Illuminate\Support\Collection; -use Spatie\LaravelIgnition\Facades\Flare; -use Spatie\LaravelIgnition\Tests\TestClasses\FakeArgumentsReducer; +use Spatie\LaravelFlare\Facades\Flare; +use Spatie\LaravelFlare\Tests\TestClasses\FakeArgumentsReducer; beforeEach(function () { ini_set('zend.exception_ignore_args', 0); // Enabled on GH actions @@ -54,7 +54,7 @@ function exceptionWithArgumentsDisabled(string $string) return new Exception('Whoops'); } - config()->set('ignition.with_stack_frame_arguments', false); + config()->set('flare.with_stack_frame_arguments', false); $report = Flare::createReport(exceptionWithArgumentsDisabled('Hello World')); @@ -67,7 +67,7 @@ function exceptionWithCustomArgumentReducer(string $string) return new Exception('Whoops'); } - config()->set('ignition.argument_reducers', [ + config()->set('flare.argument_reducers', [ FakeArgumentsReducer::class, ]); diff --git a/tests/Context/LaravelRequestContextProviderTest.php b/tests/Context/LaravelRequestContextProviderTest.php index 6bdcba1..8e71428 100644 --- a/tests/Context/LaravelRequestContextProviderTest.php +++ b/tests/Context/LaravelRequestContextProviderTest.php @@ -2,7 +2,7 @@ use Illuminate\Foundation\Auth\User; use Illuminate\Support\Facades\Route; -use Spatie\LaravelIgnition\ContextProviders\LaravelRequestContextProvider; +use Spatie\LaravelFlare\ContextProviders\LaravelRequestContextProvider; it('returns route name in context data', function () { $route = Route::get('/route/', fn () => null)->name('routeName'); diff --git a/tests/ContextProviders/LaravelLivewireRequestContextProviderTest.php b/tests/ContextProviders/LaravelLivewireRequestContextProviderTest.php index 5e0137f..6ec0a23 100644 --- a/tests/ContextProviders/LaravelLivewireRequestContextProviderTest.php +++ b/tests/ContextProviders/LaravelLivewireRequestContextProviderTest.php @@ -2,8 +2,8 @@ use Illuminate\Http\Request; use Illuminate\Support\Facades\Route; -use Spatie\LaravelIgnition\ContextProviders\LaravelLivewireRequestContextProvider; -use Spatie\LaravelIgnition\Tests\TestClasses\FakeLivewireManager; +use Spatie\LaravelFlare\ContextProviders\LaravelLivewireRequestContextProvider; +use Spatie\LaravelFlare\Tests\TestClasses\FakeLivewireManager; beforeEach(function () { $this->livewireManager = resolve(FakeLivewireManager::class); diff --git a/tests/ContextProviders/LegacyLivewireRequestContextProviderTest.php b/tests/ContextProviders/LegacyLivewireRequestContextProviderTest.php index 8c1c958..9133ef2 100644 --- a/tests/ContextProviders/LegacyLivewireRequestContextProviderTest.php +++ b/tests/ContextProviders/LegacyLivewireRequestContextProviderTest.php @@ -2,8 +2,8 @@ use Illuminate\Http\Request; use Illuminate\Support\Facades\Route; -use Spatie\LaravelIgnition\ContextProviders\LaravelLivewireRequestContextProvider; -use Spatie\LaravelIgnition\Tests\TestClasses\FakeLivewireManager; +use Spatie\LaravelFlare\ContextProviders\LaravelLivewireRequestContextProvider; +use Spatie\LaravelFlare\Tests\TestClasses\FakeLivewireManager; beforeEach(function () { $this->livewireManager = FakeLivewireManager::setUp(); diff --git a/tests/ExceptionSolutionTest.php b/tests/ExceptionSolutionTest.php index 84c37bf..3cb6045 100644 --- a/tests/ExceptionSolutionTest.php +++ b/tests/ExceptionSolutionTest.php @@ -4,9 +4,9 @@ use Spatie\Ignition\Contracts\BaseSolution; use Spatie\Ignition\Solutions\SolutionProviders\BadMethodCallSolutionProvider; use Spatie\Ignition\Solutions\SolutionProviders\SolutionProviderRepository; -use Spatie\LaravelIgnition\Solutions\SolutionProviders\MissingAppKeySolutionProvider; -use Spatie\LaravelIgnition\Tests\Exceptions\AlwaysFalseSolutionProvider; -use Spatie\LaravelIgnition\Tests\Exceptions\AlwaysTrueSolutionProvider; +use Spatie\LaravelFlare\Solutions\SolutionProviders\MissingAppKeySolutionProvider; +use Spatie\LaravelFlare\Tests\Exceptions\AlwaysFalseSolutionProvider; +use Spatie\LaravelFlare\Tests\Exceptions\AlwaysTrueSolutionProvider; it('returns possible solutions', function () { $repository = new SolutionProviderRepository(); @@ -76,5 +76,5 @@ $solution = new MissingAppKeySolutionProvider(); - expect($solution->getSolutions($exception)[0]->getSolutionActionDescription())->toBe('Generate your application encryption key using `php artisan key:generate`.'); + expect($solution->getSolutions($exception)[0]->getSolutionDescription())->toBe('Generate your application encryption key using `php artisan key:generate`.'); }); diff --git a/tests/Exceptions/AlwaysFalseSolutionProvider.php b/tests/Exceptions/AlwaysFalseSolutionProvider.php index 508f2b0..6a0c223 100644 --- a/tests/Exceptions/AlwaysFalseSolutionProvider.php +++ b/tests/Exceptions/AlwaysFalseSolutionProvider.php @@ -1,6 +1,6 @@ fakeClient->assertRequestsSent(1); }); diff --git a/tests/HelpersTest.php b/tests/HelpersTest.php deleted file mode 100644 index 5a49ca7..0000000 --- a/tests/HelpersTest.php +++ /dev/null @@ -1,5 +0,0 @@ -toBeTrue(); -}); diff --git a/tests/Http/Controllers/ExecuteSolutionControllerTest.php b/tests/Http/Controllers/ExecuteSolutionControllerTest.php deleted file mode 100644 index 89a7e91..0000000 --- a/tests/Http/Controllers/ExecuteSolutionControllerTest.php +++ /dev/null @@ -1,71 +0,0 @@ -set('app.debug', true); - config()->set('ignition.enable_runnable_solutions', true); - - $this - ->postJson(route('ignition.executeSolution'), solutionPayload()) - ->assertSuccessful(); -}); - -it('wont execute solutions on a production environment', function () { - app()['env'] = 'production'; - config()->set('app.debug', true); - - $this - ->postJson(route('ignition.executeSolution'), solutionPayload()) - ->assertStatus(404); -}); - -it('will execute solutions on a production environment if the IGNITION_ENABLE_RUNNABLE_SOLUTIONS env var is true and app.debug is true', function () { - app()['env'] = 'production'; - config()->set('app.debug', true); - config()->set('ignition.enable_runnable_solutions', true); - - $this - ->postJson(route('ignition.executeSolution'), solutionPayload()) - ->assertSuccessful(); -}); - -it('wont execute solutions on a production environment if the IGNITION_ENABLE_RUNNABLE_SOLUTIONS env var is true but app.debug is false', function () { - app()['env'] = 'production'; - config()->set('app.debug', false); - config()->set('ignition.enable_runnable_solutions', true); - - $this - ->postJson(route('ignition.executeSolution'), solutionPayload()) - ->assertStatus(404); -}); - -it('wont execute solutions when debugging is disabled', function () { - app()['env'] = 'local'; - config()->set('app.debug', false); - - $this - ->postJson(route('ignition.executeSolution'), solutionPayload()) - ->assertNotFound(); -}); - -it('wont execute solutions for a non local ip', function () { - app()['env'] = 'local'; - config()->set('app.debug', true); - $this->withServerVariables(['REMOTE_ADDR' => '138.197.187.74']); - - $this - ->postJson(route('ignition.executeSolution'), solutionPayload()) - ->assertForbidden(); -}); - - -function solutionPayload(): array -{ - return [ - 'parameters' => [ - 'variableName' => 'test', - 'viewFile' => 'resources/views/welcome.blade.php', - ], - 'solution' => 'Spatie\\LaravelIgnition\\Solutions\\MakeViewVariableOptionalSolution', - ]; -} diff --git a/tests/Http/Controllers/UpdateConfigControllerTest.php b/tests/Http/Controllers/UpdateConfigControllerTest.php deleted file mode 100644 index 49b68f5..0000000 --- a/tests/Http/Controllers/UpdateConfigControllerTest.php +++ /dev/null @@ -1,49 +0,0 @@ -instance(ConfigManager::class, createConfigManagerMock()); - - app()['env'] = 'local'; - config()->set('app.debug', true); - config()->set('ignition.enable_runnable_solutions', true); - - $this - ->postJson(route('ignition.updateConfig'), [ - 'theme' => 'auto', - 'editor' => 'fancy-editor', - 'hide_solutions' => true, - ]) - ->assertSuccessful(); - - $config = (new IgnitionConfig())->loadConfigFile(); - - expect($config) - ->theme()->toBe('auto') - ->editor()->toBe('fancy-editor') - ->hideSolutions()->toBeTrue(); -}); - -function createConfigManagerMock(): ConfigManager -{ - $mock = Mockery::mock(ConfigManager::class); - - $mock->shouldReceive('save') - ->once() - ->andReturn(true); - $mock->shouldReceive('load') - ->once() - ->andReturn([ - 'theme' => 'auto', - 'editor' => 'fancy-editor', - 'hide_solutions' => true, - ]); - - return $mock; -} diff --git a/tests/Http/Middleware/IgnitionEnabledTest.php b/tests/Http/Middleware/IgnitionEnabledTest.php deleted file mode 100644 index 6cf5d84..0000000 --- a/tests/Http/Middleware/IgnitionEnabledTest.php +++ /dev/null @@ -1,21 +0,0 @@ -set('app.debug', false); - - Route::get('middleware-test', fn () => 'success')->middleware([RunnableSolutionsEnabled::class]); - - $this->get('middleware-test')->assertStatus(404); -}); - -it('returns ok with debug mode enabled', function () { - config()->set('app.debug', true); - config()->set('ignition.enable_runnable_solutions', true); - - Route::get('middleware-test', fn () => 'success')->middleware([RunnableSolutionsEnabled::class]); - - $this->get('middleware-test')->assertStatus(200); -}); diff --git a/tests/LogRecorder/LogRecorderTest.php b/tests/LogRecorder/LogRecorderTest.php index d71e198..ebed39b 100644 --- a/tests/LogRecorder/LogRecorderTest.php +++ b/tests/LogRecorder/LogRecorderTest.php @@ -1,7 +1,7 @@ set('logging.channels.flare.driver', 'flare'); @@ -149,7 +149,7 @@ $this->fakeClient->assertRequestsSent(1); expect(app(SentReports::class)->all())->toHaveCount(1); - expect(\Spatie\LaravelIgnition\Facades\Flare::sentReports()->all())->toHaveCount(1); + expect(\Spatie\LaravelFlare\Facades\Flare::sentReports()->all())->toHaveCount(1); }); // Datasets diff --git a/tests/Mocks/FakeClient.php b/tests/Mocks/FakeClient.php index c1ec26f..8432d78 100644 --- a/tests/Mocks/FakeClient.php +++ b/tests/Mocks/FakeClient.php @@ -1,6 +1,6 @@ $this->getDumpHeader())->call(new HtmlDumper); diff --git a/tests/Recorders/JobRecorder/JobRecorderTest.php b/tests/Recorders/JobRecorder/JobRecorderTest.php index 9f0dce7..f0f6210 100644 --- a/tests/Recorders/JobRecorder/JobRecorderTest.php +++ b/tests/Recorders/JobRecorder/JobRecorderTest.php @@ -6,8 +6,8 @@ use Illuminate\Queue\Jobs\RedisJob; use Illuminate\Queue\RedisQueue; use Illuminate\Support\Facades\Event; -use Spatie\LaravelIgnition\Recorders\JobRecorder\JobRecorder; -use Spatie\LaravelIgnition\Tests\stubs\Jobs\QueueableJob; +use Spatie\LaravelFlare\Recorders\JobRecorder\JobRecorder; +use Spatie\LaravelFlare\Tests\stubs\Jobs\QueueableJob; it('can record a failed job', function () { $recorder = (new JobRecorder(app())); @@ -18,7 +18,7 @@ $recorded = $recorder->getJob(); - expect($recorded['name'])->toEqual('Spatie\LaravelIgnition\Tests\stubs\Jobs\QueueableJob'); + expect($recorded['name'])->toEqual('Spatie\LaravelFlare\Tests\stubs\Jobs\QueueableJob'); expect($recorded['connection'])->toEqual('sync'); expect($recorded['queue'])->toEqual('sync'); $this->assertNotEmpty($recorded['uuid']); @@ -141,7 +141,7 @@ expect($chained[1]['data']['property'])->toEqual(['level-two-b']); expect($chained = $chained[1]['data']['chained'])->toHaveCount(1); - expect($chained)->toEqual(['Ignition stopped recording jobs after this point since the max chain depth was reached']); + expect($chained)->toEqual(['Flare stopped recording jobs after this point since the max chain depth was reached']); }); it('can disable recording chained jobs', function () { @@ -159,7 +159,7 @@ $recorded = $recorder->getJob(); expect($chained = $recorded['data']['chained'])->toHaveCount(1); - expect($chained)->toEqual(['Ignition stopped recording jobs after this point since the max chain depth was reached']); + expect($chained)->toEqual(['Flare stopped recording jobs after this point since the max chain depth was reached']); }); it('can handle a job with an unserializeable payload', function () { diff --git a/tests/Solutions/InvalidRouteActionSolutionProviderTest.php b/tests/Solutions/InvalidRouteActionSolutionProviderTest.php index 4c607c0..26b6185 100644 --- a/tests/Solutions/InvalidRouteActionSolutionProviderTest.php +++ b/tests/Solutions/InvalidRouteActionSolutionProviderTest.php @@ -2,9 +2,9 @@ use Illuminate\Support\Facades\Route; use Illuminate\Support\Str; -use Spatie\LaravelIgnition\Solutions\SolutionProviders\InvalidRouteActionSolutionProvider; -use Spatie\LaravelIgnition\Support\Composer\ComposerClassMap; -use Spatie\LaravelIgnition\Tests\stubs\Controllers\TestTypoController; +use Spatie\LaravelFlare\Solutions\SolutionProviders\InvalidRouteActionSolutionProvider; +use Spatie\LaravelFlare\Support\Composer\ComposerClassMap; +use Spatie\LaravelFlare\Tests\stubs\Controllers\TestTypoController; beforeEach(function () { app()->bind( diff --git a/tests/Solutions/LazyLoadingViolationSolutionProviderTest.php b/tests/Solutions/LazyLoadingViolationSolutionProviderTest.php index ec4af20..5c4c160 100644 --- a/tests/Solutions/LazyLoadingViolationSolutionProviderTest.php +++ b/tests/Solutions/LazyLoadingViolationSolutionProviderTest.php @@ -2,7 +2,7 @@ use Illuminate\Database\LazyLoadingViolationException; use Illuminate\Foundation\Auth\User; -use Spatie\LaravelIgnition\Solutions\SolutionProviders\LazyLoadingViolationSolutionProvider; +use Spatie\LaravelFlare\Solutions\SolutionProviders\LazyLoadingViolationSolutionProvider; it('can solve lazy loading violations', function () { $canSolve = app(LazyLoadingViolationSolutionProvider::class) diff --git a/tests/Solutions/MakeViewVariableOptionalSolutionTest.php b/tests/Solutions/MakeViewVariableOptionalSolutionTest.php index 195ae02..53fb716 100644 --- a/tests/Solutions/MakeViewVariableOptionalSolutionTest.php +++ b/tests/Solutions/MakeViewVariableOptionalSolutionTest.php @@ -1,10 +1,10 @@ bind( @@ -13,25 +13,9 @@ function () { return new ComposerClassMap(__DIR__.'/../../vendor/autoload.php'); } ); -}); -it('does not open scheme paths', function () { - $solution = getSolutionForPath('php://filter/resource=./tests/stubs/views/blade-exception.blade.php'); - expect($solution->isRunnable())->toBeFalse(); -}); + $solution = new MakeViewVariableOptionalSolution('notSet', 'php://filter/resource=./tests/stubs/views/blade-exception.blade.php'); -it('does open relative paths', function () { - $solution = getSolutionForPath('./tests/stubs/views/blade-exception.blade.php'); - expect($solution->isRunnable())->toBeTrue(); + expect($solution)->toBeInstanceOf(MakeViewVariableOptionalSolution::class); + expect($solution->getSolutionTitle())->toEqual('$notSet is undefined'); }); - -it('does not open other extensions', function () { - $solution = getSolutionForPath('./tests/stubs/views/php-exception.php'); - expect($solution->isRunnable())->toBeFalse(); -}); - -// Helpers -function getSolutionForPath($path): MakeViewVariableOptionalSolution -{ - return new MakeViewVariableOptionalSolution('notSet', $path); -} diff --git a/tests/Solutions/MergeConflictSolutionProviderTest.php b/tests/Solutions/MergeConflictSolutionProviderTest.php index fb5a8a8..72f6049 100644 --- a/tests/Solutions/MergeConflictSolutionProviderTest.php +++ b/tests/Solutions/MergeConflictSolutionProviderTest.php @@ -2,7 +2,7 @@ use Illuminate\Support\Facades\View; use Spatie\Ignition\Solutions\SolutionProviders\MergeConflictSolutionProvider; -use Spatie\LaravelIgnition\Tests\stubs\Controllers\GitConflictController; +use Spatie\LaravelFlare\Tests\stubs\Controllers\GitConflictController; beforeEach(function () { View::addLocation(__DIR__.'/../stubs/views'); diff --git a/tests/Solutions/MixManifestNotFoundSolutionProviderTest.php b/tests/Solutions/MixManifestNotFoundSolutionProviderTest.php index e1edc92..87301a4 100644 --- a/tests/Solutions/MixManifestNotFoundSolutionProviderTest.php +++ b/tests/Solutions/MixManifestNotFoundSolutionProviderTest.php @@ -2,7 +2,7 @@ use Illuminate\Support\Str; -use Spatie\LaravelIgnition\Solutions\SolutionProviders\MissingMixManifestSolutionProvider; +use Spatie\LaravelFlare\Solutions\SolutionProviders\MissingMixManifestSolutionProvider; it('can solve a missing mix manifest exception', function () { $canSolve = app(MissingMixManifestSolutionProvider::class) diff --git a/tests/Solutions/RouteNotDefinedSolutionProviderTest.php b/tests/Solutions/RouteNotDefinedSolutionProviderTest.php index c180c1b..b9938f3 100644 --- a/tests/Solutions/RouteNotDefinedSolutionProviderTest.php +++ b/tests/Solutions/RouteNotDefinedSolutionProviderTest.php @@ -2,7 +2,7 @@ use Illuminate\Support\Facades\Route; use Illuminate\Support\Str; -use Spatie\LaravelIgnition\Solutions\SolutionProviders\RouteNotDefinedSolutionProvider; +use Spatie\LaravelFlare\Solutions\SolutionProviders\RouteNotDefinedSolutionProvider; use Symfony\Component\Routing\Exception\RouteNotFoundException; it('can solve a route not defined exception', function () { diff --git a/tests/Solutions/RunningLaravelDuskInProductionSolutionProviderTest.php b/tests/Solutions/RunningLaravelDuskInProductionSolutionProviderTest.php index acf0196..53f132b 100644 --- a/tests/Solutions/RunningLaravelDuskInProductionSolutionProviderTest.php +++ b/tests/Solutions/RunningLaravelDuskInProductionSolutionProviderTest.php @@ -1,6 +1,6 @@ addAlias('test-livewire-component', TestLivewireComponent::class); @@ -15,6 +15,6 @@ expect($canSolve)->toBeTrue(); - expect($solution->getSolutionTitle())->toBe('Possible typo `Spatie\LaravelIgnition\Tests\stubs\Components\TestLivewireComponent::chnge`'); - expect($solution->getSolutionDescription())->toBe('Did you mean `Spatie\LaravelIgnition\Tests\stubs\Components\TestLivewireComponent::change`?'); + expect($solution->getSolutionTitle())->toBe('Possible typo `Spatie\LaravelFlare\Tests\stubs\Components\TestLivewireComponent::chnge`'); + expect($solution->getSolutionDescription())->toBe('Did you mean `Spatie\LaravelFlare\Tests\stubs\Components\TestLivewireComponent::change`?'); })->skip(LIVEWIRE_VERSION_3, 'Missing Livewire 3 support.'); diff --git a/tests/Solutions/SolutionProviders/UndefinedLivewirePropertySolutionProviderTest.php b/tests/Solutions/SolutionProviders/UndefinedLivewirePropertySolutionProviderTest.php index c6254f4..cc2a6e4 100644 --- a/tests/Solutions/SolutionProviders/UndefinedLivewirePropertySolutionProviderTest.php +++ b/tests/Solutions/SolutionProviders/UndefinedLivewirePropertySolutionProviderTest.php @@ -1,9 +1,9 @@ addAlias('test-livewire-component', TestLivewireComponent::class); diff --git a/tests/Solutions/SolutionProviders/UnknownMariadbCollationSolutionProviderTest.php b/tests/Solutions/SolutionProviders/UnknownMariadbCollationSolutionProviderTest.php index 2bafd72..f36b251 100644 --- a/tests/Solutions/SolutionProviders/UnknownMariadbCollationSolutionProviderTest.php +++ b/tests/Solutions/SolutionProviders/UnknownMariadbCollationSolutionProviderTest.php @@ -1,7 +1,7 @@ getSolutions(getUndefinedPropertyException())[0]; - expect($solution->getSolutionDescription())->toEqual('Did you mean Spatie\LaravelIgnition\Tests\Support\Models\Car::$color ?'); + expect($solution->getSolutionDescription())->toEqual('Did you mean Spatie\LaravelFlare\Tests\Support\Models\Car::$color ?'); }); it('cannot recommend a property name when there is no similar property', function () { @@ -31,5 +31,5 @@ // Helpers function getUndefinedPropertyException(string $property = 'colro'): ErrorException { - return new ErrorException("Undefined property: Spatie\LaravelIgnition\Tests\Support\Models\Car::$$property "); + return new ErrorException("Undefined property: Spatie\LaravelFlare\Tests\Support\Models\Car::$$property "); } diff --git a/tests/Solutions/UnknownValidationSolutionProviderTest.php b/tests/Solutions/UnknownValidationSolutionProviderTest.php index 3558edc..9ea3a1c 100644 --- a/tests/Solutions/UnknownValidationSolutionProviderTest.php +++ b/tests/Solutions/UnknownValidationSolutionProviderTest.php @@ -1,7 +1,7 @@ canSolve(getBadMethodCallException()); diff --git a/tests/Solutions/ViewNotFoundSolutionProviderTest.php b/tests/Solutions/ViewNotFoundSolutionProviderTest.php index 7e76050..6468848 100644 --- a/tests/Solutions/ViewNotFoundSolutionProviderTest.php +++ b/tests/Solutions/ViewNotFoundSolutionProviderTest.php @@ -2,7 +2,7 @@ use Illuminate\Support\Facades\View; use Illuminate\Support\Str; -use Spatie\LaravelIgnition\Solutions\SolutionProviders\ViewNotFoundSolutionProvider; +use Spatie\LaravelFlare\Solutions\SolutionProviders\ViewNotFoundSolutionProvider; beforeEach(function () { View::addLocation(__DIR__.'/../stubs/views'); diff --git a/tests/Solutions/ViteManifestNotFoundSolutionProviderTest.php b/tests/Solutions/ViteManifestNotFoundSolutionProviderTest.php index 4ce0535..854b4f1 100644 --- a/tests/Solutions/ViteManifestNotFoundSolutionProviderTest.php +++ b/tests/Solutions/ViteManifestNotFoundSolutionProviderTest.php @@ -1,7 +1,7 @@ finder = new LaravelDocumentationLinkFinder(); diff --git a/tests/Support/Models/Car.php b/tests/Support/Models/Car.php index f81128c..1e70b44 100644 --- a/tests/Support/Models/Car.php +++ b/tests/Support/Models/Car.php @@ -1,6 +1,6 @@ sentReports = new SentReports(); diff --git a/tests/TestCase.php b/tests/TestCase.php index 4a6ba87..cad38ed 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -1,14 +1,15 @@ set('flare.key', 'dummy-key'); - return [IgnitionServiceProvider::class]; + return [FlareServiceProvider::class]; } protected function getPackageAliases($app) diff --git a/tests/TestClasses/ExceptionWithSolution.php b/tests/TestClasses/ExceptionWithSolution.php index 1443421..9b0422c 100644 --- a/tests/TestClasses/ExceptionWithSolution.php +++ b/tests/TestClasses/ExceptionWithSolution.php @@ -1,6 +1,6 @@ set('app.debug', true); - - Route::view('blade-exception', 'blade-exception'); - Route::view('php-exception', 'php-exception'); - Route::view('blade-exception-utf8', 'blade-exception-utf8'); - Route::view('solution-exception', 'solution-exception'); -}); - -it('renders a view exception wrapper instead of the original blade exception', function () { - $this->get('/blade-exception') - ->assertSee('Spatie\LaravelIgnition\Exceptions\ViewException'); -}); - -it('renders the original line number in view exceptions', function () { - $this->get('/blade-exception') - ->assertSee('on line 3'); -}); - -it('renders the original line number in view exceptions with utf8 characters', function () { - $this->get('/blade-exception-utf8') - ->assertSee('on line 11'); -}); - -it('renders the base exception solutions', function () { - $this->get('/solution-exception') - ->assertSee('This is a solution'); -}); - -it('does not render a view exception wrapper instead of the original php exception', function () { - $this->get('/php-exception') - ->assertSee('Error: Call to undefined function somethingBadHappens()'); -}); diff --git a/tests/stubs/Components/TestLivewireComponent.php b/tests/stubs/Components/TestLivewireComponent.php index 98ff76d..a259254 100644 --- a/tests/stubs/Components/TestLivewireComponent.php +++ b/tests/stubs/Components/TestLivewireComponent.php @@ -1,6 +1,6 @@ This is a blade view with a solution @php -use Spatie\LaravelIgnition\Tests\TestClasses\ExceptionWithSolution; +use Spatie\LaravelFlare\Tests\TestClasses\ExceptionWithSolution; $exception ??= new ExceptionWithSolution;