Completed
Push — patch-meta ( 5bd3e7 )
by Tobias
08:29
created

CacheSpec::it_caches_query_for_given_time()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
3
namespace tests\Happyr\DoctrineSpecification\Result;
4
5
use Doctrine\ORM\AbstractQuery;
6
use Happyr\DoctrineSpecification\Result\Cache;
7
use PhpSpec\ObjectBehavior;
8
9
/**
10
 * @mixin Cache
11
 */
12
class CacheSpec extends ObjectBehavior
13
{
14
    private $lifetime = 3600;
15
16
    public function let()
17
    {
18
        $this->beConstructedWith($this->lifetime);
19
    }
20
21
    public function it_is_a_specification()
22
    {
23
        $this->shouldBeAnInstanceOf('Happyr\DoctrineSpecification\Result\ResultModifier');
24
    }
25
26
    public function it_caches_query_for_given_time(AbstractQuery $query)
27
    {
28
        $query->setResultCacheLifetime($this->lifetime)->shouldBeCalled();
29
30
        $this->modify($query);
31
    }
32
}
33