@@ -135,13 +135,13 @@ |
||
| 135 | 135 | $cmf = new ClassMetadataFactory(); |
| 136 | 136 | $driver = $this->createMock(MappingDriver::class); |
| 137 | 137 | $driver->expects($this->at(0)) |
| 138 | - ->method('isTransient') |
|
| 139 | - ->with($this->equalTo(CmsUser::class)) |
|
| 140 | - ->will($this->returnValue(true)); |
|
| 138 | + ->method('isTransient') |
|
| 139 | + ->with($this->equalTo(CmsUser::class)) |
|
| 140 | + ->will($this->returnValue(true)); |
|
| 141 | 141 | $driver->expects($this->at(1)) |
| 142 | - ->method('isTransient') |
|
| 143 | - ->with($this->equalTo(CmsArticle::class)) |
|
| 144 | - ->will($this->returnValue(false)); |
|
| 142 | + ->method('isTransient') |
|
| 143 | + ->with($this->equalTo(CmsArticle::class)) |
|
| 144 | + ->will($this->returnValue(false)); |
|
| 145 | 145 | |
| 146 | 146 | $em = $this->createEntityManager($driver); |
| 147 | 147 | |
@@ -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() |
@@ -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() |
@@ -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 = 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), |
@@ -332,7 +332,7 @@ discard block |
||
| 332 | 332 | public function testGetSingleResultThrowsExceptionOnNoResult() |
| 333 | 333 | { |
| 334 | 334 | $this->em->createQuery("select a from Doctrine\Tests\Models\CMS\CmsArticle a") |
| 335 | - ->getSingleResult(); |
|
| 335 | + ->getSingleResult(); |
|
| 336 | 336 | } |
| 337 | 337 | |
| 338 | 338 | /** |
@@ -341,7 +341,7 @@ discard block |
||
| 341 | 341 | public function testGetSingleScalarResultThrowsExceptionOnNoResult() |
| 342 | 342 | { |
| 343 | 343 | $this->em->createQuery("select a from Doctrine\Tests\Models\CMS\CmsArticle a") |
| 344 | - ->getSingleScalarResult(); |
|
| 344 | + ->getSingleScalarResult(); |
|
| 345 | 345 | } |
| 346 | 346 | |
| 347 | 347 | /** |
@@ -372,7 +372,7 @@ discard block |
||
| 372 | 372 | $this->em->clear(); |
| 373 | 373 | |
| 374 | 374 | $this->em->createQuery("select a from Doctrine\Tests\Models\CMS\CmsArticle a") |
| 375 | - ->getSingleScalarResult(); |
|
| 375 | + ->getSingleScalarResult(); |
|
| 376 | 376 | } |
| 377 | 377 | |
| 378 | 378 | public function testModifiedLimitQuery() |
@@ -389,27 +389,27 @@ discard block |
||
| 389 | 389 | $this->em->clear(); |
| 390 | 390 | |
| 391 | 391 | $data = $this->em->createQuery('SELECT u FROM ' . CmsUser::class . ' u') |
| 392 | - ->setFirstResult(1) |
|
| 393 | - ->setMaxResults(2) |
|
| 394 | - ->getResult(); |
|
| 392 | + ->setFirstResult(1) |
|
| 393 | + ->setMaxResults(2) |
|
| 394 | + ->getResult(); |
|
| 395 | 395 | |
| 396 | 396 | self::assertCount(2, $data); |
| 397 | 397 | self::assertEquals('gblanco1', $data[0]->username); |
| 398 | 398 | self::assertEquals('gblanco2', $data[1]->username); |
| 399 | 399 | |
| 400 | 400 | $data = $this->em->createQuery('SELECT u FROM ' . CmsUser::class . ' u') |
| 401 | - ->setFirstResult(3) |
|
| 402 | - ->setMaxResults(2) |
|
| 403 | - ->getResult(); |
|
| 401 | + ->setFirstResult(3) |
|
| 402 | + ->setMaxResults(2) |
|
| 403 | + ->getResult(); |
|
| 404 | 404 | |
| 405 | 405 | self::assertCount(2, $data); |
| 406 | 406 | self::assertEquals('gblanco3', $data[0]->username); |
| 407 | 407 | self::assertEquals('gblanco4', $data[1]->username); |
| 408 | 408 | |
| 409 | 409 | $data = $this->em->createQuery('SELECT u FROM ' . CmsUser::class . ' u') |
| 410 | - ->setFirstResult(3) |
|
| 411 | - ->setMaxResults(2) |
|
| 412 | - ->getScalarResult(); |
|
| 410 | + ->setFirstResult(3) |
|
| 411 | + ->setMaxResults(2) |
|
| 412 | + ->getScalarResult(); |
|
| 413 | 413 | } |
| 414 | 414 | |
| 415 | 415 | /** |
@@ -620,9 +620,9 @@ discard block |
||
| 620 | 620 | { |
| 621 | 621 | $qb = $this->em->createQueryBuilder(); |
| 622 | 622 | $qb->select('u') |
| 623 | - ->from(CmsUser::class, 'u') |
|
| 624 | - ->innerJoin('u.articles', 'a') |
|
| 625 | - ->where('(u.id = 0) OR (u.id IS NULL)'); |
|
| 623 | + ->from(CmsUser::class, 'u') |
|
| 624 | + ->innerJoin('u.articles', 'a') |
|
| 625 | + ->where('(u.id = 0) OR (u.id IS NULL)'); |
|
| 626 | 626 | |
| 627 | 627 | $query = $qb->getQuery(); |
| 628 | 628 | $users = $query->execute(); |