@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | $this->expectExceptionMessage('Too few parameters: the query defines 1 parameters but you only bound 0'); |
| 151 | 151 | |
| 152 | 152 | $this->em->createQuery('SELECT u FROM ' . CmsUser::class . ' u WHERE u.name = ?1') |
| 153 | - ->getSingleResult(); |
|
| 153 | + ->getSingleResult(); |
|
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | public function testInvalidInputParameterThrowsException() : void |
@@ -158,8 +158,8 @@ discard block |
||
| 158 | 158 | $this->expectException(QueryException::class); |
| 159 | 159 | |
| 160 | 160 | $this->em->createQuery('SELECT u FROM ' . CmsUser::class . ' u WHERE u.name = ?') |
| 161 | - ->setParameter(1, 'jwage') |
|
| 162 | - ->getSingleResult(); |
|
| 161 | + ->setParameter(1, 'jwage') |
|
| 162 | + ->getSingleResult(); |
|
| 163 | 163 | } |
| 164 | 164 | |
| 165 | 165 | public function testSetParameters() : void |
@@ -169,8 +169,8 @@ discard block |
||
| 169 | 169 | $parameters->add(new Parameter(2, 'active')); |
| 170 | 170 | |
| 171 | 171 | $this->em->createQuery('SELECT u FROM ' . CmsUser::class . ' u WHERE u.name = ?1 AND u.status = ?2') |
| 172 | - ->setParameters($parameters) |
|
| 173 | - ->getResult(); |
|
| 172 | + ->setParameters($parameters) |
|
| 173 | + ->getResult(); |
|
| 174 | 174 | |
| 175 | 175 | $extractValue = static function (Parameter $parameter) { |
| 176 | 176 | return $parameter->getValue(); |
@@ -187,8 +187,8 @@ discard block |
||
| 187 | 187 | $parameters = [1 => 'jwage', 2 => 'active']; |
| 188 | 188 | |
| 189 | 189 | $this->em->createQuery('SELECT u FROM ' . CmsUser::class . ' u WHERE u.name = ?1 AND u.status = ?2') |
| 190 | - ->setParameters($parameters) |
|
| 191 | - ->getResult(); |
|
| 190 | + ->setParameters($parameters) |
|
| 191 | + ->getResult(); |
|
| 192 | 192 | |
| 193 | 193 | self::assertSame( |
| 194 | 194 | array_values($parameters), |
@@ -328,14 +328,14 @@ discard block |
||
| 328 | 328 | { |
| 329 | 329 | $this->expectException('Doctrine\ORM\NoResultException'); |
| 330 | 330 | $this->em->createQuery('select a from Doctrine\Tests\Models\CMS\CmsArticle a') |
| 331 | - ->getSingleResult(); |
|
| 331 | + ->getSingleResult(); |
|
| 332 | 332 | } |
| 333 | 333 | |
| 334 | 334 | public function testGetSingleScalarResultThrowsExceptionOnNoResult() : void |
| 335 | 335 | { |
| 336 | 336 | $this->expectException('Doctrine\ORM\NoResultException'); |
| 337 | 337 | $this->em->createQuery('select a from Doctrine\Tests\Models\CMS\CmsArticle a') |
| 338 | - ->getSingleScalarResult(); |
|
| 338 | + ->getSingleScalarResult(); |
|
| 339 | 339 | } |
| 340 | 340 | |
| 341 | 341 | public function testGetSingleScalarResultThrowsExceptionOnNonUniqueResult() : void |
@@ -364,7 +364,7 @@ discard block |
||
| 364 | 364 | $this->em->clear(); |
| 365 | 365 | |
| 366 | 366 | $this->em->createQuery('select a from Doctrine\Tests\Models\CMS\CmsArticle a') |
| 367 | - ->getSingleScalarResult(); |
|
| 367 | + ->getSingleScalarResult(); |
|
| 368 | 368 | } |
| 369 | 369 | |
| 370 | 370 | public function testModifiedLimitQuery() : void |
@@ -381,27 +381,27 @@ discard block |
||
| 381 | 381 | $this->em->clear(); |
| 382 | 382 | |
| 383 | 383 | $data = $this->em->createQuery('SELECT u FROM ' . CmsUser::class . ' u') |
| 384 | - ->setFirstResult(1) |
|
| 385 | - ->setMaxResults(2) |
|
| 386 | - ->getResult(); |
|
| 384 | + ->setFirstResult(1) |
|
| 385 | + ->setMaxResults(2) |
|
| 386 | + ->getResult(); |
|
| 387 | 387 | |
| 388 | 388 | self::assertCount(2, $data); |
| 389 | 389 | self::assertEquals('gblanco1', $data[0]->username); |
| 390 | 390 | self::assertEquals('gblanco2', $data[1]->username); |
| 391 | 391 | |
| 392 | 392 | $data = $this->em->createQuery('SELECT u FROM ' . CmsUser::class . ' u') |
| 393 | - ->setFirstResult(3) |
|
| 394 | - ->setMaxResults(2) |
|
| 395 | - ->getResult(); |
|
| 393 | + ->setFirstResult(3) |
|
| 394 | + ->setMaxResults(2) |
|
| 395 | + ->getResult(); |
|
| 396 | 396 | |
| 397 | 397 | self::assertCount(2, $data); |
| 398 | 398 | self::assertEquals('gblanco3', $data[0]->username); |
| 399 | 399 | self::assertEquals('gblanco4', $data[1]->username); |
| 400 | 400 | |
| 401 | 401 | $data = $this->em->createQuery('SELECT u FROM ' . CmsUser::class . ' u') |
| 402 | - ->setFirstResult(3) |
|
| 403 | - ->setMaxResults(2) |
|
| 404 | - ->getScalarResult(); |
|
| 402 | + ->setFirstResult(3) |
|
| 403 | + ->setMaxResults(2) |
|
| 404 | + ->getScalarResult(); |
|
| 405 | 405 | } |
| 406 | 406 | |
| 407 | 407 | /** |
@@ -612,9 +612,9 @@ discard block |
||
| 612 | 612 | { |
| 613 | 613 | $qb = $this->em->createQueryBuilder(); |
| 614 | 614 | $qb->select('u') |
| 615 | - ->from(CmsUser::class, 'u') |
|
| 616 | - ->innerJoin('u.articles', 'a') |
|
| 617 | - ->where('(u.id = 0) OR (u.id IS NULL)'); |
|
| 615 | + ->from(CmsUser::class, 'u') |
|
| 616 | + ->innerJoin('u.articles', 'a') |
|
| 617 | + ->where('(u.id = 0) OR (u.id IS NULL)'); |
|
| 618 | 618 | |
| 619 | 619 | $query = $qb->getQuery(); |
| 620 | 620 | $users = $query->execute(); |
@@ -286,14 +286,14 @@ discard block |
||
| 286 | 286 | { |
| 287 | 287 | $this->expectException('Doctrine\ORM\Repository\Exception\InvalidMagicMethodCall'); |
| 288 | 288 | $this->em->getRepository(CmsUser::class) |
| 289 | - ->findByStatus(); |
|
| 289 | + ->findByStatus(); |
|
| 290 | 290 | } |
| 291 | 291 | |
| 292 | 292 | public function testExceptionIsThrownWhenUsingInvalidFieldName() : void |
| 293 | 293 | { |
| 294 | 294 | $this->expectException('Doctrine\ORM\Repository\Exception\InvalidMagicMethodCall'); |
| 295 | 295 | $this->em->getRepository(CmsUser::class) |
| 296 | - ->findByThisFieldDoesNotExist('testvalue'); |
|
| 296 | + ->findByThisFieldDoesNotExist('testvalue'); |
|
| 297 | 297 | } |
| 298 | 298 | |
| 299 | 299 | /** |
@@ -305,7 +305,7 @@ discard block |
||
| 305 | 305 | $this->expectException(TransactionRequiredException::class); |
| 306 | 306 | |
| 307 | 307 | $this->em->getRepository(CmsUser::class) |
| 308 | - ->find(1, LockMode::PESSIMISTIC_READ); |
|
| 308 | + ->find(1, LockMode::PESSIMISTIC_READ); |
|
| 309 | 309 | } |
| 310 | 310 | |
| 311 | 311 | /** |
@@ -317,7 +317,7 @@ discard block |
||
| 317 | 317 | $this->expectException(TransactionRequiredException::class); |
| 318 | 318 | |
| 319 | 319 | $this->em->getRepository(CmsUser::class) |
| 320 | - ->find(1, LockMode::PESSIMISTIC_WRITE); |
|
| 320 | + ->find(1, LockMode::PESSIMISTIC_WRITE); |
|
| 321 | 321 | } |
| 322 | 322 | |
| 323 | 323 | /** |
@@ -329,7 +329,7 @@ discard block |
||
| 329 | 329 | $this->expectException(OptimisticLockException::class); |
| 330 | 330 | |
| 331 | 331 | $this->em->getRepository(CmsUser::class) |
| 332 | - ->find(1, LockMode::OPTIMISTIC); |
|
| 332 | + ->find(1, LockMode::OPTIMISTIC); |
|
| 333 | 333 | } |
| 334 | 334 | |
| 335 | 335 | /** |