Last active
April 14, 2020 00:30
-
-
Save nasrulhazim/1a0de28fb19a6caabc79676ce65c20c1 to your computer and use it in GitHub Desktop.
Learn Middleware Test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Tests\Feature; | |
use App\Http\Middleware\LearnUnitTestMiddleware; | |
use Tests\TestCase; | |
use Illuminate\Http\Request; | |
use Illuminate\Http\Response; | |
use Mockery; | |
class LearnMiddlewareTest extends TestCase | |
{ | |
/** @test */ | |
public function the_learn_middleware_works() | |
{ | |
$this->app['router']->get('test-middleware', function (\Illuminate\Http\Request $request) { | |
$this->assertContains(['learn' => true], $request->input()); | |
})->middleware('App\Http\Middleware\LearnUnitTestMiddleware'); | |
$this->get('test-middleware'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment