コード例 #1
0
ファイル: DataService2.php プロジェクト: i-geo/odataphpprod
<?php

/**
 * A wrapper class over DataService class, this class will be used for
 * testing the DataService and UriProcessor classes.
 * Why this class: 
 *  The DataService::handleRequest method will be serailizing the result
 *  or exception, so testing is difficult.
 *  Instead we will use DataService2::handleRequest as this function 
 *  works same as DataService::handleRequest expect it throws exception 
 *  in case of error and return instance of UriProcessor if paring is 
 *  successful.
 */
require_once 'ODataProducer\\Common\\ClassAutoLoader.php';
ODataProducer\Common\ClassAutoLoader::register();
use ODataProducer\DataService;
use ODataProducer\Common\ODataException;
use ODataProducer\UriProcessor\UriProcessor;
abstract class DataService2 extends DataService
{
    public function handleRequest()
    {
        $this->createProviders();
        try {
            $this->getHost()->validateQueryParameters();
        } catch (ODataException $odataException) {
            throw $odataException;
        }
        $uriProcessor = null;
        try {
            $uriProcessor = UriProcessor::process($this);
コード例 #2
0
 protected function tearDown()
 {
     ODataProducer\Common\ClassAutoLoader::unRegister();
 }