Example #1
0
 public function testAddGetNamedNativeQuery()
 {
     $sql = 'SELECT * FROM user';
     $rsm = $this->getMock('Doctrine\\ORM\\Query\\ResultSetMapping');
     $this->configuration->addNamedNativeQuery('QueryName', $sql, $rsm);
     $fetched = $this->configuration->getNamedNativeQuery('QueryName');
     $this->assertSame($sql, $fetched[0]);
     $this->assertSame($rsm, $fetched[1]);
     $this->setExpectedException('Doctrine\\ORM\\ORMException');
     $this->configuration->getNamedQuery('NonExistingQuery');
 }
Example #2
0
 /**
  * {@inheritDoc}
  */
 public function createNamedNativeQuery($name)
 {
     list($sql, $rsm) = $this->config->getNamedNativeQuery($name);
     return $this->createNativeQuery($sql, $rsm);
 }