@@ 12-35 (lines=24) @@ | ||
9 | /** |
|
10 | * @mixin Alias |
|
11 | */ |
|
12 | class AliasSpec extends ObjectBehavior |
|
13 | { |
|
14 | private $alias = 'foo'; |
|
15 | ||
16 | public function let() |
|
17 | { |
|
18 | $this->beConstructedWith($this->alias); |
|
19 | } |
|
20 | ||
21 | public function it_is_a_alias() |
|
22 | { |
|
23 | $this->shouldBeAnInstanceOf('Happyr\DoctrineSpecification\Operand\Alias'); |
|
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 | $this->transform($qb, 'a')->shouldReturn($this->alias); |
|
34 | } |
|
35 | } |
|
36 |
@@ 12-35 (lines=24) @@ | ||
9 | /** |
|
10 | * @mixin SelectEntity |
|
11 | */ |
|
12 | class SelectEntitySpec extends ObjectBehavior |
|
13 | { |
|
14 | private $dqlAlias = 'u'; |
|
15 | ||
16 | public function let() |
|
17 | { |
|
18 | $this->beConstructedWith($this->dqlAlias); |
|
19 | } |
|
20 | ||
21 | public function it_is_a_select_entity() |
|
22 | { |
|
23 | $this->shouldBeAnInstanceOf('Happyr\DoctrineSpecification\Query\Selection\SelectEntity'); |
|
24 | } |
|
25 | ||
26 | public function it_is_a_selection() |
|
27 | { |
|
28 | $this->shouldBeAnInstanceOf('Happyr\DoctrineSpecification\Query\Selection\Selection'); |
|
29 | } |
|
30 | ||
31 | public function it_is_transformable(QueryBuilder $qb) |
|
32 | { |
|
33 | $this->transform($qb, 'a')->shouldReturn($this->dqlAlias); |
|
34 | } |
|
35 | } |
|
36 |
@@ 12-35 (lines=24) @@ | ||
9 | /** |
|
10 | * @mixin BitNot |
|
11 | */ |
|
12 | class BitNotSpec extends ObjectBehavior |
|
13 | { |
|
14 | private $field = 'foo'; |
|
15 | ||
16 | public function let() |
|
17 | { |
|
18 | $this->beConstructedWith($this->field); |
|
19 | } |
|
20 | ||
21 | public function it_is_a_bit_not() |
|
22 | { |
|
23 | $this->shouldBeAnInstanceOf('Happyr\DoctrineSpecification\Operand\BitNot'); |
|
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 | $this->transform($qb, 'a')->shouldReturn('(~ a.foo)'); |
|
34 | } |
|
35 | } |
|
36 |