Пример #1
0
 public function testDecoration()
 {
     $result = $this->app->__invoke($this->newRequest('/'), new Response(), function ($req, $res) {
         $this->assertInstanceOf(TonisRequest::class, $req);
         $this->assertInstanceOf(TonisResponse::class, $res);
         $res->write('success');
     });
     $this->assertSame('success', $result->getBody()->__toString());
     $result = $this->app->__invoke($this->newTonisRequest('/'), $this->newTonisResponse(), function ($req, $res) {
         $this->assertInstanceOf(TonisRequest::class, $req);
         $this->assertInstanceOf(TonisResponse::class, $res);
         $res->write('success');
     });
     $this->assertSame('success', $result->getBody()->__toString());
 }