Example #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');
     }
 }
Example #2
0
 /**
  * @return mixed
  */
 public function getLastGeneratedValue()
 {
     return $this->connection->getLastGeneratedValue();
 }
Example #3
0
 /**
  * Get last generated value
  *
  * @param string $name
  * @return mixed
  */
 public function getLastGeneratedValue($name = null)
 {
     return $this->connection->getLastGeneratedValue($name);
 }