Ejemplo n.º 1
0
 /**
  * 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());
 }
Ejemplo n.º 2
0
 public function testLogin()
 {
     $req = Request::create("/user/login", "POST", ["username" => "admin", "password" => "singo"]);
     $response = $this->app->handle($req);
     $this->assertContains("data", $response->getContent());
 }
Ejemplo n.º 3
0
 public function testModule()
 {
     $req = Request::create("/home");
     $response = $this->app->handle($req);
     $this->assertEquals("hello world", $response->getContent());
 }