public function testNewInstanceWhenNewQueryParams() { $queryParams = ['testK' => 'testV']; $serverRequest = $this->serverRequest->withQueryParams($queryParams); $this->assertNotSame($this->serverRequest, $serverRequest); $this->assertEquals($queryParams, $serverRequest->getQueryParams()); }
public function testQueryParams() { $request1 = new ServerRequest('GET', '/'); $params = ['name' => 'value']; $request2 = $request1->withQueryParams($params); $this->assertNotSame($request2, $request1); $this->assertEmpty($request1->getQueryParams()); $this->assertSame($params, $request2->getQueryParams()); }