tests/UnitTests/POData/UriProcessor/UriProcessorTest.php
/**
     * Test uri processor with all options
     */
Test uri processor with all options
Test uri processor with all options
public function testUriProcessorWithBigQuery()
    {
        $baseUri = 'http://localhost:8083/NorthWindDataService.svc/';
        $resourcePath = 'Orders(123)/Customer/Orders';
        $hostInfo = array(
            'AbsoluteRequestUri' => new Url($baseUri . $resourcePath),
            'AbsoluteServiceUri' => new Url($baseUri),
            'QueryString' => '$expand=Customer&$select=Customer,OrderDate&$filter=OrderID eq 123&$orderby=OrderDate&top=6&$skip=10&$skiptoken=datetime\'2000-11-11\',567',
            '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->assertEquals($requestDescription->getTopCount(), 5);
        $this->assertEquals($requestDescription->getSkipCount(), 10);
        $this->assertNotNull($requestDescription->getInternalOrderByInfo());
        $this->assertNotNull($requestDescription->getFilterInfo());
        $this->assertNotNull($requestDescription->getInternalSkipTokenInfo());
        $this->assertNotNull($requestDescription->getRootProjectionNode());
    }
public function testUriProcessorWithBigQuery ( ) { $ baseUri = 'http://localhost:8083/NorthWindDataService.svc/' ; $ resourcePath = 'Orders(123)/Customer/Orders' ; $ hostInfo = array ( 'AbsoluteRequestUri' => new Url ( $ baseUri . $ resourcePath ) , 'AbsoluteServiceUri' => new Url ( $ baseUri ) , 'QueryString' => '$expand=Customer&$select=Customer,OrderDate&$filter=OrderID eq 123&$orderby=OrderDate&top=6&$skip=10&$skiptoken=datetime\'2000-11-11\',567' , '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 -> assertEquals ( $ requestDescription -> getTopCount ( ) , 5 ) ; $ this -> assertEquals ( $ requestDescription -> getSkipCount ( ) , 10 ) ; $ this -> assertNotNull ( $ requestDescription -> getInternalOrderByInfo ( ) ) ; $ this -> assertNotNull ( $ requestDescription -> getFilterInfo ( ) ) ; $ this -> assertNotNull ( $ requestDescription -> getInternalSkipTokenInfo ( ) ) ; $ this -> assertNotNull ( $ requestDescription -> getRootProjectionNode ( ) ) ; }
Test uri processor with all options
Test uri processor with all options