Completed
Push — 1.0 ( b7886a...4c0b42 )
by Peter
07:48 queued 11s
created

FieldSpec   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 1
dl 0
loc 27
c 0
b 0
f 0
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A let() 0 4 1
A it_is_a_field() 0 4 1
A it_is_a_operand() 0 4 1
A it_is_transformable() 0 7 1
1
<?php
2
3
namespace tests\Happyr\DoctrineSpecification\Operand;
4
5
use Doctrine\ORM\QueryBuilder;
6
use Happyr\DoctrineSpecification\Operand\Field;
7
use PhpSpec\ObjectBehavior;
8
9
/**
10
 * @mixin Field
11
 */
12
class FieldSpec extends ObjectBehavior
13
{
14
    private $fieldName = 'foo';
15
16
    public function let()
17
    {
18
        $this->beConstructedWith($this->fieldName);
19
    }
20
21
    public function it_is_a_field()
22
    {
23
        $this->shouldBeAnInstanceOf('Happyr\DoctrineSpecification\Operand\Field');
24
    }
25
26
    public function it_is_a_operand()
27
    {
28
        $this->shouldBeAnInstanceOf('Happyr\DoctrineSpecification\Operand\Operand');
29
    }
30
31
    public function it_is_transformable(QueryBuilder $qb)
32
    {
33
        $dqlAlias = 'a';
34
        $expression = 'a.foo';
35
36
        $this->transform($qb, $dqlAlias)->shouldReturn($expression);
37
    }
38
}
39