Merge pull request #842 from TheFrozenFire/tests/query-tests
Added EntityManager query creation tests
This commit is contained in:
commit
bd4d27eabf
@ -62,6 +62,19 @@ class EntityManagerTest extends \Doctrine\Tests\OrmTestCase
|
|||||||
$this->assertSame('SELECT foo', $query->getSql());
|
$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()
|
public function testCreateQueryBuilder()
|
||||||
{
|
{
|
||||||
$this->assertInstanceOf('Doctrine\ORM\QueryBuilder', $this->_em->createQueryBuilder());
|
$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->assertInstanceOf('Doctrine\ORM\Query', $q);
|
||||||
$this->assertEquals('SELECT 1', $q->getDql());
|
$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()
|
static public function dataMethodsAffectedByNoObjectArguments()
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user