|
@@ 79-97 (lines=19) @@
|
| 76 |
|
$this->transform($qb, $dqlAlias)->shouldReturn($expression); |
| 77 |
|
} |
| 78 |
|
|
| 79 |
|
public function it_is_transformable_custom_string_function( |
| 80 |
|
QueryBuilder $qb, |
| 81 |
|
EntityManager $em, |
| 82 |
|
Configuration $configuration |
| 83 |
|
) { |
| 84 |
|
$dqlAlias = 'a'; |
| 85 |
|
$functionName = 'foo'; |
| 86 |
|
$expression = 'foo(a.foo)'; |
| 87 |
|
|
| 88 |
|
$qb->getEntityManager()->willReturn($em); |
| 89 |
|
$em->getConfiguration()->willReturn($configuration); |
| 90 |
|
$configuration->getCustomStringFunction($functionName)->willReturn('ToStringClass'); |
| 91 |
|
$configuration->getCustomNumericFunction($functionName)->willReturn(null); |
| 92 |
|
$configuration->getCustomDatetimeFunction($functionName)->willReturn(null); |
| 93 |
|
|
| 94 |
|
$this->beConstructedWith($functionName, 'foo'); |
| 95 |
|
|
| 96 |
|
$this->transform($qb, $dqlAlias)->shouldReturn($expression); |
| 97 |
|
} |
| 98 |
|
|
| 99 |
|
public function it_is_transformable_custom_numeric_function( |
| 100 |
|
QueryBuilder $qb, |
|
@@ 99-117 (lines=19) @@
|
| 96 |
|
$this->transform($qb, $dqlAlias)->shouldReturn($expression); |
| 97 |
|
} |
| 98 |
|
|
| 99 |
|
public function it_is_transformable_custom_numeric_function( |
| 100 |
|
QueryBuilder $qb, |
| 101 |
|
EntityManager $em, |
| 102 |
|
Configuration $configuration |
| 103 |
|
) { |
| 104 |
|
$dqlAlias = 'a'; |
| 105 |
|
$functionName = 'foo'; |
| 106 |
|
$expression = 'foo(a.foo)'; |
| 107 |
|
|
| 108 |
|
$qb->getEntityManager()->willReturn($em); |
| 109 |
|
$em->getConfiguration()->willReturn($configuration); |
| 110 |
|
$configuration->getCustomStringFunction($functionName)->willReturn(null); |
| 111 |
|
$configuration->getCustomNumericFunction($functionName)->willReturn('ToNumericClass'); |
| 112 |
|
$configuration->getCustomDatetimeFunction($functionName)->willReturn(null); |
| 113 |
|
|
| 114 |
|
$this->beConstructedWith($functionName, 'foo'); |
| 115 |
|
|
| 116 |
|
$this->transform($qb, $dqlAlias)->shouldReturn($expression); |
| 117 |
|
} |
| 118 |
|
|
| 119 |
|
public function it_is_transformable_custom_datetime_function( |
| 120 |
|
QueryBuilder $qb, |
|
@@ 119-137 (lines=19) @@
|
| 116 |
|
$this->transform($qb, $dqlAlias)->shouldReturn($expression); |
| 117 |
|
} |
| 118 |
|
|
| 119 |
|
public function it_is_transformable_custom_datetime_function( |
| 120 |
|
QueryBuilder $qb, |
| 121 |
|
EntityManager $em, |
| 122 |
|
Configuration $configuration |
| 123 |
|
) { |
| 124 |
|
$dqlAlias = 'a'; |
| 125 |
|
$functionName = 'foo'; |
| 126 |
|
$expression = 'foo(a.foo)'; |
| 127 |
|
|
| 128 |
|
$qb->getEntityManager()->willReturn($em); |
| 129 |
|
$em->getConfiguration()->willReturn($configuration); |
| 130 |
|
$configuration->getCustomStringFunction($functionName)->willReturn(null); |
| 131 |
|
$configuration->getCustomNumericFunction($functionName)->willReturn(null); |
| 132 |
|
$configuration->getCustomDatetimeFunction($functionName)->willReturn('ToDatetimeClass'); |
| 133 |
|
|
| 134 |
|
$this->beConstructedWith($functionName, 'foo'); |
| 135 |
|
|
| 136 |
|
$this->transform($qb, $dqlAlias)->shouldReturn($expression); |
| 137 |
|
} |
| 138 |
|
|
| 139 |
|
public function it_is_transformable_undefined_function( |
| 140 |
|
QueryBuilder $qb, |