public function testUnDelete()
 {
     $t = new Table4();
     $t->save();
     $t->delete();
     $t->undelete();
     $this->assertNull($t->getDeletedAt(), 'deleted_column is null again after an undelete');
     $this->assertEquals(1, Table4Peer::doCount(new Criteria()), 'undeleted rows are visible for select queries');
 }
예제 #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');
 }