tests/UnitTests/POData/UriProcessor/UriProcessorTest.php
/**
     * $filter can be applied on complex resource
     */
$filter can be applied on complex resource
$filter can be applied on complex resource
public function testUriProcessorForFilterOnComplex()
    {
        $baseUri = 'http://localhost:8083/NorthWindDataService.svc/';
        $resourcePath = 'Orders(123)/Customer/Address';
        $hostInfo = array(
            'AbsoluteRequestUri' => new Url($baseUri . $resourcePath),
            'AbsoluteServiceUri' => new Url($baseUri),
            'QueryString' => '$filter=HouseNumber eq null',
            'DataServiceVersion' => new Version(1, 0),
            'MaxDataServiceVersion' => new Version(1, 0),
        );
        $host = new ServiceHostTestFake($hostInfo);
        $dataService = new NorthWindService2();
        $dataService->setHost($host);
        $uriProcessor = $dataService->handleRequest();
        $requestDescription = $uriProcessor->getRequest();
        $this->assertNotNull($requestDescription);
        $this->assertTrue($requestDescription->isSingleResult());
        $filterInfo = $requestDescription->getFilterInfo();
        $this->assertNotNull($filterInfo);
        $this->assertTrue($filterInfo instanceof FilterInfo);
	    $this->assertEquals("", $filterInfo->getExpressionAsString(), "because northwind expression provider does nothing, this is empty");
	    $this->assertNull($requestDescription->getRootProjectionNode());
    }
public function testUriProcessorForFilterOnComplex ( ) { $ baseUri = 'http://localhost:8083/NorthWindDataService.svc/' ; $ resourcePath = 'Orders(123)/Customer/Address' ; $ hostInfo = array ( 'AbsoluteRequestUri' => new Url ( $ baseUri . $ resourcePath ) , 'AbsoluteServiceUri' => new Url ( $ baseUri ) , 'QueryString' => '$filter=HouseNumber eq null' , 'DataServiceVersion' => new Version ( 1 , 0 ) , 'MaxDataServiceVersion' => new Version ( 1 , 0 ) , ) ; $ host = new ServiceHostTestFake ( $ hostInfo ) ; $ dataService = new NorthWindService2 ( ) ; $ dataService -> setHost ( $ host ) ; $ uriProcessor = $ dataService -> handleRequest ( ) ; $ requestDescription = $ uriProcessor -> getRequest ( ) ; $ this -> assertNotNull ( $ requestDescription ) ; $ this -> assertTrue ( $ requestDescription -> isSingleResult ( ) ) ; $ filterInfo = $ requestDescription -> getFilterInfo ( ) ; $ this -> assertNotNull ( $ filterInfo ) ; $ this -> assertTrue ( $ filterInfo instanceof FilterInfo ) ; $ this -> assertEquals ( " " , $ filterInfo -> getExpressionAsString ( ) , " because northwind expression provider does nothing, this is empty " ) ; $ this -> assertNull ( $ requestDescription -> getRootProjectionNode ( ) ) ; }
$filter can be applied on complex resource
$filter can be applied on complex resource
//$filter applied