tests/UnitTests/POData/UriProcessor/QueryProcessor/ExpandProjectionParser/SelectTest.php
/**
     * Selection of a parent navigation property casues selection of child navigations
     * for example $expand=A/B/C, A/D/F & $select = A
     * case result to include A and subtree of A (i.e B/C and D/F)
     * But selection of immediate properties of A with '*' cause to ignore the 
     * child nodes if they are not selected explicitly.
     *  $expand=A/B/C, A/D/F & $select = A/*
     *  	cause to ingore B/C and D/F
     *  $expand=A/B/C, A/D/F & $select = A/*, A/B
     *  	cuase of include immediate propertises of A, select B and ignore D
     * 
     */
Selection of a parent navigation property casues selection of child navigations
for example $expand=A/B/C, A/D/F & $select = A
case result to include A and subtree of A
But selection of immediate properties of A with '*' cause to ignore the
child nodes if they are not selected explicitly.
Selection of a parent navigation property casues selection of child navigations for example $expand = A / B / C A / D / F & $select = A case result to include A and subtree of A But selection of immediate properties of A with ' * ' cause to ignore the child nodes if they are not selected explicitly .
public function testRemovalOfSubTreeWhichIsExpandedButNotSelected2()
    {
        $northWindMetadata = NorthWindMetadata::Create();
        $queryProvider = new NorthWindQueryProvider();
        $configuration = new ServiceConfiguration($northWindMetadata);
        $configuration->setEntitySetAccessRule('*', EntitySetRights::ALL);
        $providersWrapper = new ProvidersWrapper(
                                       $northWindMetadata, 
                                       $queryProvider, 
                                       $configuration, 
                                       false
                                     );
        $ordersResourceSetWrapper = $providersWrapper->resolveResourceSet('Orders');
        $orderResourceType = $ordersResourceSetWrapper->getResourceType();
        $projectionTreeRoot = ExpandProjectionParser::parseExpandAndSelectClause(
                                    $ordersResourceSetWrapper,
                                    $orderResourceType,
                                    null,
                                    null,
                                    null,
                                    'Order_Details/Product, Order_Details/Order', 
                                    'Order_Details/*', 
                                    $providersWrapper);
        $this->assertTrue($projectionTreeRoot->isExpansionSpecified());
        $this->assertTrue($projectionTreeRoot->isSelectionSpecified());
        $this->assertFalse($projectionTreeRoot->canSelectAllImmediateProperties());
        $this->assertFalse($projectionTreeRoot->canSelectAllProperties());
        $this->assertEquals(count($projectionTreeRoot->getChildNodes()), 1);
        $childNodes = $projectionTreeRoot->getChildNodes();
        $this->assertTrue(array_key_exists('Order_Details', $childNodes));
        $this->assertTrue($childNodes['Order_Details'] instanceof ExpandedProjectionNode);
        $this->assertTrue($childNodes['Order_Details']->canSelectAllImmediateProperties());
        $this->assertTrue($childNodes['Order_Details']->canSelectAllProperties());
        $childNodes = $childNodes['Order_Details']->getChildNodes();
        $this->assertEquals(count($childNodes), 0);
    }
public function testRemovalOfSubTreeWhichIsExpandedButNotSelected2 ( ) { $ northWindMetadata = NorthWindMetadata :: Create ( ) ; $ queryProvider = new NorthWindQueryProvider ( ) ; $ configuration = new ServiceConfiguration ( $ northWindMetadata ) ; $ configuration -> setEntitySetAccessRule ( '*' , EntitySetRights :: ALL ) ; $ providersWrapper = new ProvidersWrapper ( $ northWindMetadata , $ queryProvider , $ configuration , false ) ; $ ordersResourceSetWrapper = $ providersWrapper -> resolveResourceSet ( 'Orders' ) ; $ orderResourceType = $ ordersResourceSetWrapper -> getResourceType ( ) ; $ projectionTreeRoot = ExpandProjectionParser :: parseExpandAndSelectClause ( $ ordersResourceSetWrapper , $ orderResourceType , null , null , null , 'Order_Details/Product, Order_Details/Order' , 'Order_Details/*' , $ providersWrapper ) ; $ this -> assertTrue ( $ projectionTreeRoot -> isExpansionSpecified ( ) ) ; $ this -> assertTrue ( $ projectionTreeRoot -> isSelectionSpecified ( ) ) ; $ this -> assertFalse ( $ projectionTreeRoot -> canSelectAllImmediateProperties ( ) ) ; $ this -> assertFalse ( $ projectionTreeRoot -> canSelectAllProperties ( ) ) ; $ this -> assertEquals ( count ( $ projectionTreeRoot -> getChildNodes ( ) ) , 1 ) ; $ childNodes = $ projectionTreeRoot -> getChildNodes ( ) ; $ this -> assertTrue ( array_key_exists ( 'Order_Details' , $ childNodes ) ) ; $ this -> assertTrue ( $ childNodes [ 'Order_Details' ] instanceof ExpandedProjectionNode ) ; $ this -> assertTrue ( $ childNodes [ 'Order_Details' ] -> canSelectAllImmediateProperties ( ) ) ; $ this -> assertTrue ( $ childNodes [ 'Order_Details' ] -> canSelectAllProperties ( ) ) ; $ childNodes = $ childNodes [ 'Order_Details' ] -> getChildNodes ( ) ; $ this -> assertEquals ( count ( $ childNodes ) , 0 ) ; }
Selection of a parent navigation property casues selection of child navigations
 for example $expand=A/B/C, A/D/F & $select = A
 case result to include A and subtree of A (i.e B/C and D/F)
 But selection of immediate properties of A with '*' cause to ignore the
 child nodes if they are not selected explicitly.
Selection of a parent navigation property casues selection of child navigations for example $expand = A / B / C A / D / F & $select = A case result to include A and subtree of A ( i . e B / C and D / F ) But selection of immediate properties of A with ' * ' cause to ignore the child nodes if they are not selected explicitly .
//IMetadataProvider implementation //IDataServiceQueryProvider implementation (set to null) //Service configuration //Selecting immediate properties of 'Order_Details' will de-select subtree of //'Order_Details' if they are not selected explicitly //$expand //$select //expand option is present //select is applied //We did not applied '*' for root resource set i.e. to 'Orders' //selectSubTree flag for root resource set is false (canSelectAllProperities is true for '*' and selectsubTree //There is a one child node for root //The child node is 'ExpandProjectionNode' for 'Order_Details' //All immediate properties of 'Order_Details' should be selected as '*' applied to it //There is no child node for 'Product' because of the application of '*'