protonemedia /
laravel-browser-kit-macro
| 1 | <?php |
||
| 2 | |||
| 3 | namespace ProtoneMedia\LaravelBrowserKitMacro; |
||
| 4 | |||
| 5 | use Illuminate\Foundation\Testing\TestResponse as LegacyTestResponse; |
||
|
0 ignored issues
–
show
|
|||
| 6 | use Illuminate\Support\ServiceProvider; |
||
| 7 | use Illuminate\Testing\TestResponse as ModernTestResponse; |
||
| 8 | |||
| 9 | class BrowserKitMacroServiceProvider extends ServiceProvider |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * Bootstrap any package services. |
||
| 13 | * |
||
| 14 | * @return void |
||
| 15 | */ |
||
| 16 | public function boot() |
||
| 17 | { |
||
| 18 | } |
||
| 19 | |||
| 20 | /** |
||
| 21 | * Register any package services. |
||
| 22 | * |
||
| 23 | * @return void |
||
| 24 | * @throws Exception |
||
| 25 | */ |
||
| 26 | public function register() |
||
| 27 | { |
||
| 28 | if ($this->app->environment('production')) { |
||
| 29 | return; |
||
| 30 | } |
||
| 31 | |||
| 32 | if ($this->app->runningInConsole()) { |
||
| 33 | $class = class_exists(ModernTestResponse::class) ? ModernTestResponse::class : LegacyTestResponse::class; |
||
| 34 | |||
| 35 | $class::macro('browserKit', function ($callback) { |
||
| 36 | $testCase = (new BrowserKitTestCase) |
||
| 37 | ->setApp(app()) |
||
| 38 | ->setResponse($this->baseResponse); |
||
|
0 ignored issues
–
show
|
|||
| 39 | |||
| 40 | $callback($testCase); |
||
| 41 | |||
| 42 | return $this; |
||
| 43 | }); |
||
| 44 | } |
||
| 45 | } |
||
| 46 | } |
||
| 47 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths