Completed
Push — master ( 162ff2...83d928 )
by Peter
08:18 queued 10s
created

DistinctSpec   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 2
dl 0
loc 18
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A it_is_a_distinct() 0 4 1
A it_is_a_query_modifier() 0 4 1
A it_add_having() 0 5 1
1
<?php
2
3
namespace tests\Happyr\DoctrineSpecification\Query;
4
5
use Doctrine\ORM\QueryBuilder;
6
use Happyr\DoctrineSpecification\Query\Distinct;
7
use Happyr\DoctrineSpecification\Query\QueryModifier;
8
use PhpSpec\ObjectBehavior;
9
10
/**
11
 * @mixin Distinct
12
 */
13
class DistinctSpec extends ObjectBehavior
14
{
15
    public function it_is_a_distinct()
16
    {
17
        $this->shouldBeAnInstanceOf(Distinct::class);
18
    }
19
20
    public function it_is_a_query_modifier()
21
    {
22
        $this->shouldHaveType(QueryModifier::class);
23
    }
24
25
    public function it_add_having(QueryBuilder $qb)
26
    {
27
        $qb->distinct()->shouldBeCalled();
28
        $this->modify($qb, 'a');
29
    }
30
}
31