Changeset 4101 for trunk/tests/Orm

Show
Ignore:
Timestamp:
03/23/08 11:30:29 (10 months ago)
Author:
romanb
Message:

refactorings

Location:
trunk/tests/Orm/Component
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/tests/Orm/Component/AllTests.php

    r3812 r4101  
    2222        $suite = new Doctrine_TestSuite('Doctrine Orm Component'); 
    2323 
    24         //$suite->addTestSuite('Orm_Component_TestTest'); 
     24        $suite->addTestSuite('Orm_Component_TestTest'); 
    2525                $suite->addTestSuite('Orm_Component_AccessTest'); 
    2626        $suite->addTestSuite('Orm_Component_CollectionTest'); 
  • trunk/tests/Orm/Component/CollectionTest.php

    r3882 r4101  
    5858    public function shouldHaveBlankAsDefaultKeyColumn() 
    5959    { 
    60         $this->assertEquals('', $this->coll->getKeyColumn()); 
     60        $this->assertEquals('', $this->coll->getKeyField()); 
    6161    }    
    6262 
     
    6868    { 
    6969        $coll = new Doctrine_Collection('ForumUser', 'id'); 
    70         $this->assertEquals('id', $coll->getKeyColumn()); 
     70        $this->assertEquals('id', $coll->getKeyField()); 
    7171    } 
    7272 
     
    7676     * 
    7777     * @test  
    78      * @expectedException Doctrine_Exception 
     78     * @expectedException Doctrine_Collection_Exception 
    7979     */ 
    8080    public function shouldThrowExceptionIfNonValidFieldSetAsKey() 
    8181    { 
    82         $coll = new Doctrine_Collection('ForumUser', 'rat'); 
     82        $coll = new Doctrine_Collection('ForumUser', 'xxNonValidFieldxx'); 
    8383    } 
    8484 
     
    8888    public function shouldSerializeEmptyCollection() 
    8989    { 
    90         $serializedFormCollection='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->assertEquals($serializedFormCollection, serialize($this->coll)); 
     90        $serialized = serialize($this->coll); 
     91        $this->assertTrue(is_string($serialized)); 
    9292    } 
    9393 
     
    9797    public function shouldUnserializeEmptyCollectionIntoObject() 
    9898    { 
    99         $serializedFormCollection='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($serializedFormCollection); 
     99        $serialized = serialize($this->coll); 
     100        $coll = unserialize($serialized); 
    101101        $this->assertEquals('Doctrine_Collection', get_class($coll)); 
    102102    } 
     
    120120        $coll = unserialize($serialized); 
    121121 
    122         $this->assertEquals('username', $coll->getKeyColumn()); 
     122        $this->assertEquals('username', $coll->getKeyField()); 
    123123        $this->assertTrue(isset($coll['test'])); 
    124124        $user = $coll['test']; 
    125125        $this->assertTrue($user instanceOf CmsUser); 
    126126        $this->assertEquals('test', $user['username']); 
    127  
    128127    } 
    129128 
  • trunk/tests/Orm/Component/TestTest.php

    r3741 r4101  
    2929        $this->assertEquals(2, count($forumUsers)); 
    3030    } 
     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    } 
    3138}