| @@ 15-51 (lines=37) @@ | ||
| 12 | /** |
|
| 13 | * @mixin Addition |
|
| 14 | */ |
|
| 15 | class AdditionSpec extends ObjectBehavior |
|
| 16 | { |
|
| 17 | private $field = 'foo'; |
|
| 18 | ||
| 19 | private $value = 'bar'; |
|
| 20 | ||
| 21 | public function let() |
|
| 22 | { |
|
| 23 | $this->beConstructedWith($this->field, $this->value); |
|
| 24 | } |
|
| 25 | ||
| 26 | public function it_is_a_add() |
|
| 27 | { |
|
| 28 | $this->shouldBeAnInstanceOf(Addition::class); |
|
| 29 | } |
|
| 30 | ||
| 31 | public function it_is_a_operand() |
|
| 32 | { |
|
| 33 | $this->shouldBeAnInstanceOf(Operand::class); |
|
| 34 | } |
|
| 35 | ||
| 36 | public function it_is_transformable(QueryBuilder $qb, ArrayCollection $parameters) |
|
| 37 | { |
|
| 38 | $qb->getParameters()->willReturn($parameters); |
|
| 39 | $parameters->count()->willReturn(10); |
|
| 40 | ||
| 41 | $qb->setParameter('comparison_10', $this->value, null)->shouldBeCalled(); |
|
| 42 | ||
| 43 | $this->transform($qb, 'a')->shouldReturn('(a.foo + :comparison_10)'); |
|
| 44 | } |
|
| 45 | ||
| 46 | public function it_is_transformable_add_fields(QueryBuilder $qb) |
|
| 47 | { |
|
| 48 | $this->beConstructedWith(new Field('foo'), new Field('bar')); |
|
| 49 | $this->transform($qb, 'a')->shouldReturn('(a.foo + a.bar)'); |
|
| 50 | } |
|
| 51 | } |
|
| 52 | ||
| @@ 15-51 (lines=37) @@ | ||
| 12 | /** |
|
| 13 | * @mixin BitAnd |
|
| 14 | */ |
|
| 15 | class BitAndSpec extends ObjectBehavior |
|
| 16 | { |
|
| 17 | private $field = 'foo'; |
|
| 18 | ||
| 19 | private $value = 'bar'; |
|
| 20 | ||
| 21 | public function let() |
|
| 22 | { |
|
| 23 | $this->beConstructedWith($this->field, $this->value); |
|
| 24 | } |
|
| 25 | ||
| 26 | public function it_is_a_bit_and() |
|
| 27 | { |
|
| 28 | $this->shouldBeAnInstanceOf(BitAnd::class); |
|
| 29 | } |
|
| 30 | ||
| 31 | public function it_is_a_operand() |
|
| 32 | { |
|
| 33 | $this->shouldBeAnInstanceOf(Operand::class); |
|
| 34 | } |
|
| 35 | ||
| 36 | public function it_is_transformable(QueryBuilder $qb, ArrayCollection $parameters) |
|
| 37 | { |
|
| 38 | $qb->getParameters()->willReturn($parameters); |
|
| 39 | $parameters->count()->willReturn(10); |
|
| 40 | ||
| 41 | $qb->setParameter('comparison_10', $this->value, null)->shouldBeCalled(); |
|
| 42 | ||
| 43 | $this->transform($qb, 'a')->shouldReturn('(a.foo & :comparison_10)'); |
|
| 44 | } |
|
| 45 | ||
| 46 | public function it_is_transformable_add_fields(QueryBuilder $qb) |
|
| 47 | { |
|
| 48 | $this->beConstructedWith(new Field('foo'), new Field('bar')); |
|
| 49 | $this->transform($qb, 'a')->shouldReturn('(a.foo & a.bar)'); |
|
| 50 | } |
|
| 51 | } |
|
| 52 | ||
| @@ 15-51 (lines=37) @@ | ||
| 12 | /** |
|
| 13 | * @mixin BitLeftShift |
|
| 14 | */ |
|
| 15 | class BitLeftShiftSpec extends ObjectBehavior |
|
| 16 | { |
|
| 17 | private $field = 'foo'; |
|
| 18 | ||
| 19 | private $value = 'bar'; |
|
| 20 | ||
| 21 | public function let() |
|
| 22 | { |
|
| 23 | $this->beConstructedWith($this->field, $this->value); |
|
| 24 | } |
|
| 25 | ||
| 26 | public function it_is_a_bit_left_shift() |
|
| 27 | { |
|
| 28 | $this->shouldBeAnInstanceOf(BitLeftShift::class); |
|
| 29 | } |
|
| 30 | ||
| 31 | public function it_is_a_operand() |
|
| 32 | { |
|
| 33 | $this->shouldBeAnInstanceOf(Operand::class); |
|
| 34 | } |
|
| 35 | ||
| 36 | public function it_is_transformable(QueryBuilder $qb, ArrayCollection $parameters) |
|
| 37 | { |
|
| 38 | $qb->getParameters()->willReturn($parameters); |
|
| 39 | $parameters->count()->willReturn(10); |
|
| 40 | ||
| 41 | $qb->setParameter('comparison_10', $this->value, null)->shouldBeCalled(); |
|
| 42 | ||
| 43 | $this->transform($qb, 'a')->shouldReturn('(a.foo << :comparison_10)'); |
|
| 44 | } |
|
| 45 | ||
| 46 | public function it_is_transformable_add_fields(QueryBuilder $qb) |
|
| 47 | { |
|
| 48 | $this->beConstructedWith(new Field('foo'), new Field('bar')); |
|
| 49 | $this->transform($qb, 'a')->shouldReturn('(a.foo << a.bar)'); |
|
| 50 | } |
|
| 51 | } |
|
| 52 | ||
| @@ 15-51 (lines=37) @@ | ||
| 12 | /** |
|
| 13 | * @mixin BitOr |
|
| 14 | */ |
|
| 15 | class BitOrSpec extends ObjectBehavior |
|
| 16 | { |
|
| 17 | private $field = 'foo'; |
|
| 18 | ||
| 19 | private $value = 'bar'; |
|
| 20 | ||
| 21 | public function let() |
|
| 22 | { |
|
| 23 | $this->beConstructedWith($this->field, $this->value); |
|
| 24 | } |
|
| 25 | ||
| 26 | public function it_is_a_bit_or() |
|
| 27 | { |
|
| 28 | $this->shouldBeAnInstanceOf(BitOr::class); |
|
| 29 | } |
|
| 30 | ||
| 31 | public function it_is_a_operand() |
|
| 32 | { |
|
| 33 | $this->shouldBeAnInstanceOf(Operand::class); |
|
| 34 | } |
|
| 35 | ||
| 36 | public function it_is_transformable(QueryBuilder $qb, ArrayCollection $parameters) |
|
| 37 | { |
|
| 38 | $qb->getParameters()->willReturn($parameters); |
|
| 39 | $parameters->count()->willReturn(10); |
|
| 40 | ||
| 41 | $qb->setParameter('comparison_10', $this->value, null)->shouldBeCalled(); |
|
| 42 | ||
| 43 | $this->transform($qb, 'a')->shouldReturn('(a.foo | :comparison_10)'); |
|
| 44 | } |
|
| 45 | ||
| 46 | public function it_is_transformable_add_fields(QueryBuilder $qb) |
|
| 47 | { |
|
| 48 | $this->beConstructedWith(new Field('foo'), new Field('bar')); |
|
| 49 | $this->transform($qb, 'a')->shouldReturn('(a.foo | a.bar)'); |
|
| 50 | } |
|
| 51 | } |
|
| 52 | ||
| @@ 15-51 (lines=37) @@ | ||
| 12 | /** |
|
| 13 | * @mixin BitRightShift |
|
| 14 | */ |
|
| 15 | class BitRightShiftSpec extends ObjectBehavior |
|
| 16 | { |
|
| 17 | private $field = 'foo'; |
|
| 18 | ||
| 19 | private $value = 'bar'; |
|
| 20 | ||
| 21 | public function let() |
|
| 22 | { |
|
| 23 | $this->beConstructedWith($this->field, $this->value); |
|
| 24 | } |
|
| 25 | ||
| 26 | public function it_is_a_bit_right_shift() |
|
| 27 | { |
|
| 28 | $this->shouldBeAnInstanceOf(BitRightShift::class); |
|
| 29 | } |
|
| 30 | ||
| 31 | public function it_is_a_operand() |
|
| 32 | { |
|
| 33 | $this->shouldBeAnInstanceOf(Operand::class); |
|
| 34 | } |
|
| 35 | ||
| 36 | public function it_is_transformable(QueryBuilder $qb, ArrayCollection $parameters) |
|
| 37 | { |
|
| 38 | $qb->getParameters()->willReturn($parameters); |
|
| 39 | $parameters->count()->willReturn(10); |
|
| 40 | ||
| 41 | $qb->setParameter('comparison_10', $this->value, null)->shouldBeCalled(); |
|
| 42 | ||
| 43 | $this->transform($qb, 'a')->shouldReturn('(a.foo >> :comparison_10)'); |
|
| 44 | } |
|
| 45 | ||
| 46 | public function it_is_transformable_add_fields(QueryBuilder $qb) |
|
| 47 | { |
|
| 48 | $this->beConstructedWith(new Field('foo'), new Field('bar')); |
|
| 49 | $this->transform($qb, 'a')->shouldReturn('(a.foo >> a.bar)'); |
|
| 50 | } |
|
| 51 | } |
|
| 52 | ||
| @@ 15-51 (lines=37) @@ | ||
| 12 | /** |
|
| 13 | * @mixin BitXor |
|
| 14 | */ |
|
| 15 | class BitXorSpec extends ObjectBehavior |
|
| 16 | { |
|
| 17 | private $field = 'foo'; |
|
| 18 | ||
| 19 | private $value = 'bar'; |
|
| 20 | ||
| 21 | public function let() |
|
| 22 | { |
|
| 23 | $this->beConstructedWith($this->field, $this->value); |
|
| 24 | } |
|
| 25 | ||
| 26 | public function it_is_a_bit_xor() |
|
| 27 | { |
|
| 28 | $this->shouldBeAnInstanceOf(BitXor::class); |
|
| 29 | } |
|
| 30 | ||
| 31 | public function it_is_a_operand() |
|
| 32 | { |
|
| 33 | $this->shouldBeAnInstanceOf(Operand::class); |
|
| 34 | } |
|
| 35 | ||
| 36 | public function it_is_transformable(QueryBuilder $qb, ArrayCollection $parameters) |
|
| 37 | { |
|
| 38 | $qb->getParameters()->willReturn($parameters); |
|
| 39 | $parameters->count()->willReturn(10); |
|
| 40 | ||
| 41 | $qb->setParameter('comparison_10', $this->value, null)->shouldBeCalled(); |
|
| 42 | ||
| 43 | $this->transform($qb, 'a')->shouldReturn('(a.foo ^ :comparison_10)'); |
|
| 44 | } |
|
| 45 | ||
| 46 | public function it_is_transformable_add_fields(QueryBuilder $qb) |
|
| 47 | { |
|
| 48 | $this->beConstructedWith(new Field('foo'), new Field('bar')); |
|
| 49 | $this->transform($qb, 'a')->shouldReturn('(a.foo ^ a.bar)'); |
|
| 50 | } |
|
| 51 | } |
|
| 52 | ||
| @@ 15-51 (lines=37) @@ | ||
| 12 | /** |
|
| 13 | * @mixin Division |
|
| 14 | */ |
|
| 15 | class DivisionSpec extends ObjectBehavior |
|
| 16 | { |
|
| 17 | private $field = 'foo'; |
|
| 18 | ||
| 19 | private $value = 'bar'; |
|
| 20 | ||
| 21 | public function let() |
|
| 22 | { |
|
| 23 | $this->beConstructedWith($this->field, $this->value); |
|
| 24 | } |
|
| 25 | ||
| 26 | public function it_is_a_div() |
|
| 27 | { |
|
| 28 | $this->shouldBeAnInstanceOf(Division::class); |
|
| 29 | } |
|
| 30 | ||
| 31 | public function it_is_a_operand() |
|
| 32 | { |
|
| 33 | $this->shouldBeAnInstanceOf(Operand::class); |
|
| 34 | } |
|
| 35 | ||
| 36 | public function it_is_transformable(QueryBuilder $qb, ArrayCollection $parameters) |
|
| 37 | { |
|
| 38 | $qb->getParameters()->willReturn($parameters); |
|
| 39 | $parameters->count()->willReturn(10); |
|
| 40 | ||
| 41 | $qb->setParameter('comparison_10', $this->value, null)->shouldBeCalled(); |
|
| 42 | ||
| 43 | $this->transform($qb, 'a')->shouldReturn('(a.foo / :comparison_10)'); |
|
| 44 | } |
|
| 45 | ||
| 46 | public function it_is_transformable_add_fields(QueryBuilder $qb) |
|
| 47 | { |
|
| 48 | $this->beConstructedWith(new Field('foo'), new Field('bar')); |
|
| 49 | $this->transform($qb, 'a')->shouldReturn('(a.foo / a.bar)'); |
|
| 50 | } |
|
| 51 | } |
|
| 52 | ||
| @@ 15-51 (lines=37) @@ | ||
| 12 | /** |
|
| 13 | * @mixin Modulo |
|
| 14 | */ |
|
| 15 | class ModuloSpec extends ObjectBehavior |
|
| 16 | { |
|
| 17 | private $field = 'foo'; |
|
| 18 | ||
| 19 | private $value = 'bar'; |
|
| 20 | ||
| 21 | public function let() |
|
| 22 | { |
|
| 23 | $this->beConstructedWith($this->field, $this->value); |
|
| 24 | } |
|
| 25 | ||
| 26 | public function it_is_a_mod() |
|
| 27 | { |
|
| 28 | $this->shouldBeAnInstanceOf(Modulo::class); |
|
| 29 | } |
|
| 30 | ||
| 31 | public function it_is_a_operand() |
|
| 32 | { |
|
| 33 | $this->shouldBeAnInstanceOf(Operand::class); |
|
| 34 | } |
|
| 35 | ||
| 36 | public function it_is_transformable(QueryBuilder $qb, ArrayCollection $parameters) |
|
| 37 | { |
|
| 38 | $qb->getParameters()->willReturn($parameters); |
|
| 39 | $parameters->count()->willReturn(10); |
|
| 40 | ||
| 41 | $qb->setParameter('comparison_10', $this->value, null)->shouldBeCalled(); |
|
| 42 | ||
| 43 | $this->transform($qb, 'a')->shouldReturn('(a.foo % :comparison_10)'); |
|
| 44 | } |
|
| 45 | ||
| 46 | public function it_is_transformable_add_fields(QueryBuilder $qb) |
|
| 47 | { |
|
| 48 | $this->beConstructedWith(new Field('foo'), new Field('bar')); |
|
| 49 | $this->transform($qb, 'a')->shouldReturn('(a.foo % a.bar)'); |
|
| 50 | } |
|
| 51 | } |
|
| 52 | ||
| @@ 15-51 (lines=37) @@ | ||
| 12 | /** |
|
| 13 | * @mixin Multiplication |
|
| 14 | */ |
|
| 15 | class MultiplicationSpec extends ObjectBehavior |
|
| 16 | { |
|
| 17 | private $field = 'foo'; |
|
| 18 | ||
| 19 | private $value = 'bar'; |
|
| 20 | ||
| 21 | public function let() |
|
| 22 | { |
|
| 23 | $this->beConstructedWith($this->field, $this->value); |
|
| 24 | } |
|
| 25 | ||
| 26 | public function it_is_a_mul() |
|
| 27 | { |
|
| 28 | $this->shouldBeAnInstanceOf(Multiplication::class); |
|
| 29 | } |
|
| 30 | ||
| 31 | public function it_is_a_operand() |
|
| 32 | { |
|
| 33 | $this->shouldBeAnInstanceOf(Operand::class); |
|
| 34 | } |
|
| 35 | ||
| 36 | public function it_is_transformable(QueryBuilder $qb, ArrayCollection $parameters) |
|
| 37 | { |
|
| 38 | $qb->getParameters()->willReturn($parameters); |
|
| 39 | $parameters->count()->willReturn(10); |
|
| 40 | ||
| 41 | $qb->setParameter('comparison_10', $this->value, null)->shouldBeCalled(); |
|
| 42 | ||
| 43 | $this->transform($qb, 'a')->shouldReturn('(a.foo * :comparison_10)'); |
|
| 44 | } |
|
| 45 | ||
| 46 | public function it_is_transformable_add_fields(QueryBuilder $qb) |
|
| 47 | { |
|
| 48 | $this->beConstructedWith(new Field('foo'), new Field('bar')); |
|
| 49 | $this->transform($qb, 'a')->shouldReturn('(a.foo * a.bar)'); |
|
| 50 | } |
|
| 51 | } |
|
| 52 | ||
| @@ 15-51 (lines=37) @@ | ||
| 12 | /** |
|
| 13 | * @mixin Subtraction |
|
| 14 | */ |
|
| 15 | class SubtractionSpec extends ObjectBehavior |
|
| 16 | { |
|
| 17 | private $field = 'foo'; |
|
| 18 | ||
| 19 | private $value = 'bar'; |
|
| 20 | ||
| 21 | public function let() |
|
| 22 | { |
|
| 23 | $this->beConstructedWith($this->field, $this->value); |
|
| 24 | } |
|
| 25 | ||
| 26 | public function it_is_a_sub() |
|
| 27 | { |
|
| 28 | $this->shouldBeAnInstanceOf(Subtraction::class); |
|
| 29 | } |
|
| 30 | ||
| 31 | public function it_is_a_operand() |
|
| 32 | { |
|
| 33 | $this->shouldBeAnInstanceOf(Operand::class); |
|
| 34 | } |
|
| 35 | ||
| 36 | public function it_is_transformable(QueryBuilder $qb, ArrayCollection $parameters) |
|
| 37 | { |
|
| 38 | $qb->getParameters()->willReturn($parameters); |
|
| 39 | $parameters->count()->willReturn(10); |
|
| 40 | ||
| 41 | $qb->setParameter('comparison_10', $this->value, null)->shouldBeCalled(); |
|
| 42 | ||
| 43 | $this->transform($qb, 'a')->shouldReturn('(a.foo - :comparison_10)'); |
|
| 44 | } |
|
| 45 | ||
| 46 | public function it_is_transformable_add_fields(QueryBuilder $qb) |
|
| 47 | { |
|
| 48 | $this->beConstructedWith(new Field('foo'), new Field('bar')); |
|
| 49 | $this->transform($qb, 'a')->shouldReturn('(a.foo - a.bar)'); |
|
| 50 | } |
|
| 51 | } |
|
| 52 | ||