1
0
mirror of synced 2025-02-02 21:41:45 +03:00

Use ::class const instead of FQCN string (#5762)

This commit is contained in:
Alexander Kurilo 2016-08-29 22:29:41 +03:00 committed by Marco Pivetta
parent c6ea8b1129
commit 74ec055d57

View File

@ -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()
@ -25,10 +27,10 @@ class GH5762Test extends \Doctrine\Tests\OrmFunctionalTestCase
{
$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) {
@ -49,7 +51,7 @@ class GH5762Test extends \Doctrine\Tests\OrmFunctionalTestCase
$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');