diff --git a/src/Eloquent/PendingTestCast.php b/src/Eloquent/PendingTestCast.php index 3527430..02a98db 100644 --- a/src/Eloquent/PendingTestCast.php +++ b/src/Eloquent/PendingTestCast.php @@ -5,6 +5,7 @@ use Illuminate\Database\Eloquent\Model; use Illuminate\Support\Traits\ForwardsCalls; use PHPUnit\Framework\Assert as PHPUnit; + use function is_array; class PendingTestCast diff --git a/src/Http/Middleware/InteractsWithMiddleware.php b/src/Http/Middleware/InteractsWithMiddleware.php index 21c5fad..03d8908 100644 --- a/src/Http/Middleware/InteractsWithMiddleware.php +++ b/src/Http/Middleware/InteractsWithMiddleware.php @@ -3,6 +3,7 @@ namespace Laragear\MetaTesting\Http\Middleware; use Illuminate\Http\Response; + use function implode; trait InteractsWithMiddleware diff --git a/src/Http/Middleware/PendingTestMiddleware.php b/src/Http/Middleware/PendingTestMiddleware.php index c0e8573..4317821 100644 --- a/src/Http/Middleware/PendingTestMiddleware.php +++ b/src/Http/Middleware/PendingTestMiddleware.php @@ -7,6 +7,7 @@ use Illuminate\Support\Str; use Illuminate\Support\Traits\ForwardsCalls; use Orchestra\Testbench\TestCase; + use function array_merge; use function array_push; use function array_unique; diff --git a/src/Http/Requests/InteractsWithFormRequests.php b/src/Http/Requests/InteractsWithFormRequests.php index 3b2d561..364bb0c 100644 --- a/src/Http/Requests/InteractsWithFormRequests.php +++ b/src/Http/Requests/InteractsWithFormRequests.php @@ -10,6 +10,7 @@ trait InteractsWithFormRequests * Assert a pending form request with data. * * @template TForm of \Illuminate\Foundation\Http\FormRequest + * * @param class-string $formRequest * @param array $input * @param array $request diff --git a/src/Http/Requests/PendingTestFormRequest.php b/src/Http/Requests/PendingTestFormRequest.php index 051941e..a33941a 100644 --- a/src/Http/Requests/PendingTestFormRequest.php +++ b/src/Http/Requests/PendingTestFormRequest.php @@ -8,6 +8,7 @@ use Illuminate\Validation\ValidationException; use Orchestra\Testbench\TestCase; use PHPUnit\Framework\Assert as PHPUnit; + use function get_class; /** diff --git a/src/InteractsWithServiceProvider.php b/src/InteractsWithServiceProvider.php index 977665e..38f61ed 100644 --- a/src/InteractsWithServiceProvider.php +++ b/src/InteractsWithServiceProvider.php @@ -18,6 +18,7 @@ use ReflectionException; use ReflectionMethod; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; + use function implode; use function is_array; use function now; @@ -354,7 +355,7 @@ protected function assertGateHasPolicy(string $model, string ...$abilities): voi } static::assertThat( - $method->isPublic() && !$method->isStatic(), + $method->isPublic() && ! $method->isStatic(), static::isTrue(), "The '$ability' ability declared in '$target' is private/protected or static.", ); diff --git a/src/InteractsWithServices.php b/src/InteractsWithServices.php index 7648dc6..3fd8d5b 100644 --- a/src/InteractsWithServices.php +++ b/src/InteractsWithServices.php @@ -5,6 +5,7 @@ use Closure; use LogicException; use Mockery\MockInterface; + use function tap; /** diff --git a/src/Validation/InteractsWithValidator.php b/src/Validation/InteractsWithValidator.php index 01647bf..3efdcfc 100644 --- a/src/Validation/InteractsWithValidator.php +++ b/src/Validation/InteractsWithValidator.php @@ -10,7 +10,7 @@ trait InteractsWithValidator { /** - * Runs the validation name with data and rules + * Runs the validation name with data and rules. * * @internal */ diff --git a/tests/Eloquent/InteractsWithCastTest.php b/tests/Eloquent/InteractsWithCastTest.php index b532e43..0714794 100644 --- a/tests/Eloquent/InteractsWithCastTest.php +++ b/tests/Eloquent/InteractsWithCastTest.php @@ -6,6 +6,7 @@ use Laragear\MetaTesting\Eloquent\InteractsWithCast; use Orchestra\Testbench\TestCase; use PHPUnit\Framework\AssertionFailedError; + use function strtoupper; class InteractsWithCastTest extends TestCase @@ -75,7 +76,6 @@ public function test_with_raw_attributes(): void } } - class TestCastsAttributes implements CastsAttributes { public function get($model, string $key, $value, array $attributes) diff --git a/tests/Http/Middleware/InteractsWithMiddlewareTest.php b/tests/Http/Middleware/InteractsWithMiddlewareTest.php index 1c956fa..1aa7861 100644 --- a/tests/Http/Middleware/InteractsWithMiddlewareTest.php +++ b/tests/Http/Middleware/InteractsWithMiddlewareTest.php @@ -66,7 +66,7 @@ public function test_adds_web_group_middleware(): void public function test_uses_controller(): void { $this->middleware(TestMiddleware::class) - ->using(fn() => 'foo') + ->using(fn () => 'foo') ->get('test') ->assertSee('foo'); } @@ -85,7 +85,6 @@ public function test_proxies_test_case_method(): void } } - class TestMiddleware { public function handle(Request $request, $next, $argument = null) diff --git a/tests/Http/Requests/InteractsWithFormRequestsTest.php b/tests/Http/Requests/InteractsWithFormRequestsTest.php index 6af2193..0ad5be6 100644 --- a/tests/Http/Requests/InteractsWithFormRequestsTest.php +++ b/tests/Http/Requests/InteractsWithFormRequestsTest.php @@ -164,4 +164,3 @@ public function passedValidation(): void $this->request->set('baz', 'quz'); } } - diff --git a/tests/InteractsWithServiceProviderTest.php b/tests/InteractsWithServiceProviderTest.php index 9308543..8b9a9f6 100644 --- a/tests/InteractsWithServiceProviderTest.php +++ b/tests/InteractsWithServiceProviderTest.php @@ -29,6 +29,7 @@ use Mockery; use PHPUnit\Framework\AssertionFailedError; use Symfony\Component\Finder\SplFileInfo; + use function is_callable; use function is_string; use function now; @@ -41,22 +42,24 @@ class InteractsWithServiceProviderTest extends TestCase public function test_assert_has_driver(): void { - $this->app->instance('manager', new class($this->app) extends Manager { + $this->app->instance('manager', new class($this->app) extends Manager + { public function getDefaultDriver() { return 'foo'; } }); - $this->app->register(new class($this->app) extends ServiceProvider { + $this->app->register(new class($this->app) extends ServiceProvider + { use BootHelpers; public function boot(): void { $this->app->make('config')->set('auth.guards.foo', ['driver' => 'session', 'provider' => 'users']); - $this->withDriver('auth', 'foo', fn() => 'bar'); - $this->withDriver('manager', 'baz', fn() => 'quz'); + $this->withDriver('auth', 'foo', fn () => 'bar'); + $this->withDriver('manager', 'baz', fn () => 'quz'); } }); @@ -66,22 +69,24 @@ public function boot(): void public function test_assert_has_driver_with_class(): void { - $this->app->instance('manager', new class($this->app) extends Manager { + $this->app->instance('manager', new class($this->app) extends Manager + { public function getDefaultDriver() { return 'foo'; } }); - $this->app->register(new class($this->app) extends ServiceProvider { + $this->app->register(new class($this->app) extends ServiceProvider + { use BootHelpers; public function boot(): void { $this->app->make('config')->set('auth.guards.foo', ['driver' => 'session', 'provider' => 'users']); - $this->withDriver('auth', 'foo', fn() => 'bar'); - $this->withDriver('manager', 'baz', fn() => new Fluent()); + $this->withDriver('auth', 'foo', fn () => 'bar'); + $this->withDriver('manager', 'baz', fn () => new Fluent()); } }); @@ -130,7 +135,7 @@ public function test_assert_singletons(): void public function test_assert_singletons_fails_if_not_singleton(): void { - $this->app->bind('foo', fn() => 'bar'); + $this->app->bind('foo', fn () => 'bar'); $this->expectException(AssertionFailedError::class); $this->expectExceptionMessage("The 'foo' is registered as a shared instance in the Service Container."); @@ -188,7 +193,8 @@ public function test_assert_merged_config_fails_if_not_same(): void public function test_assert_publishes(): void { - $this->app->register(new class($this->app) extends ServiceProvider { + $this->app->register(new class($this->app) extends ServiceProvider + { public function boot(): void { $this->publishes(['foo' => 'bar'], 'quz'); @@ -200,7 +206,8 @@ public function boot(): void public function test_assert_publishes_fails_if_tag_doesnt_exists(): void { - $this->app->register(new class($this->app) extends ServiceProvider { + $this->app->register(new class($this->app) extends ServiceProvider + { public function boot(): void { $this->publishes(['foo' => 'bar'], 'quz'); @@ -215,7 +222,8 @@ public function boot(): void public function test_assert_publishes_fails_if_file_doesnt_exists_in_tag(): void { - $this->app->register(new class($this->app) extends ServiceProvider { + $this->app->register(new class($this->app) extends ServiceProvider + { public function boot(): void { $this->publishes(['foo' => 'bar'], 'quz'); @@ -244,7 +252,8 @@ public function test_assert_publishes_migration(): void File::expects('files')->twice()->with('/package/vendor/migrations')->andReturn([$foo, $bar]); - $this->app->register(new class($this->app) extends ServiceProvider { + $this->app->register(new class($this->app) extends ServiceProvider + { use PublishesMigrations; public function boot(): void @@ -264,7 +273,8 @@ public function test_assert_publishes_migration_with_different_tag(): void File::expects('files')->twice()->with('/package/vendor/migrations')->andReturn([$foo]); - $this->app->register(new class($this->app) extends ServiceProvider { + $this->app->register(new class($this->app) extends ServiceProvider + { use PublishesMigrations; public function boot(): void @@ -285,7 +295,8 @@ public function test_assert_published_migration_fails(): void File::expects('files')->once()->with('/package/vendor/migrations')->andReturn([$foo]); File::expects('files')->once()->with('/invalid')->andReturn([]); - $this->app->register(new class($this->app) extends ServiceProvider { + $this->app->register(new class($this->app) extends ServiceProvider + { use PublishesMigrations; public function boot(): void @@ -304,7 +315,8 @@ public function test_assert_publishes_migration_fails_if_tag_not_same(): void { File::partialMock()->expects('files')->once()->with('/package/vendor/migrations')->andReturn([]); - $this->app->register(new class($this->app) extends ServiceProvider { + $this->app->register(new class($this->app) extends ServiceProvider + { use PublishesMigrations; public function boot(): void @@ -321,7 +333,8 @@ public function boot(): void public function test_assert_translations(): void { - $this->app->register(new class($this->app) extends ServiceProvider { + $this->app->register(new class($this->app) extends ServiceProvider + { public function boot(): void { $this->loadTranslationsFrom('foo', 'bar'); @@ -333,7 +346,8 @@ public function boot(): void public function test_assert_translations_fails_if_namespace_doesnt_exists(): void { - $this->app->register(new class($this->app) extends ServiceProvider { + $this->app->register(new class($this->app) extends ServiceProvider + { public function boot(): void { $this->loadTranslationsFrom('foo', 'bar'); @@ -348,7 +362,8 @@ public function boot(): void public function test_assert_translations_fails_if_file_doesnt_exists_in_namespace(): void { - $this->app->register(new class($this->app) extends ServiceProvider { + $this->app->register(new class($this->app) extends ServiceProvider + { public function boot(): void { $this->loadTranslationsFrom('foo', 'bar'); @@ -363,7 +378,8 @@ public function boot(): void public function test_assert_views(): void { - $this->app->register(new class($this->app) extends ServiceProvider { + $this->app->register(new class($this->app) extends ServiceProvider + { public function boot(): void { $this->loadViewsFrom('foo', 'bar'); @@ -375,7 +391,8 @@ public function boot(): void public function test_assert_views_fails_if_namespace_doesnt_exists(): void { - $this->app->register(new class($this->app) extends ServiceProvider { + $this->app->register(new class($this->app) extends ServiceProvider + { public function boot(): void { $this->loadViewsFrom('foo', 'bar'); @@ -390,7 +407,8 @@ public function boot(): void public function test_assert_views_fails_if_file_doesnt_exist_in_namespace(): void { - $this->app->register(new class($this->app) extends ServiceProvider { + $this->app->register(new class($this->app) extends ServiceProvider + { public function boot(): void { $this->loadViewsFrom('foo', 'bar'); @@ -405,7 +423,8 @@ public function boot(): void public function test_assert_blade_component(): void { - $this->app->register(new class($this->app) extends ServiceProvider { + $this->app->register(new class($this->app) extends ServiceProvider + { public function boot(): void { $this->loadViewComponentsAs('foo', [ @@ -421,7 +440,8 @@ public function boot(): void public function test_assert_blade_component_fails_if_alias_doesnt_exists(): void { - $this->app->register(new class($this->app) extends ServiceProvider { + $this->app->register(new class($this->app) extends ServiceProvider + { public function boot(): void { $this->loadViewComponentsAs('foo', [ @@ -439,7 +459,8 @@ public function boot(): void public function test_assert_blade_component_fails_if_component_doesnt_exists_in_alias(): void { - $this->app->register(new class($this->app) extends ServiceProvider { + $this->app->register(new class($this->app) extends ServiceProvider + { public function boot(): void { $this->loadViewComponentsAs('foo', [ @@ -457,10 +478,11 @@ public function boot(): void public function test_assert_blade_directive(): void { - $this->app->register(new class($this->app) extends ServiceProvider { + $this->app->register(new class($this->app) extends ServiceProvider + { public function boot(): void { - Blade::directive('foo', static fn() => 'bar'); + Blade::directive('foo', static fn () => 'bar'); } }); @@ -469,10 +491,11 @@ public function boot(): void public function test_assert_blade_directives_fail_if_doesnt_exist(): void { - $this->app->register(new class($this->app) extends ServiceProvider { + $this->app->register(new class($this->app) extends ServiceProvider + { public function boot(): void { - Blade::directive('foo', static fn() => 'bar'); + Blade::directive('foo', static fn () => 'bar'); } }); @@ -484,7 +507,8 @@ public function boot(): void public function test_assert_validation_rules(): void { - $this->app->register(new class($this->app) extends ServiceProvider { + $this->app->register(new class($this->app) extends ServiceProvider + { public function boot(): void { Validator::extend('foo', 'bar'); @@ -496,7 +520,8 @@ public function boot(): void public function test_assert_validation_rules_fail_if_doesnt_exist(): void { - $this->app->register(new class($this->app) extends ServiceProvider { + $this->app->register(new class($this->app) extends ServiceProvider + { public function boot(): void { Validator::extend('foo', 'bar'); @@ -511,10 +536,11 @@ public function boot(): void public function test_assert_route_by_name(): void { - $this->app->register(new class($this->app) extends ServiceProvider { + $this->app->register(new class($this->app) extends ServiceProvider + { public function boot(): void { - Route::name('exists')->get('test', fn() => true); + Route::name('exists')->get('test', fn () => true); } }); @@ -523,10 +549,11 @@ public function boot(): void public function test_assert_route_by_name_fails_if_does_not_exists(): void { - $this->app->register(new class($this->app) extends ServiceProvider { + $this->app->register(new class($this->app) extends ServiceProvider + { public function boot(): void { - Route::name('exists')->get('test', fn() => true); + Route::name('exists')->get('test', fn () => true); } }); @@ -538,11 +565,12 @@ public function boot(): void public function test_assert_route_by_uri(): void { - $this->app->register(new class($this->app) extends ServiceProvider { + $this->app->register(new class($this->app) extends ServiceProvider + { public function boot(): void { - Route::get('test', fn() => true)->name('exists'); - Route::post('test/{foo}', fn() => true)->name('exists'); + Route::get('test', fn () => true)->name('exists'); + Route::post('test/{foo}', fn () => true)->name('exists'); } }); @@ -552,10 +580,11 @@ public function boot(): void public function test_assert_route_by_uri_fails_if_does_not_exists(): void { - $this->app->register(new class($this->app) extends ServiceProvider { + $this->app->register(new class($this->app) extends ServiceProvider + { public function boot(): void { - Route::post('test/{foo}', fn() => true); + Route::post('test/{foo}', fn () => true); } }); @@ -567,7 +596,8 @@ public function boot(): void public function test_assert_route_by_action(): void { - $this->app->register(new class($this->app) extends ServiceProvider { + $this->app->register(new class($this->app) extends ServiceProvider + { public function boot(): void { Route::post('foo', 'Foo@bar')->name('exists'); @@ -581,7 +611,8 @@ public function boot(): void public function test_assert_route_by_action_fails_if_does_not_exists(): void { - $this->app->register(new class($this->app) extends ServiceProvider { + $this->app->register(new class($this->app) extends ServiceProvider + { public function boot(): void { Route::post('foo', 'Foo@bar')->name('exists'); @@ -597,7 +628,8 @@ public function boot(): void public function test_assert_route_by_action_fails_if_its_closure(): void { - $this->app->register(new class($this->app) extends ServiceProvider { + $this->app->register(new class($this->app) extends ServiceProvider + { public function boot(): void { Route::post('foo', 'Foo@bar')->name('exists'); @@ -606,14 +638,15 @@ public function boot(): void }); $this->expectException(AssertionFailedError::class); - $this->expectExceptionMessage("Cannot assert a route with a closure-based action."); + $this->expectExceptionMessage('Cannot assert a route with a closure-based action.'); $this->assertRouteByAction('Closure'); } public function test_assert_middleware_aliases(): void { - $this->app->register(new class($this->app) extends ServiceProvider { + $this->app->register(new class($this->app) extends ServiceProvider + { public function boot(Router $router): void { $router->aliasMiddleware('foo', 'bar'); @@ -625,7 +658,8 @@ public function boot(Router $router): void public function test_assert_middleware_aliases_fails_if_doesnt_exist(): void { - $this->app->register(new class($this->app) extends ServiceProvider { + $this->app->register(new class($this->app) extends ServiceProvider + { public function boot(Router $router): void { $router->aliasMiddleware('foo', 'bar'); @@ -640,7 +674,8 @@ public function boot(Router $router): void public function test_assert_middleware_aliases_fails_if_middleware_alias_doesnt_exist(): void { - $this->app->register(new class($this->app) extends ServiceProvider { + $this->app->register(new class($this->app) extends ServiceProvider + { public function boot(Router $router): void { $router->aliasMiddleware('foo', 'bar'); @@ -655,7 +690,8 @@ public function boot(Router $router): void public function test_assert_global_middleware(): void { - $this->app->register(new class($this->app) extends ServiceProvider { + $this->app->register(new class($this->app) extends ServiceProvider + { public function boot(Kernel $http): void { $http->pushMiddleware('foo'); @@ -667,7 +703,8 @@ public function boot(Kernel $http): void public function test_assert_global_middleware_fails_if_doesnt_exist(): void { - $this->app->register(new class($this->app) extends ServiceProvider { + $this->app->register(new class($this->app) extends ServiceProvider + { public function boot(Kernel $http): void { $http->pushMiddleware('foo'); @@ -682,7 +719,8 @@ public function boot(Kernel $http): void public function test_assert_middleware_in_group(): void { - $this->app->register(new class($this->app) extends ServiceProvider { + $this->app->register(new class($this->app) extends ServiceProvider + { public function boot(Kernel $http): void { $http->appendMiddlewareToGroup('web', 'foo'); @@ -694,7 +732,8 @@ public function boot(Kernel $http): void public function test_assert_middleware_in_group_fails_if_group_doesnt_exist(): void { - $this->app->register(new class($this->app) extends ServiceProvider { + $this->app->register(new class($this->app) extends ServiceProvider + { public function boot(Kernel $http): void { $http->appendMiddlewareToGroup('web', 'foo'); @@ -709,7 +748,8 @@ public function boot(Kernel $http): void public function test_assert_middleware_in_group_fails_if_middleware_doesnt_exist_in_group(): void { - $this->app->register(new class($this->app) extends ServiceProvider { + $this->app->register(new class($this->app) extends ServiceProvider + { public function boot(Kernel $http): void { $http->appendMiddlewareToGroup('web', 'foo'); @@ -724,12 +764,13 @@ public function boot(Kernel $http): void public function test_assert_gate_has_ability(): void { - $this->app->register(new class($this->app) extends ServiceProvider { + $this->app->register(new class($this->app) extends ServiceProvider + { use BootHelpers; public function boot(): void { - $this->withGate('foo', fn(?object $user, string $foo) => $foo === 'bar'); + $this->withGate('foo', fn (?object $user, string $foo) => $foo === 'bar'); } }); @@ -746,7 +787,8 @@ public function test_assert_gate_has_ability_fails(): void public function test_gate_has_policy(): void { - $this->app->register(new class($this->app) extends ServiceProvider { + $this->app->register(new class($this->app) extends ServiceProvider + { use BootHelpers; public function boot(): void @@ -768,7 +810,8 @@ public function test_gate_has_policy_fails(): void public function test_gate_has_policy_with_ability(): void { - $this->app->register(new class($this->app) extends ServiceProvider { + $this->app->register(new class($this->app) extends ServiceProvider + { use BootHelpers; public function boot(): void @@ -782,7 +825,8 @@ public function boot(): void public function test_gate_has_policy_with_ability_fails(): void { - $this->app->register(new class($this->app) extends ServiceProvider { + $this->app->register(new class($this->app) extends ServiceProvider + { use BootHelpers; public function boot(): void @@ -799,7 +843,8 @@ public function boot(): void public function test_assert_scheduled(): void { - $this->app->register(new class($this->app) extends ServiceProvider { + $this->app->register(new class($this->app) extends ServiceProvider + { use BootHelpers; public function boot(): void @@ -817,7 +862,8 @@ public function boot(): void public function test_assert_scheduled_job_fails_if_not_found(): void { - $this->app->register(new class($this->app) extends ServiceProvider { + $this->app->register(new class($this->app) extends ServiceProvider + { use BootHelpers; public function boot(): void @@ -837,7 +883,8 @@ public function boot(): void public function test_assert_scheduled_command_fails_if_not_found(): void { - $this->app->register(new class($this->app) extends ServiceProvider { + $this->app->register(new class($this->app) extends ServiceProvider + { use BootHelpers; public function boot(): void @@ -857,7 +904,8 @@ public function boot(): void public function test_assert_scheduled_task_at_date(): void { - $this->app->register(new class($this->app) extends ServiceProvider { + $this->app->register(new class($this->app) extends ServiceProvider + { use BootHelpers; public function boot(): void @@ -875,7 +923,8 @@ public function boot(): void public function test_assert_scheduled_job_at_date_fails_if_doesnt_exist(): void { - $this->app->register(new class($this->app) extends ServiceProvider { + $this->app->register(new class($this->app) extends ServiceProvider + { use BootHelpers; public function boot(): void @@ -895,7 +944,8 @@ public function boot(): void public function test_assert_scheduled_command_at_date_fails_if_doesnt_exist(): void { - $this->app->register(new class($this->app) extends ServiceProvider { + $this->app->register(new class($this->app) extends ServiceProvider + { use BootHelpers; public function boot(): void @@ -915,7 +965,8 @@ public function boot(): void public function test_assert_scheduled_job_at_date_fails_if_doesnt_run_at_date(): void { - $this->app->register(new class($this->app) extends ServiceProvider { + $this->app->register(new class($this->app) extends ServiceProvider + { use BootHelpers; public function boot(): void @@ -935,7 +986,8 @@ public function boot(): void public function test_assert_scheduled_command_at_date_fails_if_doesnt_run_at_date(): void { - $this->app->register(new class($this->app) extends ServiceProvider { + $this->app->register(new class($this->app) extends ServiceProvider + { use BootHelpers; public function boot(): void @@ -955,7 +1007,8 @@ public function boot(): void public function test_assert_scheduled_task_at_date_between(): void { - $this->app->register(new class($this->app) extends ServiceProvider { + $this->app->register(new class($this->app) extends ServiceProvider + { use BootHelpers; public function boot(): void @@ -971,7 +1024,8 @@ public function boot(): void public function test_assert_scheduled_task_at_date_between_fails_if_time_not_between(): void { - $this->app->register(new class($this->app) extends ServiceProvider { + $this->app->register(new class($this->app) extends ServiceProvider + { use BootHelpers; public function boot(): void @@ -990,11 +1044,12 @@ public function boot(): void public function test_assert_macro(): void { - $this->app->register(new class($this->app) extends ServiceProvider { + $this->app->register(new class($this->app) extends ServiceProvider + { public function boot(): void { - Builder::macro('foo', static fn(): string => 'bar'); - BaseBuilder::macro('baz', static fn(): string => 'quz'); + Builder::macro('foo', static fn (): string => 'bar'); + BaseBuilder::macro('baz', static fn (): string => 'quz'); } }); @@ -1004,10 +1059,11 @@ public function boot(): void public function test_assert_macro_fails_if_macro_doesnt_exist(): void { - $this->app->register(new class($this->app) extends ServiceProvider { + $this->app->register(new class($this->app) extends ServiceProvider + { public function boot(): void { - Builder::macro('foo', static fn(): string => 'bar'); + Builder::macro('foo', static fn (): string => 'bar'); } });