| Conditions | 1 |
| Paths | 1 |
| Total Lines | 19 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 31 | public function properlyReplacesTheOldPathByTheNewOne() |
||
| 32 | { |
||
| 33 | $uri = new Uri('/short-codes/foo'); |
||
| 34 | |||
| 35 | $request = $this->prophesize(ServerRequestInterface::class); |
||
| 36 | $request->getUri()->willReturn($uri); |
||
| 37 | $withUri = $request->withUri(Argument::that(function (UriInterface $uri) { |
||
| 38 | $path = $uri->getPath(); |
||
| 39 | |||
| 40 | Assert::assertContains('/short-urls', $path); |
||
| 41 | Assert::assertNotContains('/short-codes', $path); |
||
| 42 | |||
| 43 | return $uri; |
||
| 44 | }))->willReturn($request->reveal()); |
||
| 45 | |||
| 46 | $this->middleware->process($request->reveal(), $this->requestHandler->reveal()); |
||
| 47 | |||
| 48 | $withUri->shouldHaveBeenCalledTimes(1); |
||
| 49 | } |
||
| 50 | } |
||
| 51 |