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

FieldSpec::it_is_a_field()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
rs 10
cc 1
nc 1
nop 0
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