@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | $this->expectExceptionMessage('Too few parameters: the query defines 1 parameters but you only bound 0'); |
| 149 | 149 | |
| 150 | 150 | $this->_em->createQuery('SELECT u FROM ' . CmsUser::class . ' u WHERE u.name = ?1') |
| 151 | - ->getSingleResult(); |
|
| 151 | + ->getSingleResult(); |
|
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | public function testInvalidInputParameterThrowsException() |
@@ -156,8 +156,8 @@ discard block |
||
| 156 | 156 | $this->expectException(QueryException::class); |
| 157 | 157 | |
| 158 | 158 | $this->_em->createQuery('SELECT u FROM ' . CmsUser::class . ' u WHERE u.name = ?') |
| 159 | - ->setParameter(1, 'jwage') |
|
| 160 | - ->getSingleResult(); |
|
| 159 | + ->setParameter(1, 'jwage') |
|
| 160 | + ->getSingleResult(); |
|
| 161 | 161 | } |
| 162 | 162 | |
| 163 | 163 | public function testSetParameters() |
@@ -167,8 +167,8 @@ discard block |
||
| 167 | 167 | $parameters->add(new Parameter(2, 'active')); |
| 168 | 168 | |
| 169 | 169 | $this->_em->createQuery('SELECT u FROM ' . CmsUser::class . ' u WHERE u.name = ?1 AND u.status = ?2') |
| 170 | - ->setParameters($parameters) |
|
| 171 | - ->getResult(); |
|
| 170 | + ->setParameters($parameters) |
|
| 171 | + ->getResult(); |
|
| 172 | 172 | |
| 173 | 173 | $extractValue = function (Parameter $parameter) { |
| 174 | 174 | return $parameter->getValue(); |
@@ -185,8 +185,8 @@ discard block |
||
| 185 | 185 | $parameters = [1 => 'jwage', 2 => 'active']; |
| 186 | 186 | |
| 187 | 187 | $this->_em->createQuery('SELECT u FROM ' . CmsUser::class . ' u WHERE u.name = ?1 AND u.status = ?2') |
| 188 | - ->setParameters($parameters) |
|
| 189 | - ->getResult(); |
|
| 188 | + ->setParameters($parameters) |
|
| 189 | + ->getResult(); |
|
| 190 | 190 | |
| 191 | 191 | self::assertSame( |
| 192 | 192 | array_values($parameters), |
@@ -326,14 +326,14 @@ discard block |
||
| 326 | 326 | { |
| 327 | 327 | $this->expectException('Doctrine\ORM\NoResultException'); |
| 328 | 328 | $this->_em->createQuery("select a from Doctrine\Tests\Models\CMS\CmsArticle a") |
| 329 | - ->getSingleResult(); |
|
| 329 | + ->getSingleResult(); |
|
| 330 | 330 | } |
| 331 | 331 | |
| 332 | 332 | public function testGetSingleScalarResultThrowsExceptionOnNoResult() |
| 333 | 333 | { |
| 334 | 334 | $this->expectException('Doctrine\ORM\NoResultException'); |
| 335 | 335 | $this->_em->createQuery("select a from Doctrine\Tests\Models\CMS\CmsArticle a") |
| 336 | - ->getSingleScalarResult(); |
|
| 336 | + ->getSingleScalarResult(); |
|
| 337 | 337 | } |
| 338 | 338 | |
| 339 | 339 | public function testGetSingleScalarResultThrowsExceptionOnNonUniqueResult() |
@@ -362,7 +362,7 @@ discard block |
||
| 362 | 362 | $this->_em->clear(); |
| 363 | 363 | |
| 364 | 364 | $this->_em->createQuery("select a from Doctrine\Tests\Models\CMS\CmsArticle a") |
| 365 | - ->getSingleScalarResult(); |
|
| 365 | + ->getSingleScalarResult(); |
|
| 366 | 366 | } |
| 367 | 367 | |
| 368 | 368 | public function testModifiedLimitQuery() |
@@ -379,27 +379,27 @@ discard block |
||
| 379 | 379 | $this->_em->clear(); |
| 380 | 380 | |
| 381 | 381 | $data = $this->_em->createQuery('SELECT u FROM ' . CmsUser::class . ' u') |
| 382 | - ->setFirstResult(1) |
|
| 383 | - ->setMaxResults(2) |
|
| 384 | - ->getResult(); |
|
| 382 | + ->setFirstResult(1) |
|
| 383 | + ->setMaxResults(2) |
|
| 384 | + ->getResult(); |
|
| 385 | 385 | |
| 386 | 386 | $this->assertEquals(2, count($data)); |
| 387 | 387 | $this->assertEquals('gblanco1', $data[0]->username); |
| 388 | 388 | $this->assertEquals('gblanco2', $data[1]->username); |
| 389 | 389 | |
| 390 | 390 | $data = $this->_em->createQuery('SELECT u FROM ' . CmsUser::class . ' u') |
| 391 | - ->setFirstResult(3) |
|
| 392 | - ->setMaxResults(2) |
|
| 393 | - ->getResult(); |
|
| 391 | + ->setFirstResult(3) |
|
| 392 | + ->setMaxResults(2) |
|
| 393 | + ->getResult(); |
|
| 394 | 394 | |
| 395 | 395 | $this->assertEquals(2, count($data)); |
| 396 | 396 | $this->assertEquals('gblanco3', $data[0]->username); |
| 397 | 397 | $this->assertEquals('gblanco4', $data[1]->username); |
| 398 | 398 | |
| 399 | 399 | $data = $this->_em->createQuery('SELECT u FROM ' . CmsUser::class . ' u') |
| 400 | - ->setFirstResult(3) |
|
| 401 | - ->setMaxResults(2) |
|
| 402 | - ->getScalarResult(); |
|
| 400 | + ->setFirstResult(3) |
|
| 401 | + ->setMaxResults(2) |
|
| 402 | + ->getScalarResult(); |
|
| 403 | 403 | } |
| 404 | 404 | |
| 405 | 405 | public function testSupportsQueriesWithEntityNamespaces() |
@@ -468,8 +468,8 @@ discard block |
||
| 468 | 468 | $this->_em->clear(); |
| 469 | 469 | |
| 470 | 470 | $articles = $this->_em->createQuery('select a from Doctrine\Tests\Models\CMS\CmsArticle a') |
| 471 | - ->setFetchMode(CmsArticle::class, 'user', ClassMetadata::FETCH_EAGER) |
|
| 472 | - ->getResult(); |
|
| 471 | + ->setFetchMode(CmsArticle::class, 'user', ClassMetadata::FETCH_EAGER) |
|
| 472 | + ->getResult(); |
|
| 473 | 473 | |
| 474 | 474 | $this->assertEquals(10, count($articles)); |
| 475 | 475 | foreach ($articles AS $article) { |
@@ -611,9 +611,9 @@ discard block |
||
| 611 | 611 | { |
| 612 | 612 | $qb = $this->_em->createQueryBuilder(); |
| 613 | 613 | $qb->select('u') |
| 614 | - ->from(CmsUser::class, 'u') |
|
| 615 | - ->innerJoin('u.articles', 'a') |
|
| 616 | - ->where('(u.id = 0) OR (u.id IS NULL)'); |
|
| 614 | + ->from(CmsUser::class, 'u') |
|
| 615 | + ->innerJoin('u.articles', 'a') |
|
| 616 | + ->where('(u.id = 0) OR (u.id IS NULL)'); |
|
| 617 | 617 | |
| 618 | 618 | $query = $qb->getQuery(); |
| 619 | 619 | $users = $query->execute(); |
@@ -309,13 +309,13 @@ discard block |
||
| 309 | 309 | public function testExceptionIsThrownWhenCallingFindByWithoutParameter() { |
| 310 | 310 | $this->expectException('Doctrine\ORM\ORMException'); |
| 311 | 311 | $this->_em->getRepository(CmsUser::class) |
| 312 | - ->findByStatus(); |
|
| 312 | + ->findByStatus(); |
|
| 313 | 313 | } |
| 314 | 314 | |
| 315 | 315 | public function testExceptionIsThrownWhenUsingInvalidFieldName() { |
| 316 | 316 | $this->expectException('Doctrine\ORM\ORMException'); |
| 317 | 317 | $this->_em->getRepository(CmsUser::class) |
| 318 | - ->findByThisFieldDoesNotExist('testvalue'); |
|
| 318 | + ->findByThisFieldDoesNotExist('testvalue'); |
|
| 319 | 319 | } |
| 320 | 320 | |
| 321 | 321 | /** |
@@ -327,7 +327,7 @@ discard block |
||
| 327 | 327 | $this->expectException(TransactionRequiredException::class); |
| 328 | 328 | |
| 329 | 329 | $this->_em->getRepository(CmsUser::class) |
| 330 | - ->find(1, LockMode::PESSIMISTIC_READ); |
|
| 330 | + ->find(1, LockMode::PESSIMISTIC_READ); |
|
| 331 | 331 | } |
| 332 | 332 | |
| 333 | 333 | /** |
@@ -339,7 +339,7 @@ discard block |
||
| 339 | 339 | $this->expectException(TransactionRequiredException::class); |
| 340 | 340 | |
| 341 | 341 | $this->_em->getRepository(CmsUser::class) |
| 342 | - ->find(1, LockMode::PESSIMISTIC_WRITE); |
|
| 342 | + ->find(1, LockMode::PESSIMISTIC_WRITE); |
|
| 343 | 343 | } |
| 344 | 344 | |
| 345 | 345 | /** |
@@ -351,7 +351,7 @@ discard block |
||
| 351 | 351 | $this->expectException(OptimisticLockException::class); |
| 352 | 352 | |
| 353 | 353 | $this->_em->getRepository(CmsUser::class) |
| 354 | - ->find(1, LockMode::OPTIMISTIC); |
|
| 354 | + ->find(1, LockMode::OPTIMISTIC); |
|
| 355 | 355 | } |
| 356 | 356 | |
| 357 | 357 | /** |
@@ -432,13 +432,13 @@ discard block |
||
| 432 | 432 | */ |
| 433 | 433 | public function testFindOneByOrderBy() |
| 434 | 434 | { |
| 435 | - $this->loadFixture(); |
|
| 435 | + $this->loadFixture(); |
|
| 436 | 436 | |
| 437 | - $repos = $this->_em->getRepository(CmsUser::class); |
|
| 438 | - $userAsc = $repos->findOneBy([], ["username" => "ASC"]); |
|
| 439 | - $userDesc = $repos->findOneBy([], ["username" => "DESC"]); |
|
| 437 | + $repos = $this->_em->getRepository(CmsUser::class); |
|
| 438 | + $userAsc = $repos->findOneBy([], ["username" => "ASC"]); |
|
| 439 | + $userDesc = $repos->findOneBy([], ["username" => "DESC"]); |
|
| 440 | 440 | |
| 441 | - $this->assertNotSame($userAsc, $userDesc); |
|
| 441 | + $this->assertNotSame($userAsc, $userDesc); |
|
| 442 | 442 | } |
| 443 | 443 | |
| 444 | 444 | /** |