Completed
Push — master ( 7c10f8...2945ff )
by
unknown
12:31
created

ProxyCacheWarmerTest::testIsOptional()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * @copyright Copyright (C) eZ Systems AS. All rights reserved.
5
 * @license For full copyright and license information view LICENSE file distributed with this source code.
6
 */
7
declare(strict_types=1);
8
9
namespace eZ\Bundle\EzPublishCoreBundle\Tests\Cache\Warmer;
10
11
use eZ\Bundle\EzPublishCoreBundle\Cache\Warmer\ProxyCacheWarmer;
12
use eZ\Publish\Core\Repository\ProxyFactory\ProxyGeneratorInterface;
13
use PHPUnit\Framework\TestCase;
14
15
final class ProxyCacheWarmerTest extends TestCase
16
{
17
    /** @var \eZ\Publish\Core\Repository\ProxyFactory\ProxyGeneratorInterface|\PHPUnit\Framework\MockObject\MockObject */
18
    private $proxyGenerator;
19
20
    /** @var \eZ\Bundle\EzPublishCoreBundle\Cache\Warmer\ProxyCacheWarmer */
21
    private $proxyCacheWarmer;
22
23
    protected function setUp(): void
24
    {
25
        $this->proxyGenerator = $this->createMock(ProxyGeneratorInterface::class);
26
        $this->proxyCacheWarmer = new ProxyCacheWarmer($this->proxyGenerator);
27
    }
28
29
    public function testIsOptional(): void
30
    {
31
        $this->assertFalse($this->proxyCacheWarmer->isOptional());
32
    }
33
34
    public function testWarmUp(): void
35
    {
36
        $this->proxyGenerator
37
            ->expects($this->once())
38
            ->method('warmUp')
39
            ->with(ProxyCacheWarmer::PROXY_CLASSES);
40
41
        $this->proxyCacheWarmer->warmUp('/cache/dir');
42
    }
43
}
44