tests/UnitTests/POData/UriProcessor/UriProcessorTest.php
/**
     * $filter option can be applied to $links resource set
     */
$filter option can be applied to $links resource set
$filter option can be applied to $links resource set
public function testUriProcessorForLinksResourceSet4()
    {
        $this->markTestSkipped("This test checks that POData will generate a filter function for providers that don't handle filtering...but i temporarily removed that functionality by elimination IDataServiceQueryProvider1.  Need to make this service provider use PHPExpressionProvider, then re-enable tests");
        $baseUri = 'http://localhost:8083/NorthWindDataService.svc/';
        $resourcePath = 'Customers(CustomerID=\'ALFKI\', CustomerGuid=guid\'05b242e752eb46bd8f0e6568b72cd9a5\')/$links/Orders';
        $hostInfo = array(
            'AbsoluteRequestUri' => new Url($baseUri . $resourcePath),                                
            'AbsoluteServiceUri' => new Url($baseUri),
            'QueryString' => '$filter=OrderID eq 123 and OrderDate le datetime\'2000-11-11\'',
            '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);
        $this->assertFalse($requestDescription->isSingleResult());
        $this->assertEquals($requestDescription->getTopCount(), 5); 
        $internalOrderByInfo = $requestDescription->getInternalOrderByInfo();
        $this->assertNotNull($internalOrderByInfo);
        $filterInfo = $requestDescription->getFilterInfo();
        $this->assertNotNull($filterInfo);
        $this->assertTrue($filterInfo instanceof FilterInfo);
	    $expected ='((!(is_null($lt->OrderID)) && !(is_null($lt->OrderDate))) && (($lt->OrderID == 123) && (POData\Providers\Metadata\Type\DateTime::dateTimeCmp($lt->OrderDate, \'2000-11-11\') <= 0)))';
	    $this->assertEquals($expected, $filterInfo->getExpressionAsString(), "because northwind expression provider does nothing, this is empty");
    }
public function testUriProcessorForLinksResourceSet4 ( ) { $ this -> markTestSkipped ( " This test checks that POData will generate a filter function for providers that don't handle filtering...but i temporarily removed that functionality by elimination IDataServiceQueryProvider1.  Need to make this service provider use PHPExpressionProvider, then re-enable tests " ) ; $ baseUri = 'http://localhost:8083/NorthWindDataService.svc/' ; $ resourcePath = 'Customers(CustomerID=\'ALFKI\', CustomerGuid=guid\'05b242e752eb46bd8f0e6568b72cd9a5\')/$links/Orders' ; $ hostInfo = array ( 'AbsoluteRequestUri' => new Url ( $ baseUri . $ resourcePath ) , 'AbsoluteServiceUri' => new Url ( $ baseUri ) , 'QueryString' => '$filter=OrderID eq 123 and OrderDate le datetime\'2000-11-11\'' , '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 ) ; $ this -> assertFalse ( $ requestDescription -> isSingleResult ( ) ) ; $ this -> assertEquals ( $ requestDescription -> getTopCount ( ) , 5 ) ; $ internalOrderByInfo = $ requestDescription -> getInternalOrderByInfo ( ) ; $ this -> assertNotNull ( $ internalOrderByInfo ) ; $ filterInfo = $ requestDescription -> getFilterInfo ( ) ; $ this -> assertNotNull ( $ filterInfo ) ; $ this -> assertTrue ( $ filterInfo instanceof FilterInfo ) ; $ expected = '((!(is_null($lt->OrderID)) && !(is_null($lt->OrderDate))) && (($lt->OrderID == 123) && (POData\Providers\Metadata\Type\DateTime::dateTimeCmp($lt->OrderDate, \'2000-11-11\') <= 0)))' ; $ this -> assertEquals ( $ expected , $ filterInfo -> getExpressionAsString ( ) , " because northwind expression provider does nothing, this is empty " ) ; }
$filter option can be applied to $links resource set
$filter option can be applied to $links resource set
//paging enabled //$filter applied