tests/UnitTests/POData/UriProcessor/UriProcessorTest.php
/**
     * select and expand can be applied to request url identifying resource set reference
     * Here the top level resource will not be paged as its a resource set reference
     * But if there is an expansion that leads to resource set then paging will be required for
     * the expanded result means hould request with MaxDataServiceVersion 2_0     
     */
select and expand can be applied to request url identifying resource set reference
Here the top level resource will not be paged as its a resource set reference
But if there is an expansion that leads to resource set then paging will be required for
the expanded result means hould request with MaxDataServiceVersion 2_0
select and expand can be applied to request url identifying resource set reference Here the top level resource will not be paged as its a resource set reference But if there is an expansion that leads to resource set then paging will be required for the expanded result means hould request with MaxDataServiceVersion 2_0
public function testUriProcessorForSelectExpandOnResourceSetReference()
    {
        $baseUri = 'http://localhost:8083/NorthWindDataService.svc/';
        $resourcePath = 'Orders(11)/Customer';
        $hostInfo = array(
            'AbsoluteRequestUri' => new Url($baseUri . $resourcePath),
            'AbsoluteServiceUri' => new Url($baseUri),
            'QueryString' => '$expand=Orders&$select=CustomerID,Orders',
            'DataServiceVersion' => new Version(2, 0),
            'MaxDataServiceVersion' => new Version(2, 0),
        );
        $host = new ServiceHostTestFake($hostInfo);
        $dataService = new NorthWindService2();
        $dataService->setHost($host);
        $uriProcessor = $dataService->handleRequest();
        $requestDescription = $uriProcessor->getRequest();
        $this->assertNotNull($requestDescription);
        $this->assertEquals($requestDescription->isSingleResult(), true);
        $this->assertEquals($requestDescription->getTopCount(), null);
        $internalOrderByInfo = $requestDescription->getInternalOrderByInfo();
        $this->assertNull($internalOrderByInfo);
        $projectionTreeRoot = $requestDescription->getRootProjectionNode();
        $this->assertNotNull($projectionTreeRoot);
        $this->assertTrue($projectionTreeRoot instanceof RootProjectionNode);
        $childNodes = $projectionTreeRoot->getChildNodes();
        $this->assertNotNull($childNodes);
        $this->assertTrue(is_array($childNodes));
        $this->assertEquals(count($childNodes), 2);
        $this->assertTrue(array_key_exists('Orders', $childNodes));
        $this->assertTrue($childNodes['Orders'] instanceof ExpandedProjectionNode);
        $this->assertTrue(array_key_exists('Orders', $childNodes));
        $this->assertTrue($childNodes['Orders'] instanceof ProjectionNode);
        $ordersExpandedNode = $childNodes['Orders'];
        $internalOrderByInfo = $ordersExpandedNode->getInternalOrderByInfo();
        $this->assertNotNull($internalOrderByInfo);
        $this->assertTrue($internalOrderByInfo instanceof InternalOrderByInfo);
    }
public function testUriProcessorForSelectExpandOnResourceSetReference ( ) { $ baseUri = 'http://localhost:8083/NorthWindDataService.svc/' ; $ resourcePath = 'Orders(11)/Customer' ; $ hostInfo = array ( 'AbsoluteRequestUri' => new Url ( $ baseUri . $ resourcePath ) , 'AbsoluteServiceUri' => new Url ( $ baseUri ) , 'QueryString' => '$expand=Orders&$select=CustomerID,Orders' , 'DataServiceVersion' => new Version ( 2 , 0 ) , 'MaxDataServiceVersion' => new Version ( 2 , 0 ) , ) ; $ host = new ServiceHostTestFake ( $ hostInfo ) ; $ dataService = new NorthWindService2 ( ) ; $ dataService -> setHost ( $ host ) ; $ uriProcessor = $ dataService -> handleRequest ( ) ; $ requestDescription = $ uriProcessor -> getRequest ( ) ; $ this -> assertNotNull ( $ requestDescription ) ; $ this -> assertEquals ( $ requestDescription -> isSingleResult ( ) , true ) ; $ this -> assertEquals ( $ requestDescription -> getTopCount ( ) , null ) ; $ internalOrderByInfo = $ requestDescription -> getInternalOrderByInfo ( ) ; $ this -> assertNull ( $ internalOrderByInfo ) ; $ projectionTreeRoot = $ requestDescription -> getRootProjectionNode ( ) ; $ this -> assertNotNull ( $ projectionTreeRoot ) ; $ this -> assertTrue ( $ projectionTreeRoot instanceof RootProjectionNode ) ; $ childNodes = $ projectionTreeRoot -> getChildNodes ( ) ; $ this -> assertNotNull ( $ childNodes ) ; $ this -> assertTrue ( is_array ( $ childNodes ) ) ; $ this -> assertEquals ( count ( $ childNodes ) , 2 ) ; $ this -> assertTrue ( array_key_exists ( 'Orders' , $ childNodes ) ) ; $ this -> assertTrue ( $ childNodes [ 'Orders' ] instanceof ExpandedProjectionNode ) ; $ this -> assertTrue ( array_key_exists ( 'Orders' , $ childNodes ) ) ; $ this -> assertTrue ( $ childNodes [ 'Orders' ] instanceof ProjectionNode ) ; $ ordersExpandedNode = $ childNodes [ 'Orders' ] ; $ internalOrderByInfo = $ ordersExpandedNode -> getInternalOrderByInfo ( ) ; $ this -> assertNotNull ( $ internalOrderByInfo ) ; $ this -> assertTrue ( $ internalOrderByInfo instanceof InternalOrderByInfo ) ; }
select and expand can be applied to request url identifying resource set reference
 Here the top level resource will not be paged as its a resource set reference
 But if there is an expansion that leads to resource set then paging will be required for
 the expanded result means hould request with MaxDataServiceVersion 2_0
select and expand can be applied to request url identifying resource set reference Here the top level resource will not be paged as its a resource set reference But if there is an expansion that leads to resource set then paging will be required for the expanded result means hould request with MaxDataServiceVersion 2_0
//use of $select requires this header to 1.0 //The expanded property will be paged, so skiptoken will be there //client says i can handle it //paging is not applicable for resource set reference 'Customer' //no orderby infor //There will be two child nodes //Expand Projection Node => 'Orders' //Projection Node => 'CustomerID' //Sort info will be there for expanded 'Orders' as paging is //enabled for this resource set