tests/UnitTests/POData/UriProcessor/UriProcessorTest.php
/**
     * Test request uri for row count ($count)     
     * $count is a version 2 feature so service devloper should use protocol version 2.0
     */
Test request uri for row count ($count)
$count is a version 2 feature so service devloper should use protocol version 2.0
Test request uri for row count ( $count ) $count is a version 2 feature so service devloper should use protocol version 2 . 0
public function testUriProcessorForCountRequest2()
    {
        $hostInfo = array(
            'AbsoluteRequestUri' => new Url('http://localhost:8083/NorthWindDataService.svc/Customers/$count'),
            'AbsoluteServiceUri' => new Url('http://localhost:8083/NorthWindDataService.svc'),
            'QueryString' => null,
            'DataServiceVersion' => new Version(2, 0),
            'MaxDataServiceVersion' => new Version(2, 0),
        );
        $host = new ServiceHostTestFake($hostInfo);
        $dataService = new NorthWindServiceV1();
        $dataService->setHost($host);
        try {
            $dataService->handleRequest();
            $this->fail('An expected ODataException for failure of capability negoitation due to V1 configuration has not been thrown');
        } catch (ODataException $ex) {
            $this->assertStringStartsWith("The response requires that version 2.0 of the protocol be used, but the MaxProtocolVersion of the data service is set to 1.0", $ex->getMessage());
        }
    }
public function testUriProcessorForCountRequest2 ( ) { $ hostInfo = array ( 'AbsoluteRequestUri' => new Url ( 'http://localhost:8083/NorthWindDataService.svc/Customers/$count' ) , 'AbsoluteServiceUri' => new Url ( 'http://localhost:8083/NorthWindDataService.svc' ) , 'QueryString' => null , 'DataServiceVersion' => new Version ( 2 , 0 ) , 'MaxDataServiceVersion' => new Version ( 2 , 0 ) , ) ; $ host = new ServiceHostTestFake ( $ hostInfo ) ; $ dataService = new NorthWindServiceV1 ( ) ; $ dataService -> setHost ( $ host ) ; try { $ dataService -> handleRequest ( ) ; $ this -> fail ( 'An expected ODataException for failure of capability negoitation due to V1 configuration has not been thrown' ) ; } catch ( ODataException $ ex ) { $ this -> assertStringStartsWith ( " The response requires that version 2.0 of the protocol be used, but the MaxProtocolVersion of the data service is set to 1.0 " , $ ex -> getMessage ( ) ) ; } }
Test request uri for row count ($count)
 $count is a version 2 feature so service devloper should use protocol version 2.0
Test request uri for row count ( $count ) $count is a version 2 feature so service devloper should use protocol version 2 . 0