tests/UnitTests/POData/UriProcessor/UriProcessorTest.php
/**
     * Test request uri for row count ($count)     
     * $count with $inlinecount not allowed
     */
Test request uri for row count ($count)
$count with $inlinecount not allowed
Test request uri for row count ( $count ) $count with $inlinecount not allowed
public function testUriProcessorForCountWithInline()
    {
        $hostInfo = array(
            'AbsoluteRequestUri' => new Url('http://localhost:8083/NorthWindDataService.svc/Customers/$count'),
            'AbsoluteServiceUri' => new Url('http://localhost:8083/NorthWindDataService.svc'),
            'QueryString' => '$inlinecount=allpages',
            '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 applying $skiptoken on $count has not been thrown');
        } catch (ODataException $ex) {
            $this->assertStringStartsWith("\$inlinecount cannot be applied to the resource segment \$count", $ex->getMessage());
        }
    }
public function testUriProcessorForCountWithInline ( ) { $ hostInfo = array ( 'AbsoluteRequestUri' => new Url ( 'http://localhost:8083/NorthWindDataService.svc/Customers/$count' ) , 'AbsoluteServiceUri' => new Url ( 'http://localhost:8083/NorthWindDataService.svc' ) , 'QueryString' => '$inlinecount=allpages' , '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 applying $skiptoken on $count has not been thrown' ) ; } catch ( ODataException $ ex ) { $ this -> assertStringStartsWith ( " \$ inlinecount cannot be applied to the resource segment  \$ count " , $ ex -> getMessage ( ) ) ; } }
Test request uri for row count ($count)
 $count with $inlinecount not allowed
Test request uri for row count ( $count ) $count with $inlinecount not allowed