@@ -88,18 +88,18 @@ discard block |
||
88 | 88 | { |
89 | 89 | $q = $this->_em->createQuery("select a from Doctrine\Tests\Models\CMS\CmsArticle a"); |
90 | 90 | $q2 = $q->expireQueryCache(true) |
91 | - ->setQueryCacheLifetime(3600) |
|
92 | - ->setQueryCacheDriver(null) |
|
93 | - ->expireResultCache(true) |
|
94 | - ->setHint('foo', 'bar') |
|
95 | - ->setHint('bar', 'baz') |
|
96 | - ->setParameter(1, 'bar') |
|
97 | - ->setParameters(new ArrayCollection([new Parameter(2, 'baz')])) |
|
98 | - ->setResultCacheDriver(null) |
|
99 | - ->setResultCacheId('foo') |
|
100 | - ->setDQL('foo') |
|
101 | - ->setFirstResult(10) |
|
102 | - ->setMaxResults(10); |
|
91 | + ->setQueryCacheLifetime(3600) |
|
92 | + ->setQueryCacheDriver(null) |
|
93 | + ->expireResultCache(true) |
|
94 | + ->setHint('foo', 'bar') |
|
95 | + ->setHint('bar', 'baz') |
|
96 | + ->setParameter(1, 'bar') |
|
97 | + ->setParameters(new ArrayCollection([new Parameter(2, 'baz')])) |
|
98 | + ->setResultCacheDriver(null) |
|
99 | + ->setResultCacheId('foo') |
|
100 | + ->setDQL('foo') |
|
101 | + ->setFirstResult(10) |
|
102 | + ->setMaxResults(10); |
|
103 | 103 | |
104 | 104 | $this->assertSame($q2, $q); |
105 | 105 | } |
@@ -257,11 +257,11 @@ discard block |
||
257 | 257 | $this->_em->getConfiguration()->setResultCacheImpl(new ArrayCache()); |
258 | 258 | |
259 | 259 | $query = $this->_em->createQuery("SELECT u FROM Doctrine\Tests\Models\CMS\CmsUser u") |
260 | - ->enableResultCache(); |
|
260 | + ->enableResultCache(); |
|
261 | 261 | |
262 | 262 | /** @var DriverConnectionMock $driverConnectionMock */ |
263 | 263 | $driverConnectionMock = $this->_em->getConnection() |
264 | - ->getWrappedConnection(); |
|
264 | + ->getWrappedConnection(); |
|
265 | 265 | |
266 | 266 | $driverConnectionMock->setStatementMock(new StatementArrayMock([['id_0' => 1]])); |
267 | 267 |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | 9 => "St Julien" |
167 | 167 | ]; |
168 | 168 | |
169 | - $query = $this->_em |
|
169 | + $query = $this->_em |
|
170 | 170 | ->createQuery("SELECT a FROM Doctrine\Tests\Models\CMS\CmsAddress a WHERE a.city IN (:cities)") |
171 | 171 | ->setParameter('cities', $cities); |
172 | 172 | |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | */ |
183 | 183 | public function testProcessParameterValueClassMetadata() |
184 | 184 | { |
185 | - $query = $this->_em->createQuery("SELECT a FROM Doctrine\Tests\Models\CMS\CmsAddress a WHERE a.city IN (:cities)"); |
|
185 | + $query = $this->_em->createQuery("SELECT a FROM Doctrine\Tests\Models\CMS\CmsAddress a WHERE a.city IN (:cities)"); |
|
186 | 186 | $this->assertEquals( |
187 | 187 | CmsAddress::class, |
188 | 188 | $query->processParameterValue($this->_em->getClassMetadata(CmsAddress::class)) |
@@ -311,7 +311,7 @@ discard block |
||
311 | 311 | */ |
312 | 312 | public function testGetParameterTypeJuggling() : void |
313 | 313 | { |
314 | - $query = $this->_em->createQuery('select u from ' . CmsUser::class . ' u where u.id = ?0'); |
|
314 | + $query = $this->_em->createQuery('select u from '.CmsUser::class.' u where u.id = ?0'); |
|
315 | 315 | |
316 | 316 | $query->setParameter(0, 0); |
317 | 317 | |
@@ -325,7 +325,7 @@ discard block |
||
325 | 325 | */ |
326 | 326 | public function testSetParameterWithNameZeroIsNotOverridden() : void |
327 | 327 | { |
328 | - $query = $this->_em->createQuery('select u from ' . CmsUser::class . ' u where u.id != ?0 and u.username = :name'); |
|
328 | + $query = $this->_em->createQuery('select u from '.CmsUser::class.' u where u.id != ?0 and u.username = :name'); |
|
329 | 329 | |
330 | 330 | $query->setParameter(0, 0); |
331 | 331 | $query->setParameter('name', 'Doctrine'); |
@@ -340,7 +340,7 @@ discard block |
||
340 | 340 | */ |
341 | 341 | public function testSetParameterWithNameZeroDoesNotOverrideAnotherParameter() : void |
342 | 342 | { |
343 | - $query = $this->_em->createQuery('select u from ' . CmsUser::class . ' u where u.id != ?0 and u.username = :name'); |
|
343 | + $query = $this->_em->createQuery('select u from '.CmsUser::class.' u where u.id != ?0 and u.username = :name'); |
|
344 | 344 | |
345 | 345 | $query->setParameter('name', 'Doctrine'); |
346 | 346 | $query->setParameter(0, 0); |
@@ -355,7 +355,7 @@ discard block |
||
355 | 355 | */ |
356 | 356 | public function testSetParameterWithTypeJugglingWorks() : void |
357 | 357 | { |
358 | - $query = $this->_em->createQuery('select u from ' . CmsUser::class . ' u where u.id != ?0 and u.username = :name'); |
|
358 | + $query = $this->_em->createQuery('select u from '.CmsUser::class.' u where u.id != ?0 and u.username = :name'); |
|
359 | 359 | |
360 | 360 | $query->setParameter('0', 1); |
361 | 361 | $query->setParameter('name', 'Doctrine'); |
@@ -375,7 +375,7 @@ discard block |
||
375 | 375 | { |
376 | 376 | $this->_em->getConfiguration()->setResultCacheImpl(new ArrayCache()); |
377 | 377 | |
378 | - $query = $this->_em->createQuery('SELECT u FROM ' . CmsUser::class . ' u'); |
|
378 | + $query = $this->_em->createQuery('SELECT u FROM '.CmsUser::class.' u'); |
|
379 | 379 | $query->enableResultCache(); |
380 | 380 | $query->setResultCacheProfile(); |
381 | 381 |
@@ -44,10 +44,10 @@ discard block |
||
44 | 44 | private function createQuery() |
45 | 45 | { |
46 | 46 | return $this->_em->createQueryBuilder() |
47 | - ->select('car') |
|
48 | - ->from(GH2947Car::class, 'car') |
|
49 | - ->getQuery() |
|
50 | - ->enableResultCache(3600, 'foo-cache-id'); |
|
47 | + ->select('car') |
|
48 | + ->from(GH2947Car::class, 'car') |
|
49 | + ->getQuery() |
|
50 | + ->enableResultCache(3600, 'foo-cache-id'); |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | private function createData() |
@@ -60,13 +60,13 @@ discard block |
||
60 | 60 | private function updateData() |
61 | 61 | { |
62 | 62 | $this->_em->createQueryBuilder() |
63 | - ->update(GH2947Car::class, 'car') |
|
64 | - ->set('car.brand', ':newBrand') |
|
65 | - ->where('car.brand = :oldBrand') |
|
66 | - ->setParameter('newBrand', 'Dacia') |
|
67 | - ->setParameter('oldBrand', 'BMW') |
|
68 | - ->getQuery() |
|
69 | - ->execute(); |
|
63 | + ->update(GH2947Car::class, 'car') |
|
64 | + ->set('car.brand', ':newBrand') |
|
65 | + ->where('car.brand = :oldBrand') |
|
66 | + ->setParameter('newBrand', 'Dacia') |
|
67 | + ->setParameter('oldBrand', 'BMW') |
|
68 | + ->getQuery() |
|
69 | + ->execute(); |
|
70 | 70 | } |
71 | 71 | } |
72 | 72 |