Changeset 2309 for trunk/tests

Show
Ignore:
Timestamp:
10/07/2007 10:24:07 PM (15 months ago)
Author:
wei
Message:

Allow active records to have multiple foreign key references to the same table. Add TXCache.

Location:
trunk/tests
Files:
2 added
4 modified

Legend:

Unmodified
Added
Removed
  • trunk/tests/simple_unit/ActiveRecord/ForeignKeyTestCase.php

    r2274 r2309  
    2727        public static $RELATIONS = array( 
    2828                'Tracks' => array(self::HAS_MANY, 'Track'), 
    29                 'Artists' => array(self::HAS_MANY, 'Artist', 'album_artists'), 
     29                'Artists' => array(self::MANY_TO_MANY, 'Artist', 'album_artists'), 
    3030                'cover' => array(self::HAS_ONE, 'Cover') 
    3131        ); 
     
    4343        public $Albums = array(); 
    4444 
    45         public static $RELATIONS=array( 
    46                 'Albums' => array(self::HAS_MANY, 'Album', 'album_artists') 
     45        public static $RELATIONS=array 
     46        ( 
     47                'Albums' => array(self::MANY_TO_MANY, 'Album', 'album_artists') 
    4748        ); 
    4849 
     
    159160        { 
    160161                $item = ItemRecord::finder()->withRelated_Items()->findByPk(1); 
     162 
    161163                $this->assertNotNull($item); 
    162164                $this->assertEqual($item->name, "Professional Work Attire"); 
     
    169171                $this->assertEqual($item->related_items[1]->item_id, 3); 
    170172        } 
     173 
    171174} 
    172175 
  • trunk/tests/simple_unit/ActiveRecord/ForeignObjectUpdateTest.php

    r2274 r2309  
    5353    public static $RELATIONS=array 
    5454    ( 
    55         'skills' => array(self::HAS_MANY, 'SkillRecord', 'player_skills'), 
     55        'skills' => array(self::MANY_TO_MANY, 'SkillRecord', 'player_skills'), 
    5656        'team' => array(self::BELONGS_TO, 'TeamRecord'), 
    5757        'profile' => array(self::HAS_ONE, 'ProfileRecord'), 
     
    113113    public static $RELATIONS=array 
    114114    ( 
    115         'players' => array(self::HAS_MANY, 'PlayerRecord', 'player_skills'), 
     115        'players' => array(self::MANY_TO_MANY, 'PlayerRecord', 'player_skills'), 
    116116    ); 
    117117 
     
    237237                $this->assertEqual($player4->skills[2]->name, 'Push'); 
    238238        } 
     239//*/ 
    239240} 
    240241 
  • trunk/tests/simple_unit/ActiveRecord/records/ItemRecord.php

    r2274 r2309  
    2222        public static $RELATIONS=array 
    2323        ( 
    24                 'related_items' => array(self::HAS_MANY, 'ItemRecord', 'related_items.(related_item_id)'), 
     24                'related_items' => array(self::MANY_TO_MANY, 'ItemRecord', 'related_items.related_item_id'), 
    2525        ); 
    2626 
  • trunk/tests/test_tools/simpletest/test_case.php

    r1532 r2309  
    241241                    '] with message ['. $exception->getMessage() . 
    242242                    '] in ['. $exception->getFile() . 
    243                     '] line [' . $exception->getLine() . ']'); 
     243                    '] line [' . $exception->getLine() . 
     244                                        '] stack [' . $exception->getTraceAsString() .']'); 
    244245        } 
    245246