withQueryParams() public method

public withQueryParams ( array $query )
$query array
Ejemplo n.º 1
0
 public function testParamsOrder()
 {
     $request = new ServerRequest();
     $cycle = new Cycle($request->withParsedBody(['foo' => 'bar']));
     $this->assertEquals('bar', $cycle['foo']);
     $cycle = new Cycle($request->withCookieParams(['foo' => 'cookie']));
     $this->assertEquals('cookie', $cycle['foo']);
     $cycle = new Cycle($request->withCookieParams(['foo' => 'cookie'])->withParsedBody(['foo' => 'post']));
     $this->assertEquals('cookie', $cycle['foo']);
     $cycle = new Cycle($request->withQueryParams(['foo' => 'get'])->withParsedBody(['foo' => 'post']));
     $this->assertEquals('post', $cycle['foo']);
     $cycle = new Cycle($request->withQueryParams(['foo' => 'get'])->withParsedBody(['foo' => 'post']));
     $cycle->setPathParameters(['foo' => 'path']);
     $this->assertEquals('path', $cycle['foo']);
 }