Changeset 2329 for trunk/tests
- Timestamp:
- 10/31/2007 11:20:14 PM (14 months ago)
- Location:
- trunk/tests/simple_unit/ActiveRecord
- Files:
-
- 2 modified
-
ForeignKeyTestCase.php (modified) (1 diff)
-
MultipleForeignKeyTestCase.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/simple_unit/ActiveRecord/ForeignKeyTestCase.php
r2309 r2329 160 160 { 161 161 $item = ItemRecord::finder()->withRelated_Items()->findByPk(1); 162 163 162 $this->assertNotNull($item); 164 163 $this->assertEqual($item->name, "Professional Work Attire"); -
trunk/tests/simple_unit/ActiveRecord/MultipleForeignKeyTestCase.php
r2309 r2329 33 33 34 34 public $object1; 35 public $object2;35 //public $object2; //commented out for testing __get/__set 36 36 public $object3; 37 37 … … 58 58 59 59 private $_state1; 60 public $state2;60 //public $state2; //commented out for testing __get/__set 61 61 public $state3; 62 62 … … 175 175 $this->assertEqual($obj->parent_category->cat_id, 1); 176 176 } 177 178 function testLazyLoadingGetterSetter_hasMany() 179 { 180 $arr = Table2::finder()->findByPk(2); 181 182 $this->assertNotNull($arr->state2); //lazy load 183 $this->assertEqual(count($arr->state2), 1); 184 $this->assertEqual($arr->state2[0]->id, "1"); 185 $this->assertNotNull($arr->state2[0]->object2); 186 $this->assertEqual($arr->state2[0]->object2->id, "2"); 187 188 $this->assertNotIdentical($arr, $arr->state2[0]->object2); 189 } 177 190 } 178 191
