tests/UnitTests/POData/UriProcessor/UriProcessorTest.php
/**
     * Test request uri for row count ($count)     
     * 
     * $select and $expand options are applicable for $count segment.
     * but when we do query execution we will ignore them.
     */
Test request uri for row count ($count)

$select and $expand options are applicable for $count segment.
but when we do query execution we will ignore them.
Test request uri for row count ( $count ) $select and $expand options are applicable for $count segment . but when we do query execution we will ignore them .
public function testUriProcessorForCountRequest9()
    {
        $hostInfo = array(
            'AbsoluteRequestUri' => new Url('http://localhost:8083/NorthWindDataService.svc/Customers/$count'),
            'AbsoluteServiceUri' => new Url('http://localhost:8083/NorthWindDataService.svc'),
            'QueryString' => '$select=Country&$expand=Orders',
            'DataServiceVersion' => new Version(2, 0),
            'MaxDataServiceVersion' => new Version(2, 0),
        );
        $host = new ServiceHostTestFake($hostInfo);
        $dataService = new NorthWindService2();
        $dataService->setHost($host);
        $uriProcessor = $dataService->handleRequest();
        $requestDescription = $uriProcessor->getRequest();
        $this->assertNotNull($requestDescription);
        $projectionTreeRoot = $requestDescription->getRootProjectionNode();
        $this->assertNotNull($projectionTreeRoot);
        $this->assertTrue($projectionTreeRoot instanceof RootProjectionNode);
        $childNodes = $projectionTreeRoot->getChildNodes();
        $this->assertNotNull($childNodes);
        $this->assertTrue(is_array($childNodes));
        $this->assertEquals(count($childNodes), 1);
        $this->assertTrue(array_key_exists('Country', $childNodes));
        $this->assertTrue($childNodes['Country'] instanceof ProjectionNode);
    }
public function testUriProcessorForCountRequest9 ( ) { $ hostInfo = array ( 'AbsoluteRequestUri' => new Url ( 'http://localhost:8083/NorthWindDataService.svc/Customers/$count' ) , 'AbsoluteServiceUri' => new Url ( 'http://localhost:8083/NorthWindDataService.svc' ) , 'QueryString' => '$select=Country&$expand=Orders' , 'DataServiceVersion' => new Version ( 2 , 0 ) , 'MaxDataServiceVersion' => new Version ( 2 , 0 ) , ) ; $ host = new ServiceHostTestFake ( $ hostInfo ) ; $ dataService = new NorthWindService2 ( ) ; $ dataService -> setHost ( $ host ) ; $ uriProcessor = $ dataService -> handleRequest ( ) ; $ requestDescription = $ uriProcessor -> getRequest ( ) ; $ this -> assertNotNull ( $ requestDescription ) ; $ projectionTreeRoot = $ requestDescription -> getRootProjectionNode ( ) ; $ this -> assertNotNull ( $ projectionTreeRoot ) ; $ this -> assertTrue ( $ projectionTreeRoot instanceof RootProjectionNode ) ; $ childNodes = $ projectionTreeRoot -> getChildNodes ( ) ; $ this -> assertNotNull ( $ childNodes ) ; $ this -> assertTrue ( is_array ( $ childNodes ) ) ; $ this -> assertEquals ( count ( $ childNodes ) , 1 ) ; $ this -> assertTrue ( array_key_exists ( 'Country' , $ childNodes ) ) ; $ this -> assertTrue ( $ childNodes [ 'Country' ] instanceof ProjectionNode ) ; }
Test request uri for row count ($count)
Test request uri for row count ( $count )
//There will be one child node for 'Country', 'Orders' wont be included //as its not selected