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'); }
/** * {@inheritDoc} */ public function createNamedNativeQuery($name) { list($sql, $rsm) = $this->config->getNamedNativeQuery($name); return $this->createNativeQuery($sql, $rsm); }