| @@ 126-133 (lines=8) @@ | ||
| 123 | * |
|
| 124 | * @dataProvider analyseProvider |
|
| 125 | */ |
|
| 126 | public function testAnalyseURI($level, $uri, $expectedFixedUpURI) |
|
| 127 | { |
|
| 128 | $matcher = new URIElementMatcher(array($level)); |
|
| 129 | $matcher->setRequest( |
|
| 130 | new SimplifiedRequest(array('pathinfo' => $uri)) |
|
| 131 | ); |
|
| 132 | $this->assertSame($expectedFixedUpURI, $matcher->analyseURI($uri)); |
|
| 133 | } |
|
| 134 | ||
| 135 | /** |
|
| 136 | * @param int $level |
|
| @@ 142-149 (lines=8) @@ | ||
| 139 | * |
|
| 140 | * @dataProvider analyseProvider |
|
| 141 | */ |
|
| 142 | public function testAnalyseURILevelAsInt($level, $uri, $expectedFixedUpURI) |
|
| 143 | { |
|
| 144 | $matcher = new URIElementMatcher($level); |
|
| 145 | $matcher->setRequest( |
|
| 146 | new SimplifiedRequest(array('pathinfo' => $uri)) |
|
| 147 | ); |
|
| 148 | $this->assertSame($expectedFixedUpURI, $matcher->analyseURI($uri)); |
|
| 149 | } |
|
| 150 | ||
| 151 | /** |
|
| 152 | * @param int $level |
|
| @@ 158-165 (lines=8) @@ | ||
| 155 | * |
|
| 156 | * @dataProvider analyseProvider |
|
| 157 | */ |
|
| 158 | public function testAnalyseLink($level, $fullUri, $linkUri) |
|
| 159 | { |
|
| 160 | $matcher = new URIElementMatcher(array($level)); |
|
| 161 | $matcher->setRequest( |
|
| 162 | new SimplifiedRequest(array('pathinfo' => $fullUri)) |
|
| 163 | ); |
|
| 164 | $this->assertSame($fullUri, $matcher->analyseLink($linkUri)); |
|
| 165 | } |
|
| 166 | ||
| 167 | public function analyseProvider() |
|
| 168 | { |
|
| @@ 131-138 (lines=8) @@ | ||
| 128 | * |
|
| 129 | * @dataProvider analyseProvider |
|
| 130 | */ |
|
| 131 | public function testAnalyseURI($uri, $expectedFixedUpURI) |
|
| 132 | { |
|
| 133 | $matcher = new URIElementMatcher(array(1)); |
|
| 134 | $matcher->setRequest( |
|
| 135 | new SimplifiedRequest(array('pathinfo' => $uri)) |
|
| 136 | ); |
|
| 137 | $this->assertSame($expectedFixedUpURI, $matcher->analyseURI($uri)); |
|
| 138 | } |
|
| 139 | ||
| 140 | /** |
|
| 141 | * @param string $fullUri |
|
| @@ 146-153 (lines=8) @@ | ||
| 143 | * |
|
| 144 | * @dataProvider analyseProvider |
|
| 145 | */ |
|
| 146 | public function testAnalyseLink($fullUri, $linkUri) |
|
| 147 | { |
|
| 148 | $matcher = new URIElementMatcher(array(1)); |
|
| 149 | $matcher->setRequest( |
|
| 150 | new SimplifiedRequest(array('pathinfo' => $fullUri)) |
|
| 151 | ); |
|
| 152 | $this->assertSame($fullUri, $matcher->analyseLink($linkUri)); |
|
| 153 | } |
|
| 154 | ||
| 155 | public function analyseProvider() |
|
| 156 | { |
|