示例#1
0
 /**
  * Test getResource method if it tries to connect to the database.
  *
  * @covers Zend\Db\Adapter\Driver\Pgsql\Connection::getResource
  */
 public function testResource()
 {
     if (extension_loaded('pgsql')) {
         try {
             $resource = $this->connection->getResource();
             // connected with empty string
             $this->assertTrue(is_resource($resource));
         } catch (AdapterException\RuntimeException $exc) {
             // If it throws an exception it has failed to connect
             $this->setExpectedException('Zend\\Db\\Adapter\\Exception\\RuntimeException');
             throw $exc;
         }
     } else {
         $this->markTestSkipped('pgsql extension not loaded');
     }
 }
示例#2
0
文件: Pgsql.php 项目: navassouza/zf2
 /**
  * @return mixed
  */
 public function getLastGeneratedValue()
 {
     return $this->connection->getLastGeneratedValue();
 }
示例#3
0
 /**
  * Get last generated value
  *
  * @param string $name
  * @return mixed
  */
 public function getLastGeneratedValue($name = null)
 {
     return $this->connection->getLastGeneratedValue($name);
 }