diff --git a/test/Route/RouteMatchTest.php b/test/Route/RouteMatchTest.php deleted file mode 100644 index f074d57..0000000 --- a/test/Route/RouteMatchTest.php +++ /dev/null @@ -1,66 +0,0 @@ - 'bar']); - - $this->assertEquals(['foo' => 'bar'], $match->getParams()); - } - - public function testLengthIsStored() - { - $match = new RouteMatch([], 10); - - $this->assertEquals(10, $match->getLength()); - } - - public function testLengthIsMerged() - { - $match = new RouteMatch([], 10); - $match->merge(new RouteMatch([], 5)); - - $this->assertEquals(15, $match->getLength()); - } - - public function testMatchedRouteNameIsSet() - { - $match = new RouteMatch([]); - $match->setMatchedRouteName('foo'); - - $this->assertEquals('foo', $match->getMatchedRouteName()); - } - - public function testMatchedRouteNameIsPrependedWhenAlreadySet() - { - $match = new RouteMatch([]); - $match->setMatchedRouteName('foo'); - $match->setMatchedRouteName('bar'); - - $this->assertEquals('bar/foo', $match->getMatchedRouteName()); - } - - public function testMatchedRouteNameIsOverriddenOnMerge() - { - $match = new RouteMatch([]); - $match->setMatchedRouteName('foo'); - - $subMatch = new RouteMatch([]); - $subMatch->setMatchedRouteName('bar'); - - $match->merge($subMatch); - - $this->assertEquals('bar', $match->getMatchedRouteName()); - } -} diff --git a/test/RouteMatchTest.php b/test/RouteMatchTest.php index db6b9d2..2d1be58 100644 --- a/test/RouteMatchTest.php +++ b/test/RouteMatchTest.php @@ -14,44 +14,35 @@ class RouteMatchTest extends TestCase { public function testParamsAreStored() { - $match = new RouteMatch(['foo' => 'bar']); + $match = new RouteMatch(null, ['foo' => 'bar']); $this->assertEquals(['foo' => 'bar'], $match->getParams()); } public function testMatchedRouteNameIsSet() { - $match = new RouteMatch([]); - $match->setMatchedRouteName('foo'); + $match = new RouteMatch('foo', []); $this->assertEquals('foo', $match->getMatchedRouteName()); } - public function testSetParam() - { - $match = new RouteMatch([]); - $match->setParam('foo', 'bar'); - - $this->assertEquals(['foo' => 'bar'], $match->getParams()); - } - public function testGetParam() { - $match = new RouteMatch(['foo' => 'bar']); + $match = new RouteMatch(null, ['foo' => 'bar']); $this->assertEquals('bar', $match->getParam('foo')); } public function testGetNonExistentParamWithoutDefault() { - $match = new RouteMatch([]); + $match = new RouteMatch(null, []); $this->assertNull($match->getParam('foo')); } public function testGetNonExistentParamWithDefault() { - $match = new RouteMatch([]); + $match = new RouteMatch(null, []); $this->assertEquals('bar', $match->getParam('foo', 'bar')); }