| @@ 142-150 (lines=9) @@ | ||
| 139 | ); |
|
| 140 | } |
|
| 141 | ||
| 142 | public function testSetGetRequestMapHost() |
|
| 143 | { |
|
| 144 | $mapKey = 'phoenix-rises.fm'; |
|
| 145 | $request = new SimplifiedRequest(array('host' => $mapKey)); |
|
| 146 | $matcher = new Host(array('foo' => $mapKey)); |
|
| 147 | $matcher->setRequest($request); |
|
| 148 | $this->assertSame($request, $matcher->getRequest()); |
|
| 149 | $this->assertSame($mapKey, $matcher->getMapKey()); |
|
| 150 | } |
|
| 151 | ||
| 152 | public function testReverseHostMatchFail() |
|
| 153 | { |
|
| @@ 178-186 (lines=9) @@ | ||
| 175 | $this->assertSame('phoenix-rises.fm', $result->getRequest()->host); |
|
| 176 | } |
|
| 177 | ||
| 178 | public function testSetGetRequestMapPort() |
|
| 179 | { |
|
| 180 | $mapKey = '8000'; |
|
| 181 | $request = new SimplifiedRequest(array('port' => $mapKey)); |
|
| 182 | $matcher = new Port(array('foo' => $mapKey)); |
|
| 183 | $matcher->setRequest($request); |
|
| 184 | $this->assertSame($request, $matcher->getRequest()); |
|
| 185 | $this->assertSame($mapKey, $matcher->getMapKey()); |
|
| 186 | } |
|
| 187 | ||
| 188 | public function testReversePortMatchFail() |
|
| 189 | { |
|
| @@ 26-33 (lines=8) @@ | ||
| 23 | * |
|
| 24 | * @dataProvider setRequestProvider |
|
| 25 | */ |
|
| 26 | public function testSetGetRequest($config, $pathinfo, $expectedMapKey) |
|
| 27 | { |
|
| 28 | $request = new SimplifiedRequest(array('pathinfo' => $pathinfo)); |
|
| 29 | $matcher = new URIMapMatcher($config); |
|
| 30 | $matcher->setRequest($request); |
|
| 31 | $this->assertSame($request, $matcher->getRequest()); |
|
| 32 | $this->assertSame($expectedMapKey, $matcher->getMapKey()); |
|
| 33 | } |
|
| 34 | ||
| 35 | /** |
|
| 36 | * @param string $uri |
|