1
0
mirror of synced 2025-01-31 12:32:59 +03:00

Test EntityManager::createNamedQuery.

Test EntityManager::createNamedNativeQuery.
This commit is contained in:
Justin Martin 2013-11-06 18:44:51 -08:00
parent 141213915e
commit 8b4b8e7268

View File

@ -62,6 +62,19 @@ class EntityManagerTest extends \Doctrine\Tests\OrmTestCase
$this->assertSame('SELECT foo', $query->getSql());
}
/**
* @covers Doctrine\ORM\EntityManager::createNamedNativeQuery
*/
public function testCreateNamedNativeQuery()
{
$rsm = new \Doctrine\ORM\Query\ResultSetMapping();
$this->_em->getConfiguration()->addNamedNativeQuery('foo', 'SELECT foo', $rsm);
$query = $this->_em->createNamedNativeQuery('foo');
$this->assertInstanceOf('Doctrine\ORM\NativeQuery', $query);
}
public function testCreateQueryBuilder()
{
$this->assertInstanceOf('Doctrine\ORM\QueryBuilder', $this->_em->createQueryBuilder());
@ -100,6 +113,18 @@ class EntityManagerTest extends \Doctrine\Tests\OrmTestCase
$this->assertInstanceOf('Doctrine\ORM\Query', $q);
$this->assertEquals('SELECT 1', $q->getDql());
}
/**
* @covers Doctrine\ORM\EntityManager::createNamedQuery
*/
public function testCreateNamedQuery()
{
$this->_em->getConfiguration()->addNamedQuery('foo', 'SELECT 1');
$query = $this->_em->createNamedQuery('foo');
$this->assertInstanceOf('Doctrine\ORM\Query', $query);
$this->assertEquals('SELECT 1', $query->getDql());
}
static public function dataMethodsAffectedByNoObjectArguments()
{