tests/IntegrationTests/POData/UriProcessor/UriProcessorExecutionTest.php
/**
     * test uri processor executor with not exist resource request.
     */
test uri processor executor with not exist resource request.
test uri processor executor with not exist resource request .
public function testResourceNotFound()
    {
        $serviceUri = 'http://localhost:8083/NorthWindDataService.svc/';
		$resourcePath = 'Orders(10247)';
		$requestUri = $serviceUri . $resourcePath;
		$hostInfo = array('AbsoluteServiceUri' => new Url($serviceUri),
						  'AbsoluteRequestUri' => new Url($requestUri),
		                  'QueryString' => null,
		                  'DataServiceVersion' => new Version(2, 0),
		                  'MaxDataServiceVersion' => new Version(2, 0));
		$host = new DataServiceHost1($hostInfo);
		$dataService = new NorthWindDataService1();
		$dataService->setHost($host);
		$exceptionThrown = false;
            try {
                $queryProcessor = $dataService->handleRequest();
				$queryProcessor->execute();
                $result = $queryProcessor->getRequestDescription()->getLastSegmentDescriptor()->getResult();
            } catch (ODataException $odataException) {
                $exceptionThrown = true;
                $this->assertStringStartsWith("Resource not found for the segment", $odataException->getMessage());
            }
    }
public function testResourceNotFound ( ) { $ serviceUri = 'http://localhost:8083/NorthWindDataService.svc/' ; $ resourcePath = 'Orders(10247)' ; $ requestUri = $ serviceUri . $ resourcePath ; $ hostInfo = array ( 'AbsoluteServiceUri' => new Url ( $ serviceUri ) , 'AbsoluteRequestUri' => new Url ( $ requestUri ) , 'QueryString' => null , 'DataServiceVersion' => new Version ( 2 , 0 ) , 'MaxDataServiceVersion' => new Version ( 2 , 0 ) ) ; $ host = new DataServiceHost1 ( $ hostInfo ) ; $ dataService = new NorthWindDataService1 ( ) ; $ dataService -> setHost ( $ host ) ; $ exceptionThrown = false ; try { $ queryProcessor = $ dataService -> handleRequest ( ) ; $ queryProcessor -> execute ( ) ; $ result = $ queryProcessor -> getRequestDescription ( ) -> getLastSegmentDescriptor ( ) -> getResult ( ) ; } catch ( ODataException $ odataException ) { $ exceptionThrown = true ; $ this -> assertStringStartsWith ( " Resource not found for the segment " , $ odataException -> getMessage ( ) ) ; } }
test uri processor executor with not exist resource request.
test uri processor executor with not exist resource request .