fix test
This commit is contained in:
parent
2bd1a8c073
commit
25a31302ae
14
tests/Concerns/FakeMiddleware.php
Normal file
14
tests/Concerns/FakeMiddleware.php
Normal file
@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Concerns;
|
||||
|
||||
class FakeMiddleware
|
||||
{
|
||||
public function handle($request, $next)
|
||||
{
|
||||
$response = $next($request);
|
||||
$response->header('X-Middleware-Test', 'value');
|
||||
|
||||
return $response;
|
||||
}
|
||||
}
|
@ -100,15 +100,7 @@ class HookTest extends TestCase
|
||||
|
||||
public function testPushMiddleware()
|
||||
{
|
||||
Hook::pushMiddleware(get_class(new class() {
|
||||
public function handle($request, $next)
|
||||
{
|
||||
$response = $next($request);
|
||||
$response->header('X-Middleware-Test', 'value');
|
||||
|
||||
return $response;
|
||||
}
|
||||
}));
|
||||
Hook::pushMiddleware(Concerns\FakeMiddleware::class);
|
||||
$this->get('/')->assertHeader('X-Middleware-Test');
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user