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

AsSingleScalarSpec   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A it_is_a_result_modifier() 0 4 1
A it_sets_hydration_mode_to_object() 0 6 1
1
<?php
2
3
namespace tests\Happyr\DoctrineSpecification\Result;
4
5
use Doctrine\ORM\AbstractQuery;
6
use Doctrine\ORM\Query;
7
use Happyr\DoctrineSpecification\Result\AsSingleScalar;
8
use PhpSpec\ObjectBehavior;
9
10
/**
11
 * @mixin AsSingleScalar
12
 */
13
class AsSingleScalarSpec extends ObjectBehavior
14
{
15
    public function it_is_a_result_modifier()
16
    {
17
        $this->shouldBeAnInstanceOf('Happyr\DoctrineSpecification\Result\ResultModifier');
18
    }
19
20
    public function it_sets_hydration_mode_to_object(AbstractQuery $query)
21
    {
22
        $query->setHydrationMode(Query::HYDRATE_SINGLE_SCALAR)->shouldBeCalled();
23
24
        $this->modify($query);
25
    }
26
}
27