$this->assertSame($match, (bool) preg_match($pattern, $uri, $matches), "$uri did (not) match endpoint's pattern");
foreach ($expectedMatches as $key => $value) {
$this->assertTrue(array_key_exists($key, $matches), "$key not found in matches");
$this->assertSame($value, $matches[$key], "match for $key was incorrect");
}