| @@ 26-62 (lines=37) @@ | ||
| 23 | /** |
|
| 24 | * @mixin AddSelect |
|
| 25 | */ |
|
| 26 | final class AddSelectSpec extends ObjectBehavior |
|
| 27 | { |
|
| 28 | public function let(): void |
|
| 29 | { |
|
| 30 | $this->beConstructedWith('foo'); |
|
| 31 | } |
|
| 32 | ||
| 33 | public function it_is_a_add_select(): void |
|
| 34 | { |
|
| 35 | $this->shouldBeAnInstanceOf(AddSelect::class); |
|
| 36 | } |
|
| 37 | ||
| 38 | public function it_is_a_query_modifier(): void |
|
| 39 | { |
|
| 40 | $this->shouldHaveType(QueryModifier::class); |
|
| 41 | } |
|
| 42 | ||
| 43 | public function it_add_select_single_filed(QueryBuilder $qb): void |
|
| 44 | { |
|
| 45 | $qb->addSelect(['a.foo'])->shouldBeCalled(); |
|
| 46 | $this->modify($qb, 'a'); |
|
| 47 | } |
|
| 48 | ||
| 49 | public function it_add_select_several_fields(QueryBuilder $qb): void |
|
| 50 | { |
|
| 51 | $this->beConstructedWith('foo', 'bar'); |
|
| 52 | $qb->addSelect(['b.foo', 'b.bar'])->shouldBeCalled(); |
|
| 53 | $this->modify($qb, 'b'); |
|
| 54 | } |
|
| 55 | ||
| 56 | public function it_add_select_operand(QueryBuilder $qb): void |
|
| 57 | { |
|
| 58 | $this->beConstructedWith('foo', new Field('bar')); |
|
| 59 | $qb->addSelect(['b.foo', 'b.bar'])->shouldBeCalled(); |
|
| 60 | $this->modify($qb, 'b'); |
|
| 61 | } |
|
| 62 | } |
|
| 63 | ||
| @@ 26-62 (lines=37) @@ | ||
| 23 | /** |
|
| 24 | * @mixin Select |
|
| 25 | */ |
|
| 26 | final class SelectSpec extends ObjectBehavior |
|
| 27 | { |
|
| 28 | public function let(): void |
|
| 29 | { |
|
| 30 | $this->beConstructedWith('foo'); |
|
| 31 | } |
|
| 32 | ||
| 33 | public function it_is_a_select(): void |
|
| 34 | { |
|
| 35 | $this->shouldBeAnInstanceOf(Select::class); |
|
| 36 | } |
|
| 37 | ||
| 38 | public function it_is_a_query_modifier(): void |
|
| 39 | { |
|
| 40 | $this->shouldHaveType(QueryModifier::class); |
|
| 41 | } |
|
| 42 | ||
| 43 | public function it_select_single_filed(QueryBuilder $qb): void |
|
| 44 | { |
|
| 45 | $qb->select(['a.foo'])->shouldBeCalled(); |
|
| 46 | $this->modify($qb, 'a'); |
|
| 47 | } |
|
| 48 | ||
| 49 | public function it_select_several_fields(QueryBuilder $qb): void |
|
| 50 | { |
|
| 51 | $this->beConstructedWith('foo', 'bar'); |
|
| 52 | $qb->select(['b.foo', 'b.bar'])->shouldBeCalled(); |
|
| 53 | $this->modify($qb, 'b'); |
|
| 54 | } |
|
| 55 | ||
| 56 | public function it_select_operand(QueryBuilder $qb): void |
|
| 57 | { |
|
| 58 | $this->beConstructedWith('foo', new Field('bar')); |
|
| 59 | $qb->select(['b.foo', 'b.bar'])->shouldBeCalled(); |
|
| 60 | $this->modify($qb, 'b'); |
|
| 61 | } |
|
| 62 | } |
|
| 63 | ||