#6759 cleaning up test case body
This commit is contained in:
parent
5f99cad669
commit
6ba2d1c317
@ -3,6 +3,7 @@
|
||||
namespace Doctrine\Tests\ORM\Functional;
|
||||
|
||||
use Doctrine\ORM\Tools\SchemaTool;
|
||||
use Doctrine\ORM\Tools\ToolsException;
|
||||
use Doctrine\Tests\OrmFunctionalTestCase;
|
||||
|
||||
class OneToOneInverseSideLoadAfterDqlQueryTest extends OrmFunctionalTestCase
|
||||
@ -11,15 +12,15 @@ class OneToOneInverseSideLoadAfterDqlQueryTest extends OrmFunctionalTestCase
|
||||
protected function setUp()
|
||||
{
|
||||
parent::setUp();
|
||||
$schemaTool = new SchemaTool($this->_em);
|
||||
|
||||
try {
|
||||
$schemaTool->createSchema(
|
||||
[
|
||||
$this->_em->getClassMetadata(Bus::class),
|
||||
$this->_em->getClassMetadata(BusOwner::class),
|
||||
]
|
||||
);
|
||||
} catch(\Exception $e) {}
|
||||
$this->_schemaTool->createSchema([
|
||||
$this->_em->getClassMetadata(Bus::class),
|
||||
$this->_em->getClassMetadata(BusOwner::class),
|
||||
]);
|
||||
} catch(ToolsException $e) {
|
||||
// ignored
|
||||
}
|
||||
}
|
||||
|
||||
public function testInverseSideOneToOneLoadedAfterDqlQuery(): void
|
||||
@ -31,7 +32,9 @@ class OneToOneInverseSideLoadAfterDqlQueryTest extends OrmFunctionalTestCase
|
||||
$this->_em->flush();
|
||||
$this->_em->clear();
|
||||
|
||||
$bus = $this->_em->createQueryBuilder()
|
||||
$bus = $this
|
||||
->_em
|
||||
->createQueryBuilder()
|
||||
->select('to')
|
||||
->from(BusOwner::class, 'to')
|
||||
->andWhere('to.id = :id')
|
||||
@ -40,12 +43,12 @@ class OneToOneInverseSideLoadAfterDqlQueryTest extends OrmFunctionalTestCase
|
||||
->getResult();
|
||||
|
||||
$this->assertSQLEquals(
|
||||
"SELECT b0_.id AS id_0, b0_.name AS name_1 FROM BusOwner b0_ WHERE b0_.id = ?",
|
||||
'SELECT b0_.id AS id_0, b0_.name AS name_1 FROM BusOwner b0_ WHERE b0_.id = ?',
|
||||
$this->_sqlLoggerStack->queries[$this->_sqlLoggerStack->currentQuery - 1]['sql']
|
||||
);
|
||||
|
||||
$this->assertSQLEquals(
|
||||
"SELECT t0.id AS id_1, t0.owner AS owner_2 FROM Bus t0 WHERE t0.owner = ?",
|
||||
'SELECT t0.id AS id_1, t0.owner AS owner_2 FROM Bus t0 WHERE t0.owner = ?',
|
||||
$this->_sqlLoggerStack->queries[$this->_sqlLoggerStack->currentQuery]['sql']
|
||||
);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user