Esempio n. 1
0
 public function testSavepoints()
 {
     // MySQL
     $dialect = new \Phalcon\Db\Dialect\Mysql();
     $this->assertEquals($dialect->createSavepoint('PHALCON_SAVEPOINT_1'), 'SAVEPOINT PHALCON_SAVEPOINT_1');
     $this->assertEquals($dialect->releaseSavepoint('PHALCON_SAVEPOINT_1'), 'RELEASE SAVEPOINT PHALCON_SAVEPOINT_1');
     $this->assertEquals($dialect->rollbackSavepoint('PHALCON_SAVEPOINT_1'), 'ROLLBACK TO SAVEPOINT PHALCON_SAVEPOINT_1');
     $this->assertTrue($dialect->supportsSavepoints());
     $this->assertTrue($dialect->supportsReleaseSavepoints());
     // SQLite
     $dialect = new \Phalcon\Db\Dialect\Sqlite();
     $this->assertEquals($dialect->createSavepoint('PHALCON_SAVEPOINT_1'), 'SAVEPOINT PHALCON_SAVEPOINT_1');
     $this->assertEquals($dialect->releaseSavepoint('PHALCON_SAVEPOINT_1'), 'RELEASE SAVEPOINT PHALCON_SAVEPOINT_1');
     $this->assertEquals($dialect->rollbackSavepoint('PHALCON_SAVEPOINT_1'), 'ROLLBACK TO SAVEPOINT PHALCON_SAVEPOINT_1');
     $this->assertTrue($dialect->supportsSavepoints());
     $this->assertTrue($dialect->supportsReleaseSavepoints());
 }