Author: Andres Gutierrez (andres@phalconphp.com)
Author: Nikolaos Dimopoulos (nikos@phalconphp.com)
Inheritance: extends Phalcon\Mvc\Model
Example #1
0
 /**
  * Tests transaction is removed when committed.
  *
  * @author Nochum Sossonko <*****@*****.**>
  * @since  2016-04-09
  */
 public function testTransactionRemovedOnCommit()
 {
     $this->specify("Test does not remove transaction when committed", function () {
         $tm = new Manager();
         $transaction = $tm->get(true);
         $select = new Select();
         $select->setTransaction($transaction);
         $select->create(['name' => 'Crack of Dawn']);
         expect($this->tester->getProtectedProperty($tm, '_number'))->equals(1);
         expect($this->tester->getProtectedProperty($tm, '_transactions'))->count(1);
         $transaction->commit();
         expect($this->tester->getProtectedProperty($tm, '_number'))->equals(0);
         expect($this->tester->getProtectedProperty($tm, '_transactions'))->count(0);
     });
 }