diff --git a/src/Kernel/Http/Kernel.php b/src/Kernel/Http/Kernel.php new file mode 100644 index 0000000..d0769de --- /dev/null +++ b/src/Kernel/Http/Kernel.php @@ -0,0 +1,32 @@ + + * Date: 01/06/2020 + * Time: 10.47 + * Class Kernel + * @package DyanGalih\Payment\Kernel + */ +class Kernel extends \Orchestra\Testbench\Http\Kernel +{ + protected $routeMiddleware = [ + 'role' => RoleCheck::class, + 'auth' => \Orchestra\Testbench\Http\Middleware\Authenticate::class, + 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class, + 'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class, + 'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class, + 'can' => \Illuminate\Auth\Middleware\Authorize::class, + 'guest' => \Orchestra\Testbench\Http\Middleware\RedirectIfAuthenticated::class, + 'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class, + 'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class, + 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, + 'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class, + ]; +} diff --git a/src/Traits/TestCaseTrait.php b/src/Traits/TestCaseTrait.php index cffc432..81308f0 100644 --- a/src/Traits/TestCaseTrait.php +++ b/src/Traits/TestCaseTrait.php @@ -7,6 +7,7 @@ use Faker\Factory as Faker; use Illuminate\Container\Container; +use Illuminate\Foundation\Application; use Illuminate\Support\Facades\Artisan; use WebAppId\User\Models\User; @@ -91,4 +92,15 @@ protected function resultLog(string $result){ error_log('Sample Result : ' . $result); error_log('=========================================================='); } + + /** + * Resolve application HTTP Kernel implementation. + * + * @param Application $app + * @return void + */ + protected function resolveApplicationHttpKernel($app) + { + $app->singleton('Illuminate\Contracts\Http\Kernel', 'WebAppId\DDD\Kernel\Http\Kernel'); + } } \ No newline at end of file