tests/UnitTests/POData/UriProcessor/UriProcessorTest.php
/**
     * $top and $skip option cannot be applied to $links resource set reference
     */
$top and $skip option cannot be applied to $links resource set reference
$top and $skip option cannot be applied to $links resource set reference
public function testUriProcessorForLinksResourceSetReference4()
    {
        $baseUri = 'http://localhost:8083/NorthWindDataService.svc/';
        $resourcePath = 'Customers(CustomerID=\'ALFKI\', CustomerGuid=guid\'05b242e752eb46bd8f0e6568b72cd9a5\')/$links/Orders(123)';
        $hostInfo = array(
            'AbsoluteRequestUri' => new Url($baseUri . $resourcePath),
            'AbsoluteServiceUri' => new Url($baseUri),
            'QueryString' => '$skip=1',
            'DataServiceVersion' => new Version(2, 0),
            'MaxDataServiceVersion' => new Version(2, 0),
        );
        $host = new ServiceHostTestFake($hostInfo);
        $dataService = new NorthWindService2();
        $dataService->setHost($host);
        try {
            $dataService->handleRequest();
            $this->fail('An expected ODataException for $skip query option on non-set has not been thrown');
        } catch (ODataException $ex) {
            $this->assertStringStartsWith('Query options $orderby, $inlinecount, $skip and $top cannot be applied to the requested resource', $ex->getMessage());
        }
        $baseUri = 'http://localhost:8083/NorthWindDataService.svc/';
        $resourcePath = 'Customers(CustomerID=\'ALFKI\', CustomerGuid=guid\'05b242e752eb46bd8f0e6568b72cd9a5\')/$links/Orders(234)';
        $hostInfo = array(
            'AbsoluteRequestUri' => new Url($baseUri . $resourcePath),
            'AbsoluteServiceUri' => new Url($baseUri),
            'QueryString' => '$top=4',
            'DataServiceVersion' => new Version(2, 0),
            'MaxDataServiceVersion' => new Version(2, 0),
        );
        $host = new ServiceHostTestFake($hostInfo);
        $dataService = new NorthWindService2();
        $dataService->setHost($host);
        try {
            $dataService->handleRequest();
            $this->fail('An expected ODataException for $top query option on non-set has not been thrown');
        } catch (ODataException $ex) {
            $this->assertStringStartsWith('Query options $orderby, $inlinecount, $skip and $top cannot be applied to the requested resource', $ex->getMessage());
        }
    }
public function testUriProcessorForLinksResourceSetReference4 ( ) { $ baseUri = 'http://localhost:8083/NorthWindDataService.svc/' ; $ resourcePath = 'Customers(CustomerID=\'ALFKI\', CustomerGuid=guid\'05b242e752eb46bd8f0e6568b72cd9a5\')/$links/Orders(123)' ; $ hostInfo = array ( 'AbsoluteRequestUri' => new Url ( $ baseUri . $ resourcePath ) , 'AbsoluteServiceUri' => new Url ( $ baseUri ) , 'QueryString' => '$skip=1' , 'DataServiceVersion' => new Version ( 2 , 0 ) , 'MaxDataServiceVersion' => new Version ( 2 , 0 ) , ) ; $ host = new ServiceHostTestFake ( $ hostInfo ) ; $ dataService = new NorthWindService2 ( ) ; $ dataService -> setHost ( $ host ) ; try { $ dataService -> handleRequest ( ) ; $ this -> fail ( 'An expected ODataException for $skip query option on non-set has not been thrown' ) ; } catch ( ODataException $ ex ) { $ this -> assertStringStartsWith ( 'Query options $orderby, $inlinecount, $skip and $top cannot be applied to the requested resource' , $ ex -> getMessage ( ) ) ; } $ baseUri = 'http://localhost:8083/NorthWindDataService.svc/' ; $ resourcePath = 'Customers(CustomerID=\'ALFKI\', CustomerGuid=guid\'05b242e752eb46bd8f0e6568b72cd9a5\')/$links/Orders(234)' ; $ hostInfo = array ( 'AbsoluteRequestUri' => new Url ( $ baseUri . $ resourcePath ) , 'AbsoluteServiceUri' => new Url ( $ baseUri ) , 'QueryString' => '$top=4' , 'DataServiceVersion' => new Version ( 2 , 0 ) , 'MaxDataServiceVersion' => new Version ( 2 , 0 ) , ) ; $ host = new ServiceHostTestFake ( $ hostInfo ) ; $ dataService = new NorthWindService2 ( ) ; $ dataService -> setHost ( $ host ) ; try { $ dataService -> handleRequest ( ) ; $ this -> fail ( 'An expected ODataException for $top query option on non-set has not been thrown' ) ; } catch ( ODataException $ ex ) { $ this -> assertStringStartsWith ( 'Query options $orderby, $inlinecount, $skip and $top cannot be applied to the requested resource' , $ ex -> getMessage ( ) ) ; } }
$top and $skip option cannot be applied to $links resource set reference
$top and $skip option cannot be applied to $links resource set reference