/**
  * Test update count for insert, update, and delete.
  */
 public function testGetUpdateCount()
 {
     DriverTestManager::restore();
     $exc = DriverTestManager::getExchange('ConnectionTest.getUpdateCount.UPDATE');
     $count = $this->conn->executeUpdate($exc->getSql());
     $rs = $this->conn->executeQuery("SELECT * FROM products WHERE ProductID = 2");
     $this->assertEquals((int) $exc->getResult(), $count);
     $exc = DriverTestManager::getExchange('ConnectionTest.getUpdateCount.DELETE');
     $count = $this->conn->executeUpdate($exc->getSql());
     $this->assertEquals((int) $exc->getResult(), $count);
     $exc = DriverTestManager::getExchange('ConnectionTest.getUpdateCount.INSERT');
     $count = $this->conn->executeUpdate($exc->getSql());
     $this->assertEquals((int) $exc->getResult(), $count);
     // zap db since we modified it
     DriverTestManager::restore();
 }
Ejemplo n.º 2
0
 /**
  * Re-initialize the database.
  * 
  * We only need to do this in setUp() method -- not in every invocation of this class --
  * since the ResultSet methods do not modify the db.
  */
 public function setUp()
 {
     DriverTestManager::restore();
 }
 /**
  * Re-initialize the database.
  * 
  * We only need to do this in setUp() method -- not in every invocation of this class --
  * since the ResultSet methods do not modify the db.
  */
 public function setUp()
 {
     DriverTestManager::restore();
     $this->idgen = $this->conn->getIdGenerator();
 }