Changeset 4776 for trunk/tests/Orm

Show
Ignore:
Timestamp:
08/16/08 20:40:59 (5 months ago)
Author:
romanb
Message:

continued refactorings.

Location:
trunk/tests/Orm
Files:
2 added
5 modified

Legend:

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

    r4523 r4776  
    1616require_once 'Orm/UnitOfWorkTest.php'; 
    1717require_once 'Orm/EntityManagerFactoryTest.php'; 
     18require_once 'Orm/EntityManagerTest.php'; 
     19require_once 'Orm/EntityPersisterTest.php'; 
    1820 
    1921class Orm_AllTests 
     
    3032        $suite->addTestSuite('Orm_UnitOfWorkTest'); 
    3133        $suite->addTestSuite('Orm_EntityManagerFactoryTest'); 
    32         //$suite->addTestSuite('Orm_ConfigurableTestCase'); 
     34        $suite->addTestSuite('Orm_EntityManagerTest'); 
     35        $suite->addTestSuite('Orm_EntityPersisterTest'); 
    3336         
    3437        $suite->addTest(Orm_Component_AllTests::suite()); 
  • trunk/tests/Orm/Associations/OneToOneMappingTest.php

    r4699 r4776  
    1010            'targetEntity' => 'Address', 
    1111            'joinColumns' => array('address_id' => 'id'), 
    12             'sourceEntity' => 'Person' // This is normally filled by ClassMetadata 
     12            'sourceEntity' => 'Person', // This is normally filled by ClassMetadata 
    1313        ); 
    1414         
     
    2424         
    2525        $inverseSideMapping = array( 
     26            'fieldName' => 'person', 
     27            'sourceEntity' => 'Address', 
     28            'targetEntity' => 'Person', 
    2629            'mappedBy' => 'address' 
    2730        ); 
     
    2932        $oneToOneMapping = new Doctrine_Association_OneToOne($inverseSideMapping); 
    3033        $this->assertEquals('address', $oneToOneMapping->getMappedByFieldName()); 
     34        $this->assertEquals('Address', $oneToOneMapping->getSourceEntityName()); 
     35        $this->assertEquals('Person', $oneToOneMapping->getTargetEntityName()); 
    3136        $this->assertTrue($oneToOneMapping->isInverseSide()); 
    3237         
  • trunk/tests/Orm/Component/AccessTest.php

    r4374 r4776  
    2727 * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL 
    2828 * @link        www.phpdoctrine.org 
    29  * @since       1.0 
     29 * @since       2.0 
    3030 * @version     $Revision: 3754 $ 
    3131 */ 
     
    9898    /** 
    9999     * @test  
    100      */ 
    101     public function shouldSetArrayOfValusInRecord() 
    102     { 
    103         $this->user->setArray(array( 
    104             'username' => 'meus', 
    105             'id'       => 22)); 
    106  
    107         $this->assertEquals('meus', $this->user->username); 
    108         $this->assertEquals('meus', $this->user['username']); 
    109  
    110         $this->assertEquals(22, $this->user->id); 
    111         $this->assertEquals(22, $this->user['id']); 
    112     } 
    113  
    114  
    115     /** 
    116      * @test  
    117100     * @expectedException Doctrine_Entity_Exception 
    118101     */ 
     
    129112    { 
    130113        $this->user['rat'] = 'meus'; 
    131     } 
    132  
    133     /** 
    134      * @test  
    135      * @expectedException Doctrine_Entity_Exception 
    136      */ 
    137     public function shouldNotBeAbleToSetNonExistantFieldAsPartInSetArray() 
    138     { 
    139         $this->user->setArray(array( 
    140             'rat' => 'meus', 
    141             'id'  => 22)); 
    142114    } 
    143115 
     
    175147        unset($col->test); 
    176148        $this->assertFalse(isset($col->test)); 
    177     } 
    178  
    179  
    180     /** 
    181      *   
    182      * @test 
    183      * @expectedException Doctrine_Exception 
    184      */ 
    185     public function shouldNotBeAbleToSetNullFieldInRecord() 
    186     { 
    187         $this->user->offsetSet(null, 'test'); 
    188  
    189149    } 
    190150 
  • trunk/tests/Orm/Hydration/BasicHydrationTest.php

    r4523 r4776  
    124124                'metadata' => $this->_em->getClassMetadata('CmsPhonenumber'), 
    125125                'parent' => 'u', 
    126                 'relation' => $this->_em->getClassMetadata('CmsUser')->getRelation('phonenumbers'), 
     126                'relation' => $this->_em->getClassMetadata('CmsUser')->getAssociationMapping('phonenumbers'), 
    127127                'map' => null 
    128128                ) 
     
    227227                'metadata' => $this->_em->getClassMetadata('CmsPhonenumber'), 
    228228                'parent' => 'u', 
    229                 'relation' => $this->_em->getClassMetadata('CmsUser')->getRelation('phonenumbers'), 
     229                'relation' => $this->_em->getClassMetadata('CmsUser')->getAssociationMapping('phonenumbers'), 
    230230                'map' => null, 
    231231                'agg' => array('0' => 'numPhones') 
     
    312312                'metadata' => $this->_em->getClassMetadata('CmsPhonenumber'), 
    313313                'parent' => 'u', 
    314                 'relation' => $this->_em->getClassMetadata('CmsUser')->getRelation('phonenumbers'), 
     314                'relation' => $this->_em->getClassMetadata('CmsUser')->getAssociationMapping('phonenumbers'), 
    315315                'map' => 'phonenumber' 
    316316                ) 
     
    416416                'metadata' => $this->_em->getClassMetadata('CmsPhonenumber'), 
    417417                'parent' => 'u', 
    418                 'relation' => $this->_em->getClassMetadata('CmsUser')->getRelation('phonenumbers'), 
     418                'relation' => $this->_em->getClassMetadata('CmsUser')->getAssociationMapping('phonenumbers'), 
    419419                'map' => null 
    420420                ), 
     
    422422                'metadata' => $this->_em->getClassMetadata('CmsArticle'), 
    423423                'parent' => 'u', 
    424                 'relation' => $this->_em->getClassMetadata('CmsUser')->getRelation('articles'), 
     424                'relation' => $this->_em->getClassMetadata('CmsUser')->getAssociationMapping('articles'), 
    425425                'map' => null 
    426426                ), 
     
    572572                'metadata' => $this->_em->getClassMetadata('CmsPhonenumber'), 
    573573                'parent' => 'u', 
    574                 'relation' => $this->_em->getClassMetadata('CmsUser')->getRelation('phonenumbers'), 
     574                'relation' => $this->_em->getClassMetadata('CmsUser')->getAssociationMapping('phonenumbers'), 
    575575                'map' => null 
    576576                ), 
     
    578578                'metadata' => $this->_em->getClassMetadata('CmsArticle'), 
    579579                'parent' => 'u', 
    580                 'relation' => $this->_em->getClassMetadata('CmsUser')->getRelation('articles'), 
     580                'relation' => $this->_em->getClassMetadata('CmsUser')->getAssociationMapping('articles'), 
    581581                'map' => null 
    582582                ), 
     
    584584                'metadata' => $this->_em->getClassMetadata('CmsComment'), 
    585585                'parent' => 'a', 
    586                 'relation' => $this->_em->getClassMetadata('CmsArticle')->getRelation('comments'), 
     586                'relation' => $this->_em->getClassMetadata('CmsArticle')->getAssociationMapping('comments'), 
    587587                'map' => null 
    588588                ), 
     
    780780                'metadata' => $this->_em->getClassMetadata('ForumBoard'), 
    781781                'parent' => 'c', 
    782                 'relation' => $this->_em->getClassMetadata('ForumCategory')->getRelation('boards'), 
     782                'relation' => $this->_em->getClassMetadata('ForumCategory')->getAssociationMapping('boards'), 
    783783                'map' => null 
    784784                ), 
  • trunk/tests/Orm/Query/IdentifierRecognitionTest.php

    r4523 r4776  
    8585 
    8686        $this->assertTrue($decl['metadata'] instanceof Doctrine_ClassMetadata); 
    87         $this->assertTrue($decl['relation'] instanceof Doctrine_Relation); 
     87        $this->assertTrue($decl['relation'] instanceof Doctrine_Association); 
    8888        $this->assertEquals('u', $decl['parent']); 
    8989        $this->assertEquals(null, $decl['scalar']); 
     
    109109 
    110110        $this->assertTrue($decl['metadata'] instanceof Doctrine_ClassMetadata); 
    111         $this->assertTrue($decl['relation'] instanceof Doctrine_Relation); 
     111        $this->assertTrue($decl['relation'] instanceof Doctrine_Association); 
    112112        $this->assertEquals('u', $decl['parent']); 
    113113        $this->assertEquals(null, $decl['scalar']); 
     
    117117 
    118118        $this->assertTrue($decl['metadata'] instanceof Doctrine_ClassMetadata); 
    119         $this->assertTrue($decl['relation'] instanceof Doctrine_Relation); 
     119        $this->assertTrue($decl['relation'] instanceof Doctrine_Association); 
    120120        $this->assertEquals('u', $decl['parent']); 
    121121        $this->assertEquals(null, $decl['scalar']);