withQueryParams() public méthode

public withQueryParams ( array $query )
$query array
Exemple #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']);
 }