match() public method

This is TRUE if $routePath is not empty and the first part is equal to the Route Part name.
public match ( string &$routePath ) : boolean
$routePath string The request path to be matched - without query parameters, host and fragment.
return boolean TRUE if Route Part matched $routePath, otherwise FALSE.
コード例 #1
0
 /**
  * @test
  */
 public function matchResetsValueBeforeProcessingTheRoutePath()
 {
     $routePart = new Mvc\Routing\StaticRoutePart();
     $routePart->setName('foo');
     $routeValues = [];
     $routePart->resolve($routeValues);
     $this->assertSame('foo', $routePart->getValue());
     $routePath = 'foo';
     $routePart->match($routePath);
     $this->assertNull($routePart->getValue(), 'Static Route Part must reset their value to NULL.');
 }