<?php
namespace Tests\Feature;
use function Spatie\RouteTesting\routeTesting;
routeTesting('all api routes')->include('api/*')->assertSuccessful();
In latest version (L11)
php artisan test
PASS Tests\Unit\ExampleTest
✓ that true is true
PASS Tests\Feature\ExampleTest
✓ the application returns a successful response 0.43s
FAIL Tests\Feature\RouteApiTest
⨯ all api routes with ('GET', 'api/test') 0.01s
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
FAILED Tests\Feature\RouteApiTest > all api routes with ('GET', 'api/test') BindingResolutionException
Target [Illuminate\Contracts\Routing\UrlGenerator] is not instantiable.
at vendor/laravel/framework/src/Illuminate/Container/Container.php:1202
1198▕ } else {
1199▕ $message = "Target [$concrete] is not instantiable.";
1200▕ }
1201▕
➜ 1202▕ throw new BindingResolutionException($message);
1203▕ }
1204▕
1205▕ /*
1206▕ Throw an exception for an unresolvable primitive.
For:
In latest version (L11)