Skip to content

Commit f1a953a

Browse files
author
Jordan Hall
committed
Do not process restrictions if PHP is running via the command line
1 parent 054a161 commit f1a953a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Http/Middleware/BasicAuthentication.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ class BasicAuthentication
2727
*/
2828
public function handle(Request $request, Closure $next, $routeUsername = null, $routePassword = null)
2929
{
30+
// To prevent unit test failures, do not process restrictions if PHP is running via the command line
31+
if (php_sapi_name() == "cli") {
32+
return $next($request);
33+
}
34+
3035
// Disable middleware is requested
3136
if ($routeUsername == 'disable' || $routePassword == 'disable') {
3237
return $next($request);

0 commit comments

Comments
 (0)