Completed
Push — theme-bundle ( aad440...af4cdd )
by Kamil
15:45
created

TemplatePathsCacheClearerSpec::let()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
/*
4
 * This file is part of the Sylius package.
5
 *
6
 * (c) Paweł Jędrzejewski
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace spec\Sylius\Bundle\ThemeBundle\Templating\Cache\Clearer;
13
14
use Doctrine\Common\Cache\Cache;
15
use Doctrine\Common\Cache\ClearableCache;
16
use PhpSpec\ObjectBehavior;
17
use Prophecy\Argument;
18
use Sylius\Bundle\ThemeBundle\Templating\Cache\Clearer\TemplatePathsCacheClearer;
19
use Symfony\Component\HttpKernel\CacheClearer\CacheClearerInterface;
20
21
/**
22
 * @mixin TemplatePathsCacheClearer
23
 *
24
 * @author Kamil Kokot <[email protected]>
25
 */
26
class TemplatePathsCacheClearerSpec extends ObjectBehavior
27
{
28
    function let(Cache $cache)
29
    {
30
        $this->beConstructedWith($cache);
31
    }
32
33
    function it_is_initializable()
34
    {
35
        $this->shouldHaveType('Sylius\Bundle\ThemeBundle\Templating\Cache\Clearer\TemplatePathsCacheClearer');
36
    }
37
38
    function it_implements_cache_clearer_interface()
39
    {
40
        $this->shouldImplement(CacheClearerInterface::class);
41
    }
42
43
    function it_deletes_all_elements_if_cache_is_clearable(ClearableCache $cache)
44
    {
45
        $cache->deleteAll()->shouldBeCalled();
46
47
        $this->clear(null);
48
    }
49
50
    function it_does_not_throw_any_error_if_cache_is_not_clearable()
51
    {
52
        $this->clear(null);
53
    }
54
}
55