tests/UnitTests/POData/UriProcessor/UriProcessorTest.php
/**
     * The MaxProtocolVersion configured for the service should be >=3.0 to respond to request for Bag 
     */
The MaxProtocolVersion configured for the service should be >=3.0 to respond to request for Bag
The MaxProtocolVersion configured for the service should be > = 3 . 0 to respond to request for Bag
public function testUriProcessorWithTargetAsBag2()
    {
        $baseUri = 'http://localhost:8083/NorthWindDataService.svc/';
        $resourcePath = 'Employees(\'EMP1\')/Emails';
        $hostInfo = array(
            'AbsoluteRequestUri' => new Url($baseUri . $resourcePath),
            'AbsoluteServiceUri' => new Url($baseUri),
            'QueryString' => null,
            'DataServiceVersion' => new Version(3, 0),
            'MaxDataServiceVersion' => new Version(3, 0),
        );
        $host = new ServiceHostTestFake($hostInfo);
        $dataService = new NorthWindService2();
        $dataService->setHost($host);
        try {
            $dataService->handleRequest();
            $this->fail('An expected ODataException for a bag request to a service configured with V2 has not been thrown');
        } catch (ODataException $ex) {
            $this->assertStringStartsWith("The response requires that version 3.0 of the protocol be used, but the MaxProtocolVersion of the data service is set to 2.0", $ex->getMessage());
        }
    }
public function testUriProcessorWithTargetAsBag2 ( ) { $ baseUri = 'http://localhost:8083/NorthWindDataService.svc/' ; $ resourcePath = 'Employees(\'EMP1\')/Emails' ; $ hostInfo = array ( 'AbsoluteRequestUri' => new Url ( $ baseUri . $ resourcePath ) , 'AbsoluteServiceUri' => new Url ( $ baseUri ) , 'QueryString' => null , 'DataServiceVersion' => new Version ( 3 , 0 ) , 'MaxDataServiceVersion' => new Version ( 3 , 0 ) , ) ; $ host = new ServiceHostTestFake ( $ hostInfo ) ; $ dataService = new NorthWindService2 ( ) ; $ dataService -> setHost ( $ host ) ; try { $ dataService -> handleRequest ( ) ; $ this -> fail ( 'An expected ODataException for a bag request to a service configured with V2 has not been thrown' ) ; } catch ( ODataException $ ex ) { $ this -> assertStringStartsWith ( " The response requires that version 3.0 of the protocol be used, but the MaxProtocolVersion of the data service is set to 2.0 " , $ ex -> getMessage ( ) ) ; } }
The MaxProtocolVersion configured for the service should be >=3.0 to respond to request for Bag
The MaxProtocolVersion configured for the service should be > = 3 . 0 to respond to request for Bag