public function testMatchedRequestIsNotMatchedTwice()
 {
     $matcher = new RequestMatcher(['~^/api$~']);
     $request = $this->getRequestFromPath('/');
     $this->assertEquals(false, $matcher->matches($request));
     $this->assertFalse($request->attributes->has(RequestMatcher::ATTRIBUTE_MATCHED));
     $this->assertEquals(false, $matcher->matches($request));
 }
 public function testMatchesAlreadyMatched()
 {
     $subject = new RequestMatcher(['~^/api$~']);
     $request = $this->getRequestFromPath('/api');
     // First match, path 1
     $this->assertTrue($subject->matches($request));
     // Second match, shortcut path 2
     $this->assertTrue($subject->matches($request));
 }