Changeset 4101 for trunk/tests/Orm
- Timestamp:
- 03/23/08 11:30:29 (10 months ago)
- Location:
- trunk/tests/Orm/Component
- Files:
-
- 3 modified
-
AllTests.php (modified) (1 diff)
-
CollectionTest.php (modified) (6 diffs)
-
TestTest.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/Orm/Component/AllTests.php
r3812 r4101 22 22 $suite = new Doctrine_TestSuite('Doctrine Orm Component'); 23 23 24 //$suite->addTestSuite('Orm_Component_TestTest');24 $suite->addTestSuite('Orm_Component_TestTest'); 25 25 $suite->addTestSuite('Orm_Component_AccessTest'); 26 26 $suite->addTestSuite('Orm_Component_CollectionTest'); -
trunk/tests/Orm/Component/CollectionTest.php
r3882 r4101 58 58 public function shouldHaveBlankAsDefaultKeyColumn() 59 59 { 60 $this->assertEquals('', $this->coll->getKey Column());60 $this->assertEquals('', $this->coll->getKeyField()); 61 61 } 62 62 … … 68 68 { 69 69 $coll = new Doctrine_Collection('ForumUser', 'id'); 70 $this->assertEquals('id', $coll->getKey Column());70 $this->assertEquals('id', $coll->getKeyField()); 71 71 } 72 72 … … 76 76 * 77 77 * @test 78 * @expectedException Doctrine_ Exception78 * @expectedException Doctrine_Collection_Exception 79 79 */ 80 80 public function shouldThrowExceptionIfNonValidFieldSetAsKey() 81 81 { 82 $coll = new Doctrine_Collection('ForumUser', ' rat');82 $coll = new Doctrine_Collection('ForumUser', 'xxNonValidFieldxx'); 83 83 } 84 84 … … 88 88 public function shouldSerializeEmptyCollection() 89 89 { 90 $serialized FormCollection='C:19:"Doctrine_Collection":158:{a:7:{s:4:"data";a:0:{}s:7:"_mapper";s:9:"ForumUser";s:9:"_snapshot";a:0:{}s:14:"referenceField";N;s:9:"keyColumn";N;s:8:"_locator";N;s:10:"_resources";a:0:{}}}';91 $this->assert Equals($serializedFormCollection, serialize($this->coll));90 $serialized = serialize($this->coll); 91 $this->assertTrue(is_string($serialized)); 92 92 } 93 93 … … 97 97 public function shouldUnserializeEmptyCollectionIntoObject() 98 98 { 99 $serialized FormCollection='C:19:"Doctrine_Collection":158:{a:7:{s:4:"data";a:0:{}s:7:"_mapper";s:9:"ForumUser";s:9:"_snapshot";a:0:{}s:14:"referenceField";N;s:9:"keyColumn";N;s:8:"_locator";N;s:10:"_resources";a:0:{}}}';100 $coll = unserialize($serialized FormCollection);99 $serialized = serialize($this->coll); 100 $coll = unserialize($serialized); 101 101 $this->assertEquals('Doctrine_Collection', get_class($coll)); 102 102 } … … 120 120 $coll = unserialize($serialized); 121 121 122 $this->assertEquals('username', $coll->getKey Column());122 $this->assertEquals('username', $coll->getKeyField()); 123 123 $this->assertTrue(isset($coll['test'])); 124 124 $user = $coll['test']; 125 125 $this->assertTrue($user instanceOf CmsUser); 126 126 $this->assertEquals('test', $user['username']); 127 128 127 } 129 128 -
trunk/tests/Orm/Component/TestTest.php
r3741 r4101 29 29 $this->assertEquals(2, count($forumUsers)); 30 30 } 31 32 public function testFixture3() 33 { 34 $forumAdmins = $this->sharedFixture['connection']->query("FROM ForumAdministrator adm"); 35 $this->assertEquals(1, count($forumAdmins)); 36 $forumAdmins[0]->delete(); 37 } 31 38 }