tests/UnitTests/POData/UriProcessor/UriProcessorTest.php
/**
     * If paging is enabled for a resource set, then $link request for that resource set
     * will also paged
     * e.g. http://host/service.svc/Customers('A')/$links/Orders
     * here if paging is enabled for Orders then processor must generate orderbyinfo for
     * this.     
     */
If paging is enabled for a resource set, then $link request for that resource set
will also paged
e.g.
If paging is enabled for a resource set then $link request for that resource set will also paged e . g .
public function testUriProcessorForResourcePageInfo4()
    {
        $baseUri = 'http://localhost:8083/NorthWindDataService.svc/';
        $resourcePath = 'Customers(CustomerID=\'ALFKI\', CustomerGuid=guid\'05b242e752eb46bd8f0e6568b72cd9a5\')/$links/Orders';
        $hostInfo = array(
            'AbsoluteRequestUri' => new Url($baseUri . $resourcePath),
            'AbsoluteServiceUri' => new Url($baseUri),
            'QueryString' => null,
            'DataServiceVersion' => new Version(1, 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->getTopCount(), 5);
        $internalOrderByInfo = $requestDescription->getInternalOrderByInfo();
        $this->assertNotNull($internalOrderByInfo);
        $pathSegments = $internalOrderByInfo->getOrderByPathSegments();
        $this->assertNotNull($pathSegments);
        $this->assertTrue(is_array($pathSegments));
        $this->assertEquals(count($pathSegments), 1);
        $this->assertTrue($pathSegments[0] instanceof OrderByPathSegment);
        $subPathSegments = $pathSegments[0]->getSubPathSegments();
        $this->assertNotNull($subPathSegments);
        $this->assertTrue(is_array($subPathSegments));
        $this->assertEquals(count($subPathSegments), 1);
        $this->assertTrue($subPathSegments[0] instanceof OrderBySubPathSegment);
        $this->assertEquals($subPathSegments[0]->getName(), 'OrderID');
    }
public function testUriProcessorForResourcePageInfo4 ( ) { $ baseUri = 'http://localhost:8083/NorthWindDataService.svc/' ; $ resourcePath = 'Customers(CustomerID=\'ALFKI\', CustomerGuid=guid\'05b242e752eb46bd8f0e6568b72cd9a5\')/$links/Orders' ; $ hostInfo = array ( 'AbsoluteRequestUri' => new Url ( $ baseUri . $ resourcePath ) , 'AbsoluteServiceUri' => new Url ( $ baseUri ) , 'QueryString' => null , 'DataServiceVersion' => new Version ( 1 , 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 -> getTopCount ( ) , 5 ) ; $ internalOrderByInfo = $ requestDescription -> getInternalOrderByInfo ( ) ; $ this -> assertNotNull ( $ internalOrderByInfo ) ; $ pathSegments = $ internalOrderByInfo -> getOrderByPathSegments ( ) ; $ this -> assertNotNull ( $ pathSegments ) ; $ this -> assertTrue ( is_array ( $ pathSegments ) ) ; $ this -> assertEquals ( count ( $ pathSegments ) , 1 ) ; $ this -> assertTrue ( $ pathSegments [ 0 ] instanceof OrderByPathSegment ) ; $ subPathSegments = $ pathSegments [ 0 ] -> getSubPathSegments ( ) ; $ this -> assertNotNull ( $ subPathSegments ) ; $ this -> assertTrue ( is_array ( $ subPathSegments ) ) ; $ this -> assertEquals ( count ( $ subPathSegments ) , 1 ) ; $ this -> assertTrue ( $ subPathSegments [ 0 ] instanceof OrderBySubPathSegment ) ; $ this -> assertEquals ( $ subPathSegments [ 0 ] -> getName ( ) , 'OrderID' ) ; }
If paging is enabled for a resource set, then $link request for that resource set
 will also paged
 e.g.
If paging is enabled for a resource set then $link request for that resource set will also paged e . g .
//Test for generation of orderinfo for resource set in $links query //Page size is 5, so take count is 5 //order info is required for pagination //Order has one key