Ejemplo n.º 1
0
 public function testBasic()
 {
     $request = new Request(['method' => 'POST', 'queryString' => 'a=b&b=c', 'content' => json_encode(['foo' => 'bar']), 'headers' => ['Content-Type' => 'application/json; Charset=utf8']]);
     $this->assertTrue($request->is('post'));
     $this->assertEquals(['a' => 'b', 'b' => 'c'], $request->params->all());
     $this->assertEquals(['foo' => 'bar'], $request->body->all());
     $this->assertEquals('b', $request->input('a'));
     $this->assertEquals(true, $request->has('foo'));
 }