public function testForceDelete()
 {
     $t = new Table4();
     $t->save();
     $t->forceDelete();
     $this->assertTrue($t->isDeleted(), 'forceDelete() actually deletes a row');
     Table4Peer::disableSoftDelete();
     $this->assertEquals(0, Table4Peer::doCount(new Criteria()), 'forced deleted rows are not present in the database');
 }
예제 #2
0
 public function testForceDeleteDoesNotDisableSoftDelete()
 {
     $t1 = new Table4();
     $t1->save();
     $t2 = new Table4();
     $t2->save();
     $t1->forceDelete();
     $t2->delete();
     $this->assertTrue($t1->isDeleted(), 'forceDelete() actually deletes a row');
     $this->assertFalse($t2->isDeleted(), 'forceDelete() does not affect further delete() calls');
     Table4Peer::disableSoftDelete();
     $this->assertEquals(1, Table4Peer::doCount(new Criteria()), 'forced deleted rows are not present in the database');
 }