Skip to content

Commit

Permalink
Use ::class const instead of FQCN string (doctrine#5762)
Browse files Browse the repository at this point in the history
  • Loading branch information
kamazee committed Aug 29, 2016
1 parent 5da1221 commit f98e542
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions tests/Doctrine/Tests/ORM/Functional/Ticket/GH5762Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
namespace Doctrine\Tests\ORM\Functional\Ticket;

use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\PersistentCollection;
use Doctrine\Tests\OrmFunctionalTestCase;

/**
* @group GH-5762
*/
class GH5762Test extends \Doctrine\Tests\OrmFunctionalTestCase
class GH5762Test extends OrmFunctionalTestCase
{

protected function setup()
Expand All @@ -25,10 +27,10 @@ public function testIssue()
{
$result = $this->fetchData();

$this->assertInstanceOf(__NAMESPACE__ . '\GH5762Driver', $result);
$this->assertInstanceOf('Doctrine\ORM\PersistentCollection', $result->driverRides);
$this->assertInstanceOf(__NAMESPACE__ . '\GH5762DriverRide', $result->driverRides->get(0));
$this->assertInstanceOf(__NAMESPACE__ . '\GH5762Car', $result->driverRides->get(0)->car);
$this->assertInstanceOf(GH5762Driver::class, $result);
$this->assertInstanceOf(PersistentCollection::class, $result->driverRides);
$this->assertInstanceOf(GH5762DriverRide::class, $result->driverRides->get(0));
$this->assertInstanceOf(GH5762Car::class, $result->driverRides->get(0)->car);

$cars = array();
foreach ($result->driverRides as $ride) {
Expand All @@ -49,7 +51,7 @@ private function fetchData()

$qb = $this->_em->createQueryBuilder();
$qb->select('d, dr, c')
->from(__NAMESPACE__ . '\GH5762Driver', 'd')
->from(GH5762Driver::class, 'd')
->leftJoin('d.driverRides', 'dr')
->leftJoin('dr.car', 'c')
->where('d.id = 1');
Expand Down

0 comments on commit f98e542

Please sign in to comment.