Total Complexity | 3 |
Total Lines | 28 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
10 | trait ResourceLoaderTrait |
||
11 | { |
||
12 | /** |
||
13 | * Returns contents of resource file. |
||
14 | * |
||
15 | * @param string $resourceName (file path relative to the tests/resources directory) |
||
16 | */ |
||
17 | private function getResource(string $resourceName): string |
||
18 | { |
||
19 | $contents = file_get_contents($this->getPath($resourceName)); |
||
20 | Assert::assertNotFalse($contents); |
||
21 | |||
22 | return $contents; |
||
23 | } |
||
24 | |||
25 | /** |
||
26 | * Returns path of resource. |
||
27 | * |
||
28 | * @param string $resourceName (file path relative to the tests/resources directory) |
||
29 | */ |
||
30 | private function getPath(string $resourceName): string |
||
31 | { |
||
32 | return __DIR__.'/../resources/'.$resourceName; |
||
33 | } |
||
34 | |||
35 | private function getFileName(string $resourceName): BaseLineFileName |
||
38 | } |
||
39 | } |
||
40 |