| @@ 24-47 (lines=24) @@ | ||
| 21 | /** |
|
| 22 | * @mixin Alias |
|
| 23 | */ |
|
| 24 | class AliasSpec extends ObjectBehavior |
|
| 25 | { |
|
| 26 | private $alias = 'foo'; |
|
| 27 | ||
| 28 | public function let() |
|
| 29 | { |
|
| 30 | $this->beConstructedWith($this->alias); |
|
| 31 | } |
|
| 32 | ||
| 33 | public function it_is_a_alias() |
|
| 34 | { |
|
| 35 | $this->shouldBeAnInstanceOf(Alias::class); |
|
| 36 | } |
|
| 37 | ||
| 38 | public function it_is_a_operand() |
|
| 39 | { |
|
| 40 | $this->shouldBeAnInstanceOf(Operand::class); |
|
| 41 | } |
|
| 42 | ||
| 43 | public function it_is_transformable(QueryBuilder $qb) |
|
| 44 | { |
|
| 45 | $this->transform($qb, 'a')->shouldReturn($this->alias); |
|
| 46 | } |
|
| 47 | } |
|
| 48 | ||
| @@ 24-47 (lines=24) @@ | ||
| 21 | /** |
|
| 22 | * @mixin CountDistinct |
|
| 23 | */ |
|
| 24 | class CountDistinctSpec extends ObjectBehavior |
|
| 25 | { |
|
| 26 | private $field = 'foo'; |
|
| 27 | ||
| 28 | public function let() |
|
| 29 | { |
|
| 30 | $this->beConstructedWith($this->field); |
|
| 31 | } |
|
| 32 | ||
| 33 | public function it_is_a_count_distinct() |
|
| 34 | { |
|
| 35 | $this->shouldBeAnInstanceOf(CountDistinct::class); |
|
| 36 | } |
|
| 37 | ||
| 38 | public function it_is_a_operand() |
|
| 39 | { |
|
| 40 | $this->shouldBeAnInstanceOf(Operand::class); |
|
| 41 | } |
|
| 42 | ||
| 43 | public function it_is_transformable(QueryBuilder $qb) |
|
| 44 | { |
|
| 45 | $this->transform($qb, 'a')->shouldReturn('COUNT(DISTINCT a.foo)'); |
|
| 46 | } |
|
| 47 | } |
|
| 48 | ||
| @@ 24-47 (lines=24) @@ | ||
| 21 | /** |
|
| 22 | * @mixin SelectEntity |
|
| 23 | */ |
|
| 24 | class SelectEntitySpec extends ObjectBehavior |
|
| 25 | { |
|
| 26 | private $dqlAlias = 'u'; |
|
| 27 | ||
| 28 | public function let() |
|
| 29 | { |
|
| 30 | $this->beConstructedWith($this->dqlAlias); |
|
| 31 | } |
|
| 32 | ||
| 33 | public function it_is_a_select_entity() |
|
| 34 | { |
|
| 35 | $this->shouldBeAnInstanceOf(SelectEntity::class); |
|
| 36 | } |
|
| 37 | ||
| 38 | public function it_is_a_selection() |
|
| 39 | { |
|
| 40 | $this->shouldBeAnInstanceOf(Selection::class); |
|
| 41 | } |
|
| 42 | ||
| 43 | public function it_is_transformable(QueryBuilder $qb) |
|
| 44 | { |
|
| 45 | $this->transform($qb, 'a')->shouldReturn($this->dqlAlias); |
|
| 46 | } |
|
| 47 | } |
|
| 48 | ||