tests/UnitTests/POData/UriProcessor/UriProcessorTest.php
/**
     * $filter cannot be applied on primitive resource
     */
$filter cannot be applied on primitive resource
$filter cannot be applied on primitive resource
public function testUriProcessorForFilterOnPrimitiveType()
    {
        $baseUri = 'http://localhost:8083/NorthWindDataService.svc/';
        $resourcePath = 'Products(11)/ProductID';
        $hostInfo = array(
            'AbsoluteRequestUri' => new Url($baseUri . $resourcePath),
            'AbsoluteServiceUri' => new Url($baseUri),
            'QueryString' => '$filter=true',
            'DataServiceVersion' => new Version(1, 0),
            'MaxDataServiceVersion' => new Version(1, 0),
        );
        $host = new ServiceHostTestFake($hostInfo);
        $dataService = new NorthWindService2();
        $dataService->setHost($host);
        try {
               $dataService->handleRequest();
            $this->fail('An expected ODataException for $filter query on primitve  has not been thrown');
        } catch (ODataException $ex) {
            $this->assertStringStartsWith('Query option $filter cannot be applied to the requested resource', $ex->getMessage());
        }
    }
public function testUriProcessorForFilterOnPrimitiveType ( ) { $ baseUri = 'http://localhost:8083/NorthWindDataService.svc/' ; $ resourcePath = 'Products(11)/ProductID' ; $ hostInfo = array ( 'AbsoluteRequestUri' => new Url ( $ baseUri . $ resourcePath ) , 'AbsoluteServiceUri' => new Url ( $ baseUri ) , 'QueryString' => '$filter=true' , 'DataServiceVersion' => new Version ( 1 , 0 ) , 'MaxDataServiceVersion' => new Version ( 1 , 0 ) , ) ; $ host = new ServiceHostTestFake ( $ hostInfo ) ; $ dataService = new NorthWindService2 ( ) ; $ dataService -> setHost ( $ host ) ; try { $ dataService -> handleRequest ( ) ; $ this -> fail ( 'An expected ODataException for $filter query on primitve  has not been thrown' ) ; } catch ( ODataException $ ex ) { $ this -> assertStringStartsWith ( 'Query option $filter cannot be applied to the requested resource' , $ ex -> getMessage ( ) ) ; } }
$filter cannot be applied on primitive resource
$filter cannot be applied on primitive resource