ArgumentToSelectionConverterSpec   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 0
loc 17
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A it_is_a_converter() 0 4 1
A it_not_convert_field_to_selection() 0 4 1
A it_convert_argument_to_field() 0 4 1
1
<?php
2
3
/**
4
 * This file is part of the Happyr Doctrine Specification package.
5
 *
6
 * (c) Tobias Nyholm <[email protected]>
7
 *     Kacper Gunia <[email protected]>
8
 *     Peter Gribanov <[email protected]>
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace tests\Happyr\DoctrineSpecification\Query\Selection;
15
16
use Happyr\DoctrineSpecification\Operand\Field;
17
use Happyr\DoctrineSpecification\Query\Selection\ArgumentToSelectionConverter;
18
use PhpSpec\ObjectBehavior;
19
20
/**
21
 * @mixin ArgumentToSelectionConverter
22
 */
23
class ArgumentToSelectionConverterSpec extends ObjectBehavior
24
{
25
    public function it_is_a_converter()
26
    {
27
        $this->shouldBeAnInstanceOf(ArgumentToSelectionConverter::class);
28
    }
29
30
    public function it_not_convert_field_to_selection(Field $field)
31
    {
32
        $this->toSelection($field)->shouldReturn($field);
33
    }
34
35
    public function it_convert_argument_to_field()
36
    {
37
        $this->toSelection('foo')->shouldBeAnInstanceOf(Field::class);
38
    }
39
}
40