/** * test command validation middleware */ public function testCommandValidation() { $this->app["test.controller"] = function (Container $container) { return new TestController($container["command.bus"]); }; $this->app->registerCommands([Commands\TestCommand::class], function () { return new GeneralHandler(); }); $this->app->get("/validate", "test.controller:validateAction"); $request = Request::create("/validate"); $this->assertContains("blank", $this->app->handle($request)->getContent()); }
public function testLogin() { $req = Request::create("/user/login", "POST", ["username" => "admin", "password" => "singo"]); $response = $this->app->handle($req); $this->assertContains("data", $response->getContent()); }
public function testModule() { $req = Request::create("/home"); $response = $this->app->handle($req); $this->assertEquals("hello world", $response->getContent()); }