/**
  * @test
  */
 public function addsRouteCorrectlyIfValid()
 {
     $route = RouteBuilder::route()->get('/something')->to('someaction')->build();
     $this->router->addRoute($route);
     $this->request = new ServerRequest([], [], '/something', 'GET');
     $result = $this->router->match($this->request);
     $this->assertTrue($result->succeeded());
     $this->assertSame($route, $result->getRoute());
 }
 /**
  * @test
  */
 public function routeParamsOverwriteQueryParams()
 {
     $this->request = new ServerRequest([], [], '/user/123', 'GET');
     $this->request = $this->request->withQueryParams(['userId' => '999']);
     $this->request = $this->router->match($this->request);
     $targetRequestAttribute = $this->router->getTargetRequestAttribute();
     $queryParams = $this->request->getQueryParams();
     $this->assertTrue(isset($queryParams['userId']));
     $this->assertSame('123', $queryParams['userId']);
 }