Beispiel #1
0
 public function testSaveDirtyRow()
 {
     Kwf_Model_DbWithConnection_Dirty_Row::resetMock();
     $table = new Kwf_Db_Table(array('name' => $this->_tableName, 'rowClass' => 'Kwf_Model_DbWithConnection_Dirty_Row'));
     $model = new Kwf_Model_Db(array('table' => $table));
     $row = $model->getRow(1);
     $row->test1 = 'blubb';
     $row->save();
     $this->assertEquals(1, Kwf_Model_DbWithConnection_Dirty_Row::$saveCount);
     Kwf_Model_DbWithConnection_Dirty_Row::resetMock();
     $row = $model->getRow(1);
     $row->test3 = '77';
     $row->save();
     $this->assertEquals(1, Kwf_Model_DbWithConnection_Dirty_Row::$saveCount);
     Kwf_Model_DbWithConnection_Dirty_Row::resetMock();
     $row = $model->createRow();
     $row->test1 = 'xx';
     $row->test2 = 'yy';
     $row->save();
     $this->assertEquals(1, Kwf_Model_DbWithConnection_Dirty_Row::$saveCount);
 }
Beispiel #2
0
 public static function resetMock()
 {
     self::$saveCount = 0;
 }