assume entity namespace when not given
This commit is contained in:
parent
3aa8d3fdac
commit
de93983dff
File diff suppressed because it is too large
Load Diff
@ -98,7 +98,7 @@ class NewOperatorTest extends \Doctrine\Tests\OrmFunctionalTestCase
|
||||
e.email,
|
||||
a.city
|
||||
)
|
||||
FROM
|
||||
FROM
|
||||
Doctrine\Tests\Models\CMS\CmsUser u
|
||||
JOIN
|
||||
u.email e
|
||||
@ -119,16 +119,40 @@ class NewOperatorTest extends \Doctrine\Tests\OrmFunctionalTestCase
|
||||
$this->assertEquals($this->fixtures[0]->name, $result[0]->name);
|
||||
$this->assertEquals($this->fixtures[1]->name, $result[1]->name);
|
||||
$this->assertEquals($this->fixtures[2]->name, $result[2]->name);
|
||||
|
||||
|
||||
$this->assertEquals($this->fixtures[0]->email->email, $result[0]->email);
|
||||
$this->assertEquals($this->fixtures[1]->email->email, $result[1]->email);
|
||||
$this->assertEquals($this->fixtures[2]->email->email, $result[2]->email);
|
||||
|
||||
|
||||
$this->assertEquals($this->fixtures[0]->address->city, $result[0]->address);
|
||||
$this->assertEquals($this->fixtures[1]->address->city, $result[1]->address);
|
||||
$this->assertEquals($this->fixtures[2]->address->city, $result[2]->address);
|
||||
}
|
||||
|
||||
public function testShouldAssumeFromEntityNamespaceWhenNotGiven()
|
||||
{
|
||||
$dql = "
|
||||
SELECT
|
||||
new CmsUserDTO(u.name, e.email, a.city)
|
||||
FROM
|
||||
Doctrine\Tests\Models\CMS\CmsUser u
|
||||
JOIN
|
||||
u.email e
|
||||
JOIN
|
||||
u.address a
|
||||
ORDER BY
|
||||
u.name";
|
||||
|
||||
$query = $this->_em->createQuery($dql);
|
||||
$result = $query->getResult();
|
||||
|
||||
$this->assertCount(3, $result);
|
||||
|
||||
$this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsUserDTO', $result[0]);
|
||||
$this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsUserDTO', $result[1]);
|
||||
$this->assertInstanceOf('Doctrine\Tests\Models\CMS\CmsUserDTO', $result[2]);
|
||||
}
|
||||
|
||||
public function testShouldSupportLiteralExpression()
|
||||
{
|
||||
$dql = "
|
||||
@ -403,11 +427,11 @@ class NewOperatorTest extends \Doctrine\Tests\OrmFunctionalTestCase
|
||||
{
|
||||
$dql = "
|
||||
SELECT
|
||||
new Doctrine\Tests\Models\CMS\CmsUserDTO(
|
||||
new CmsUserDTO(
|
||||
u.name,
|
||||
e.email
|
||||
),
|
||||
new Doctrine\Tests\Models\CMS\CmsAddressDTO(
|
||||
new CmsAddressDTO(
|
||||
a.country,
|
||||
a.city
|
||||
)
|
||||
@ -473,7 +497,7 @@ class NewOperatorTest extends \Doctrine\Tests\OrmFunctionalTestCase
|
||||
|
||||
/**
|
||||
* @expectedException Doctrine\ORM\Query\QueryException
|
||||
* @expectedExceptionMessage [Semantical Error] line 0, col 68 near ') FROM Doctrine\Tests\Models\CMS\CmsUser': Error: Number of arguments does not match.
|
||||
* @expectedExceptionMessage [Semantical Error] line 0, col 11 near 'Doctrine\Tests\ORM\Functional\ClassWithTooMuchArgs(u.name)': Error: Number of arguments does not match with "Doctrine\Tests\ORM\Functional\ClassWithTooMuchArgs" constructor declaration.
|
||||
*/
|
||||
public function testInvalidClassWithoutConstructorException()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user