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