tests/UnitTests/POData/UriProcessor/UriProcessorTest.php
/**
     * For $inline request, client's DataServiceVersion header must be >= 2.0
     */
For $inline request, client's DataServiceVersion header must be >= 2.0
For $inline request client ' s DataServiceVersion header must be > = 2 . 0
public function testUriProcessorForInlineCount2()
    {
        $baseUri = 'http://localhost:8083/NorthWindDataService.svc/';
        $resourcePath = 'Products(11)/Order_Details';
        $hostInfo = array(
            'AbsoluteRequestUri' => new Url($baseUri . $resourcePath),
            'AbsoluteServiceUri' => new Url($baseUri),
            'QueryString' => '$inlinecount=allpages',
            'DataServiceVersion' => new Version(1, 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 $inlinecount query option request DataServiceVersion 1.0 has not been thrown');
        } catch (ODataException $ex) {
            $this->assertStringStartsWith("Request version '1.0' is not supported for the request payload. The only supported version is '2.0'", $ex->getMessage());
        }
    }
public function testUriProcessorForInlineCount2 ( ) { $ baseUri = 'http://localhost:8083/NorthWindDataService.svc/' ; $ resourcePath = 'Products(11)/Order_Details' ; $ hostInfo = array ( 'AbsoluteRequestUri' => new Url ( $ baseUri . $ resourcePath ) , 'AbsoluteServiceUri' => new Url ( $ baseUri ) , 'QueryString' => '$inlinecount=allpages' , 'DataServiceVersion' => new Version ( 1 , 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 $inlinecount query option request DataServiceVersion 1.0 has not been thrown' ) ; } catch ( ODataException $ ex ) { $ this -> assertStringStartsWith ( " Request version '1.0' is not supported for the request payload. The only supported version is '2.0' " , $ ex -> getMessage ( ) ) ; } }
For $inline request, client's DataServiceVersion header must be >= 2.0
For $inline request client ' s DataServiceVersion header must be > = 2 . 0