Changeset 4944 for trunk/tests/Orm
- Timestamp:
- 09/12/08 13:34:46 (4 months ago)
- Location:
- trunk/tests/Orm
- Files:
-
- 2 modified
-
Component/CollectionTest.php (modified) (4 diffs)
-
Hydration/BasicHydrationTest.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/Orm/Component/CollectionTest.php
r4913 r4944 42 42 parent::setUp(); 43 43 44 $this->coll = new Doctrine_ Collection('ForumUser');44 $this->coll = new Doctrine_ORM_Collection('ForumUser'); 45 45 46 46 //we create a CmsUser with username as key column and add a user to it 47 $cmsColl = new Doctrine_ Collection('CmsUser', 'username');47 $cmsColl = new Doctrine_ORM_Collection('CmsUser', 'username'); 48 48 $user = new CmsUser(); 49 49 $user->username ='test'; … … 68 68 public function shouldUseSpecifiedKeyColumn() 69 69 { 70 $coll = new Doctrine_ Collection('ForumUser', 'id');70 $coll = new Doctrine_ORM_Collection('ForumUser', 'id'); 71 71 $this->assertEquals('id', $coll->getKeyField()); 72 72 } … … 81 81 public function shouldThrowExceptionIfNonValidFieldSetAsKey() 82 82 { 83 $coll = new Doctrine_ Collection('ForumUser', 'xxNonValidFieldxx');83 $coll = new Doctrine_ORM_Collection('ForumUser', 'xxNonValidFieldxx'); 84 84 } 85 85 … … 100 100 $serialized = serialize($this->coll); 101 101 $coll = unserialize($serialized); 102 $this->assertEquals('Doctrine_ Collection', get_class($coll));102 $this->assertEquals('Doctrine_ORM_Collection', get_class($coll)); 103 103 } 104 104 -
trunk/tests/Orm/Hydration/BasicHydrationTest.php
r4930 r4944 86 86 87 87 if ($hydrationMode == Doctrine::HYDRATE_RECORD) { 88 $this->assertTrue($result instanceof Doctrine_ Collection);88 $this->assertTrue($result instanceof Doctrine_ORM_Collection); 89 89 $this->assertTrue($result[0] instanceof Doctrine_ORM_Entity); 90 90 $this->assertTrue($result[1] instanceof Doctrine_ORM_Entity); … … 188 188 if ($hydrationMode == Doctrine::HYDRATE_RECORD) { 189 189 $this->assertTrue($result[0][0] instanceof Doctrine_ORM_Entity); 190 $this->assertTrue($result[0][0]['phonenumbers'] instanceof Doctrine_ Collection);190 $this->assertTrue($result[0][0]['phonenumbers'] instanceof Doctrine_ORM_Collection); 191 191 $this->assertTrue($result[0][0]['phonenumbers'][0] instanceof Doctrine_ORM_Entity); 192 192 $this->assertTrue($result[0][0]['phonenumbers'][1] instanceof Doctrine_ORM_Entity); 193 193 $this->assertTrue($result[1][0] instanceof Doctrine_ORM_Entity); 194 $this->assertTrue($result[1][0]['phonenumbers'] instanceof Doctrine_ Collection);194 $this->assertTrue($result[1][0]['phonenumbers'] instanceof Doctrine_ORM_Collection); 195 195 } else if ($hydrationMode == Doctrine::HYDRATE_SCALAR) { 196 196 $this->assertTrue(is_array($result)); … … 380 380 $this->assertTrue($result[0]['1'] instanceof Doctrine_ORM_Entity); 381 381 $this->assertTrue($result[1]['2'] instanceof Doctrine_ORM_Entity); 382 $this->assertTrue($result[0]['1']['phonenumbers'] instanceof Doctrine_ Collection);382 $this->assertTrue($result[0]['1']['phonenumbers'] instanceof Doctrine_ORM_Collection); 383 383 $this->assertEquals(2, count($result[0]['1']['phonenumbers'])); 384 384 } else if ($hydrationMode == Doctrine::HYDRATE_SCALAR) { … … 523 523 if ($hydrationMode == Doctrine::HYDRATE_RECORD) { 524 524 $this->assertTrue($result[0][0] instanceof Doctrine_ORM_Entity); 525 $this->assertTrue($result[0][0]['phonenumbers'] instanceof Doctrine_ Collection);525 $this->assertTrue($result[0][0]['phonenumbers'] instanceof Doctrine_ORM_Collection); 526 526 $this->assertTrue($result[0][0]['phonenumbers'][0] instanceof Doctrine_ORM_Entity); 527 527 $this->assertTrue($result[0][0]['phonenumbers'][1] instanceof Doctrine_ORM_Entity); 528 $this->assertTrue($result[0][0]['articles'] instanceof Doctrine_ Collection);528 $this->assertTrue($result[0][0]['articles'] instanceof Doctrine_ORM_Collection); 529 529 $this->assertTrue($result[0][0]['articles'][0] instanceof Doctrine_ORM_Entity); 530 530 $this->assertTrue($result[0][0]['articles'][1] instanceof Doctrine_ORM_Entity); 531 531 $this->assertTrue($result[1][0] instanceof Doctrine_ORM_Entity); 532 $this->assertTrue($result[1][0]['phonenumbers'] instanceof Doctrine_ Collection);532 $this->assertTrue($result[1][0]['phonenumbers'] instanceof Doctrine_ORM_Collection); 533 533 $this->assertTrue($result[1][0]['phonenumbers'][0] instanceof Doctrine_ORM_Entity); 534 534 $this->assertTrue($result[1][0]['articles'][0] instanceof Doctrine_ORM_Entity); … … 709 709 $this->assertTrue($result[1][0] instanceof Doctrine_ORM_Entity); 710 710 // phonenumbers 711 $this->assertTrue($result[0][0]['phonenumbers'] instanceof Doctrine_ Collection);711 $this->assertTrue($result[0][0]['phonenumbers'] instanceof Doctrine_ORM_Collection); 712 712 $this->assertTrue($result[0][0]['phonenumbers'][0] instanceof Doctrine_ORM_Entity); 713 713 $this->assertTrue($result[0][0]['phonenumbers'][1] instanceof Doctrine_ORM_Entity); 714 $this->assertTrue($result[1][0]['phonenumbers'] instanceof Doctrine_ Collection);714 $this->assertTrue($result[1][0]['phonenumbers'] instanceof Doctrine_ORM_Collection); 715 715 $this->assertTrue($result[1][0]['phonenumbers'][0] instanceof Doctrine_ORM_Entity); 716 716 // articles 717 $this->assertTrue($result[0][0]['articles'] instanceof Doctrine_ Collection);717 $this->assertTrue($result[0][0]['articles'] instanceof Doctrine_ORM_Collection); 718 718 $this->assertTrue($result[0][0]['articles'][0] instanceof Doctrine_ORM_Entity); 719 719 $this->assertTrue($result[0][0]['articles'][1] instanceof Doctrine_ORM_Entity); … … 721 721 $this->assertTrue($result[1][0]['articles'][1] instanceof Doctrine_ORM_Entity); 722 722 // article comments 723 $this->assertTrue($result[0][0]['articles'][0]['comments'] instanceof Doctrine_ Collection);723 $this->assertTrue($result[0][0]['articles'][0]['comments'] instanceof Doctrine_ORM_Collection); 724 724 $this->assertTrue($result[0][0]['articles'][0]['comments'][0] instanceof Doctrine_ORM_Entity); 725 725 // empty comment collections 726 $this->assertTrue($result[0][0]['articles'][1]['comments'] instanceof Doctrine_ Collection);726 $this->assertTrue($result[0][0]['articles'][1]['comments'] instanceof Doctrine_ORM_Collection); 727 727 $this->assertEquals(0, count($result[0][0]['articles'][1]['comments'])); 728 $this->assertTrue($result[1][0]['articles'][0]['comments'] instanceof Doctrine_ Collection);728 $this->assertTrue($result[1][0]['articles'][0]['comments'] instanceof Doctrine_ORM_Collection); 729 729 $this->assertEquals(0, count($result[1][0]['articles'][0]['comments'])); 730 $this->assertTrue($result[1][0]['articles'][1]['comments'] instanceof Doctrine_ Collection);730 $this->assertTrue($result[1][0]['articles'][1]['comments'] instanceof Doctrine_ORM_Collection); 731 731 $this->assertEquals(0, count($result[1][0]['articles'][1]['comments'])); 732 732 } else if ($hydrationMode == Doctrine::HYDRATE_SCALAR) { … … 849 849 $this->assertTrue(is_array($result[1])); 850 850 } else if ($hydrationMode == Doctrine::HYDRATE_RECORD) { 851 $this->assertTrue($result instanceof Doctrine_ Collection);851 $this->assertTrue($result instanceof Doctrine_ORM_Collection); 852 852 $this->assertTrue($result[0] instanceof Doctrine_ORM_Entity); 853 853 $this->assertTrue($result[1] instanceof Doctrine_ORM_Entity);