Conditions | 1 |
Paths | 1 |
Total Lines | 20 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
22 | public function testResolve() |
||
23 | { |
||
24 | $acceptedVal = '/path/to/plugin'; |
||
25 | $alias = '@test'; |
||
26 | $pathResolverMock = $this->createMock(PathResolverInterface::class); |
||
27 | $pathResolverMock |
||
28 | ->expects($this->once()) |
||
29 | ->method('resolve') |
||
30 | ->with($alias) |
||
31 | ->willReturn($acceptedVal); |
||
32 | |||
33 | $cachedDecorator = new PathResolverCacheDecorator( |
||
34 | $pathResolverMock |
||
35 | ); |
||
36 | |||
37 | $resultOriginal = $cachedDecorator->resolve($alias); |
||
38 | $resultCached = $cachedDecorator->resolve($alias); |
||
39 | |||
40 | $this->assertEquals($acceptedVal, $resultOriginal); |
||
41 | $this->assertEquals($acceptedVal, $resultCached); |
||
42 | } |
||
44 |