|
@@ 54-72 (lines=19) @@
|
| 51 |
|
$this->transform($qb, $dqlAlias)->shouldReturn($expression); |
| 52 |
|
} |
| 53 |
|
|
| 54 |
|
public function it_is_transformable_custom_string_function( |
| 55 |
|
QueryBuilder $qb, |
| 56 |
|
EntityManagerInterface $em, |
| 57 |
|
Configuration $configuration |
| 58 |
|
) { |
| 59 |
|
$dqlAlias = 'a'; |
| 60 |
|
$functionName = 'foo'; |
| 61 |
|
$expression = 'foo(a.foo)'; |
| 62 |
|
|
| 63 |
|
$qb->getEntityManager()->willReturn($em); |
| 64 |
|
$em->getConfiguration()->willReturn($configuration); |
| 65 |
|
$configuration->getCustomStringFunction($functionName)->willReturn('ToStringClass'); |
| 66 |
|
$configuration->getCustomNumericFunction($functionName)->willReturn(null); |
| 67 |
|
$configuration->getCustomDatetimeFunction($functionName)->willReturn(null); |
| 68 |
|
|
| 69 |
|
$this->beConstructedWith($functionName, 'foo'); |
| 70 |
|
|
| 71 |
|
$this->transform($qb, $dqlAlias)->shouldReturn($expression); |
| 72 |
|
} |
| 73 |
|
|
| 74 |
|
public function it_is_transformable_custom_numeric_function( |
| 75 |
|
QueryBuilder $qb, |
|
@@ 74-92 (lines=19) @@
|
| 71 |
|
$this->transform($qb, $dqlAlias)->shouldReturn($expression); |
| 72 |
|
} |
| 73 |
|
|
| 74 |
|
public function it_is_transformable_custom_numeric_function( |
| 75 |
|
QueryBuilder $qb, |
| 76 |
|
EntityManagerInterface $em, |
| 77 |
|
Configuration $configuration |
| 78 |
|
) { |
| 79 |
|
$dqlAlias = 'a'; |
| 80 |
|
$functionName = 'foo'; |
| 81 |
|
$expression = 'foo(a.foo)'; |
| 82 |
|
|
| 83 |
|
$qb->getEntityManager()->willReturn($em); |
| 84 |
|
$em->getConfiguration()->willReturn($configuration); |
| 85 |
|
$configuration->getCustomStringFunction($functionName)->willReturn(null); |
| 86 |
|
$configuration->getCustomNumericFunction($functionName)->willReturn('ToNumericClass'); |
| 87 |
|
$configuration->getCustomDatetimeFunction($functionName)->willReturn(null); |
| 88 |
|
|
| 89 |
|
$this->beConstructedWith($functionName, 'foo'); |
| 90 |
|
|
| 91 |
|
$this->transform($qb, $dqlAlias)->shouldReturn($expression); |
| 92 |
|
} |
| 93 |
|
|
| 94 |
|
public function it_is_transformable_custom_datetime_function( |
| 95 |
|
QueryBuilder $qb, |
|
@@ 94-112 (lines=19) @@
|
| 91 |
|
$this->transform($qb, $dqlAlias)->shouldReturn($expression); |
| 92 |
|
} |
| 93 |
|
|
| 94 |
|
public function it_is_transformable_custom_datetime_function( |
| 95 |
|
QueryBuilder $qb, |
| 96 |
|
EntityManagerInterface $em, |
| 97 |
|
Configuration $configuration |
| 98 |
|
) { |
| 99 |
|
$dqlAlias = 'a'; |
| 100 |
|
$functionName = 'foo'; |
| 101 |
|
$expression = 'foo(a.foo)'; |
| 102 |
|
|
| 103 |
|
$qb->getEntityManager()->willReturn($em); |
| 104 |
|
$em->getConfiguration()->willReturn($configuration); |
| 105 |
|
$configuration->getCustomStringFunction($functionName)->willReturn(null); |
| 106 |
|
$configuration->getCustomNumericFunction($functionName)->willReturn(null); |
| 107 |
|
$configuration->getCustomDatetimeFunction($functionName)->willReturn('ToDatetimeClass'); |
| 108 |
|
|
| 109 |
|
$this->beConstructedWith($functionName, 'foo'); |
| 110 |
|
|
| 111 |
|
$this->transform($qb, $dqlAlias)->shouldReturn($expression); |
| 112 |
|
} |
| 113 |
|
|
| 114 |
|
public function it_is_transformable_undefined_function( |
| 115 |
|
QueryBuilder $qb, |