tests/UnitTests/POData/Providers/Metadata/ResourceClassesTest.php
/**
     * Test ResourceAssociationSet class
     * Note: ResourceAssociationSet is an internal class used for metadata generation, not suppose to used by the developers 
     */
Test ResourceAssociationSet class
Note: ResourceAssociationSet is an internal class used for metadata generation, not suppose to used by the developers
Test ResourceAssociationSet class Note : ResourceAssociationSet is an internal class used for metadata generation not suppose to used by the developers
public function testResourceAssociationSet()
    {
        $customerResType = $this->_getCustomerResourceType();
        $customerResourceSet = new ResourceSet('Customers', $customerResType);
        $orderResType = $this->_getOrderResourceType();
        $orderResourceSet = new ResourceSet('Orders', $orderResType);
        $customerReferenceProperty = new ResourceProperty('Customer', null, ResourcePropertyKind::RESOURCE_REFERENCE, $customerResType);
        $ordersReferenceSetProperty = new ResourceProperty('Orders', null, ResourcePropertyKind::RESOURCESET_REFERENCE, $orderResType);
        $customerResType->addProperty($ordersReferenceSetProperty);
        $orderResType->addProperty($customerReferenceProperty);
        $assoSetEnd1 = new ResourceAssociationSetEnd($customerResourceSet, $customerResType, $ordersReferenceSetProperty);
        $assoSetEnd2 = new ResourceAssociationSetEnd($orderResourceSet, $orderResType, $customerReferenceProperty);
        $assoSet = new ResourceAssociationSet('Orders_Customers', $assoSetEnd1, $assoSetEnd2);
        $this->assertEquals($assoSet->getName(), 'Orders_Customers');
        $this->assertSame($assoSet->getEnd1(), $assoSetEnd1);
        $this->assertSame($assoSet->getEnd2(), $assoSetEnd2);
        $actual = $assoSet->getResourceAssociationSetEnd($customerResourceSet, $customerResType, $ordersReferenceSetProperty);
        $this->assertSame($assoSetEnd1, $actual);
        $actual = $assoSet->getRelatedResourceAssociationSetEnd($customerResourceSet, $customerResType, $ordersReferenceSetProperty);
        $this->assertSame($assoSetEnd2, $actual);
    }
public function testResourceAssociationSet ( ) { $ customerResType = $ this -> _getCustomerResourceType ( ) ; $ customerResourceSet = new ResourceSet ( 'Customers' , $ customerResType ) ; $ orderResType = $ this -> _getOrderResourceType ( ) ; $ orderResourceSet = new ResourceSet ( 'Orders' , $ orderResType ) ; $ customerReferenceProperty = new ResourceProperty ( 'Customer' , null , ResourcePropertyKind :: RESOURCE_REFERENCE , $ customerResType ) ; $ ordersReferenceSetProperty = new ResourceProperty ( 'Orders' , null , ResourcePropertyKind :: RESOURCESET_REFERENCE , $ orderResType ) ; $ customerResType -> addProperty ( $ ordersReferenceSetProperty ) ; $ orderResType -> addProperty ( $ customerReferenceProperty ) ; $ assoSetEnd1 = new ResourceAssociationSetEnd ( $ customerResourceSet , $ customerResType , $ ordersReferenceSetProperty ) ; $ assoSetEnd2 = new ResourceAssociationSetEnd ( $ orderResourceSet , $ orderResType , $ customerReferenceProperty ) ; $ assoSet = new ResourceAssociationSet ( 'Orders_Customers' , $ assoSetEnd1 , $ assoSetEnd2 ) ; $ this -> assertEquals ( $ assoSet -> getName ( ) , 'Orders_Customers' ) ; $ this -> assertSame ( $ assoSet -> getEnd1 ( ) , $ assoSetEnd1 ) ; $ this -> assertSame ( $ assoSet -> getEnd2 ( ) , $ assoSetEnd2 ) ; $ actual = $ assoSet -> getResourceAssociationSetEnd ( $ customerResourceSet , $ customerResType , $ ordersReferenceSetProperty ) ; $ this -> assertSame ( $ assoSetEnd1 , $ actual ) ; $ actual = $ assoSet -> getRelatedResourceAssociationSetEnd ( $ customerResourceSet , $ customerResType , $ ordersReferenceSetProperty ) ; $ this -> assertSame ( $ assoSetEnd2 , $ actual ) ; }
Test ResourceAssociationSet class
 Note: ResourceAssociationSet is an internal class used for metadata generation, not suppose to used by the developers
Test ResourceAssociationSet class Note : ResourceAssociationSet is an internal class used for metadata generation not suppose to used by the developers