|
@@ 171-182 (lines=12) @@
|
| 168 |
|
/** |
| 169 |
|
* @return BuiltInFunctionsExtension |
| 170 |
|
*/ |
| 171 |
|
private function getExtension() |
| 172 |
|
{ |
| 173 |
|
$now = new \DateTime('2012-06-03T22:22:22+0200'); |
| 174 |
|
|
| 175 |
|
$tokenStorage = $this->prophesize(TokenStorageInterface::class); |
| 176 |
|
$provider = $this->prophesize(CurrentDateTimeProvider::class); |
| 177 |
|
$provider->get()->willReturn($now); |
| 178 |
|
$entityManager = $this->prophesize(EntityManager::class); |
| 179 |
|
$extension = new BuiltInFunctionsExtension($tokenStorage->reveal(), $provider->reveal(), $entityManager->reveal(), 'TestUser'); |
| 180 |
|
|
| 181 |
|
return $extension; |
| 182 |
|
} |
| 183 |
|
|
| 184 |
|
/** |
| 185 |
|
* @return BuiltInFunctionsExtension |
|
@@ 187-199 (lines=13) @@
|
| 184 |
|
/** |
| 185 |
|
* @return BuiltInFunctionsExtension |
| 186 |
|
*/ |
| 187 |
|
private function getExtensionForUserRelatedTests() |
| 188 |
|
{ |
| 189 |
|
$now = new \DateTime('2012-06-03T22:22:22+0200'); |
| 190 |
|
|
| 191 |
|
$tokenStorageProphecy = $this->getTokenStorageWithCurrentUser(); |
| 192 |
|
$provider = $this->prophesize(CurrentDateTimeProvider::class); |
| 193 |
|
$entityManagerProphecy = $this->getEntityManagerWithUserRepository(); |
| 194 |
|
|
| 195 |
|
$provider->get()->willReturn($now); |
| 196 |
|
$extension = new BuiltInFunctionsExtension($tokenStorageProphecy->reveal(), $provider->reveal(), $entityManagerProphecy->reveal(), 'TestUser'); |
| 197 |
|
|
| 198 |
|
return $extension; |
| 199 |
|
} |
| 200 |
|
|
| 201 |
|
/** |
| 202 |
|
* @return TokenStorage |