示例#1
0
 /**
  * Test sets param when exists
  */
 public function testSetRouteParamWhenExists()
 {
     // Prepare route
     $requestUri = '/hello/mr/anderson';
     $route = new Slim_Route('/hello/:first/:last', 'fooCallable');
     // Parse route params
     $this->assertTrue($route->matches($requestUri));
     // Get param
     $this->assertEquals('anderson', $route->getParam('last'));
     // Set param
     $route->setParam('last', 'smith');
     // Get new param
     $this->assertEquals('smith', $route->getParam('last'));
 }