Changeset 3558

Show
Ignore:
Timestamp:
01/19/08 21:31:59 (18 months ago)
Author:
pookey
Message:

refs #741 - updating the names of the model classes

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/0.9/tests/Ticket/741TestCase.php

    r3557 r3558  
    1010    public function prepareTables() 
    1111    { 
    12         $this->tables = array('Moo', 'Cow'); 
     12        $this->tables = array('Parent741', 'Child741'); 
    1313        parent::prepareTables(); 
    1414    } 
    15   public function testTicket() 
    16   { 
    17     $moo = new Moo(); 
    18     $moo->amount = 1000; 
    19     $cow = new Cow(); 
    2015 
    21     $moo->Cows[] = $cow; 
    22     $cow->Moo = $moo; 
    23     $moo->save(); 
    24     $this->assertEqual($moo->amount, 0); 
    25   } 
     16    public function testTicket() 
     17    { 
     18        $moo = new Parent741(); 
     19        $moo->amount = 1000; 
     20        $cow = new Child741(); 
     21 
     22        $moo->Cows[] = $cow; 
     23        $cow->Moo = $moo; 
     24        $moo->save(); 
     25        $this->assertEqual($moo->amount, 0); 
     26    } 
    2627 
    2728} 
     
    2930 
    3031 
    31 class Moo extends Doctrine_Record 
     32class Parent741 extends Doctrine_Record 
    3233{ 
    3334  public function setTableDefinition() 
     
    4445  public function setUp() 
    4546  { 
    46     $this->hasMany('Cow as Cows', array('local' => 'id', 'foreign' => 'moo_id')); 
     47    $this->hasMany('Child741 as Cows', array('local' => 'id', 'foreign' => 'moo_id')); 
    4748  } 
    4849} 
    4950 
    50 class Cow extends Doctrine_Record 
     51class Child741 extends Doctrine_Record 
    5152{ 
    5253  public function setTableDefinition() 
     
    6364  public function setUp() 
    6465  { 
    65     $this->hasOne('Moo', array('local' => 'moo_id', 'foreign' => 'id')); 
     66    $this->hasOne('Parent741 as Moo', array('local' => 'moo_id', 'foreign' => 'id')); 
    6667  } 
    6768