Changeset 4286

Show
Ignore:
Timestamp:
04/22/08 13:47:41 (15 months ago)
Author:
jwage
Message:

Fixed delete() so it returns true as it did before.

Location:
branches/0.11
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • branches/0.11/lib/Doctrine/Connection/UnitOfWork.php

    r4265 r4286  
    169169        $deletions = array(); 
    170170        $this->_collectDeletions($record, $deletions); 
    171         $this->_executeDeletions($deletions); 
     171        return $this->_executeDeletions($deletions); 
    172172    } 
    173173 
     
    272272            } 
    273273 
     274            return true; 
    274275        } catch (Exception $e) { 
    275276            $this->conn->rollback(); 
  • branches/0.11/tests/RecordTestCase.php

    r4265 r4286  
    728728            //$this->assertEqual(count($emails),0); 
    729729        } catch (Exception $e) { 
    730             $this->fail(); 
     730            $this->fail($e->getMessage()); 
    731731        } 
    732732    } 
     
    975975        $this->assertEqual($user->name, 'jon wage changed2'); 
    976976    } 
     977 
     978    public function testDeleteReturnBooleanAndThrowsException() 
     979    { 
     980        $user = new User(); 
     981        $user->name = 'jonnnn wage'; 
     982        $user->loginname = 'jwage3'; 
     983        $user->save(); 
     984 
     985        $this->assertTrue($user->delete()); 
     986        try { 
     987          $user->delete(); 
     988          $this->fail(); 
     989        } catch (Exception $e) { 
     990          $this->pass(); 
     991        } 
     992    } 
    977993}