| @@ 46-65 (lines=20) @@ | ||
| 43 | ); |
|
| 44 | } |
|
| 45 | ||
| 46 | public function testCreateProxyCacheResolver() |
|
| 47 | { |
|
| 48 | $this->configResolver |
|
| 49 | ->expects($this->at(0)) |
|
| 50 | ->method('hasParameter') |
|
| 51 | ->with('image_host') |
|
| 52 | ->willReturn(true); |
|
| 53 | ||
| 54 | $host = 'http://ez.no'; |
|
| 55 | ||
| 56 | $this->configResolver |
|
| 57 | ->expects($this->at(1)) |
|
| 58 | ->method('getParameter') |
|
| 59 | ->with('image_host') |
|
| 60 | ->willReturn($host); |
|
| 61 | ||
| 62 | $expected = new ProxyResolver($this->resolver, [$host]); |
|
| 63 | ||
| 64 | $this->assertEquals($expected, $this->factory->createCacheResolver()); |
|
| 65 | } |
|
| 66 | ||
| 67 | public function testCreateRelativeCacheResolver() |
|
| 68 | { |
|
| @@ 67-86 (lines=20) @@ | ||
| 64 | $this->assertEquals($expected, $this->factory->createCacheResolver()); |
|
| 65 | } |
|
| 66 | ||
| 67 | public function testCreateRelativeCacheResolver() |
|
| 68 | { |
|
| 69 | $this->configResolver |
|
| 70 | ->expects($this->at(0)) |
|
| 71 | ->method('hasParameter') |
|
| 72 | ->with('image_host') |
|
| 73 | ->willReturn(true); |
|
| 74 | ||
| 75 | $host = '/'; |
|
| 76 | ||
| 77 | $this->configResolver |
|
| 78 | ->expects($this->at(1)) |
|
| 79 | ->method('getParameter') |
|
| 80 | ->with('image_host') |
|
| 81 | ->willReturn($host); |
|
| 82 | ||
| 83 | $expected = new RelativeResolver($this->resolver); |
|
| 84 | ||
| 85 | $this->assertEquals($expected, $this->factory->createCacheResolver()); |
|
| 86 | } |
|
| 87 | } |
|
| 88 | ||