Beispiel #1
0
 public function testSoftDelete()
 {
     $r = new SoftDeleteTest();
     $r->name = 'something';
     $r->something = 'something';
     $r->save();
     $this->assertEqual($r->name, 'something');
     $this->assertEqual($r->something, 'something');
     $this->assertEqual($r->deleted_at, null);
     $this->assertEqual($r->state(), Doctrine_Record::STATE_CLEAN);
     try {
         $r->delete();
         $this->assertEqual($r->state(), Doctrine_Record::STATE_CLEAN);
         $this->assertTrue(strtotime($r->deleted_at) > 0);
     } catch (Doctrine_Exception $e) {
         $this->fail();
     }
 }