|
7 | 7 | use PHPUnit\Framework\TestCase; |
8 | 8 | use Shapecode\Twig\Loader\StringLoader; |
9 | 9 | use Twig\Error\LoaderError; |
| 10 | + |
10 | 11 | use function time; |
11 | 12 |
|
12 | 13 | class StringLoaderTest extends TestCase |
13 | 14 | { |
14 | | - public function testGetSourceContextWhenTemplateDoesNotExist() : void |
| 15 | + public function testGetSourceContextWhenTemplateDoesNotExist(): void |
15 | 16 | { |
16 | 17 | $this->expectException(LoaderError::class); |
17 | 18 | $loader = new StringLoader(); |
18 | 19 | $loader->getSourceContext('foo'); |
19 | 20 | } |
20 | 21 |
|
21 | | - public function testGetCacheKey() : void |
| 22 | + public function testGetCacheKey(): void |
22 | 23 | { |
23 | 24 | $loader = new StringLoader(); |
24 | 25 | self::assertEquals('327b6f07435811239bc47e1544353273', $loader->getCacheKey('foo bar')); |
25 | 26 | } |
26 | 27 |
|
27 | | - public function testGetCacheKeyWhenTemplateDoesNotExist() : void |
| 28 | + public function testGetCacheKeyWhenTemplateDoesNotExist(): void |
28 | 29 | { |
29 | 30 | $this->expectException(LoaderError::class); |
30 | 31 | $loader = new StringLoader(); |
31 | 32 | $loader->getCacheKey('foo'); |
32 | 33 | } |
33 | 34 |
|
34 | | - public function testIsFresh() : void |
| 35 | + public function testIsFresh(): void |
35 | 36 | { |
36 | 37 | $loader = new StringLoader(); |
37 | 38 | self::assertTrue($loader->isFresh('foo bar', time())); |
38 | 39 | } |
39 | 40 |
|
40 | | - public function testIsFreshWhenTemplateDoesNotExist() : void |
| 41 | + public function testIsFreshWhenTemplateDoesNotExist(): void |
41 | 42 | { |
42 | 43 | $this->expectException(LoaderError::class); |
43 | 44 |
|
44 | 45 | $loader = new StringLoader(); |
45 | 46 | $loader->isFresh('foo', time()); |
46 | 47 | } |
47 | 48 |
|
48 | | - public function testExists() : void |
| 49 | + public function testExists(): void |
49 | 50 | { |
50 | 51 | $loader = new StringLoader(); |
51 | 52 | self::assertTrue($loader->exists('foo bar')); |
52 | 53 | } |
53 | 54 |
|
54 | | - public function testExistsFails() : void |
| 55 | + public function testExistsFails(): void |
55 | 56 | { |
56 | 57 | $loader = new StringLoader(); |
57 | 58 | self::assertFalse($loader->exists('foo')); |
|
0 commit comments