Beispiel #1
0
 public function testRebuildInvokesDdlOperationsIfTheyAreAllowed()
 {
     $model = $this->_getModelMock(array('_createTable', '_getWriteAdapter', '_populateFlatTables'));
     // Pretend that no transactions have been started
     $this->_dbAdapterMock->expects($this->any())->method('getTransactionLevel')->will($this->returnValue(0));
     $model->expects($this->any())->method('_getWriteAdapter')->will($this->returnValue($this->_dbAdapterMock));
     $model->expects($this->atLeastOnce())->method('_createTable');
     $store = $this->getMock('Mage_Core_Model_Store', array(), array(), '', false);
     $store->expects($this->any())->method('getId')->will($this->returnValue(1));
     $model->rebuild(array($store));
 }
Beispiel #2
0
 /**
  * Test incomplete Roll Back in a nested transaction
  */
 public function testSequentialTransactionsSuccess()
 {
     $this->_adapter->expects($this->exactly(4))->method('_connect');
     $this->_adapter->expects($this->exactly(2))->method('_beginTransaction');
     $this->_adapter->expects($this->once())->method('_rollBack');
     $this->_adapter->expects($this->once())->method('_commit');
     $this->_adapter->beginTransaction();
     $this->_adapter->beginTransaction();
     $this->_adapter->beginTransaction();
     $this->_adapter->rollBack();
     $this->_adapter->rollBack();
     $this->_adapter->rollBack();
     $this->_adapter->beginTransaction();
     $this->_adapter->commit();
 }