Changeset 1435

Show
Ignore:
Timestamp:
03/18/08 17:21:26 (4 months ago)
Author:
mikey
Message:

backlash from refactoring #138: clean up processor interface and handling in front controller

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/main/php/net/stubbles/service/jsonrpc/stubJsonRpcProcessor.php

    r1434 r1435  
    5050     * 
    5151     * This method only dispatches the request to different subprocessors. 
    52      *  
    53      * @return  stubAbstractProcessor 
    5452     */ 
    5553    public function process() 
     
    6361        $subProcessor = new $nqClassName(); 
    6462        $subProcessor->process($this->request, $this->session, $this->response, $this->loadClassMap()); 
    65         return $this; 
    6663    } 
    6764 
  • trunk/src/main/php/net/stubbles/websites/processors/stubAbstractPageProcessor.php

    r1256 r1435  
    2727    /** 
    2828     * processes the request 
    29      * 
    30      * @return  stubProcessor 
    3129     */ 
    3230    public function process() 
     
    4341         
    4442        $this->doProcess($page, $pageName); 
    45         return $this; 
    4643    } 
    4744 
  • trunk/src/main/php/net/stubbles/websites/processors/stubAbstractProcessor.php

    r1248 r1435  
    108108        return $this->ssl; 
    109109    } 
    110  
    111     /** 
    112      * returns the created response 
    113      * 
    114      * @return  stubResponse 
    115      */ 
    116     public function getResponse() 
    117     { 
    118         return $this->response; 
    119     } 
    120110} 
    121111?> 
  • trunk/src/main/php/net/stubbles/websites/processors/stubProcessor.php

    r1247 r1435  
    5353    /** 
    5454     * processes the request 
    55      *  
    56      * @return  stubProcessor 
    5755     */ 
    5856    public function process(); 
    59      
    60     /** 
    61      * returns the created response 
    62      * 
    63      * @return  stubResponse 
    64      */ 
    65     public function getResponse(); 
    6657} 
    6758?> 
  • trunk/src/main/php/net/stubbles/websites/stubFrontController.php

    r1408 r1435  
    135135        } 
    136136         
    137         $this->response = $processor->process()->getResponse(); 
     137        $processor->process(); 
    138138        if ($this->request->isCancelled() === false) { 
    139139            foreach ($interceptorInitializer->getPostInterceptors() as $postInterceptor) { 
  • trunk/src/test/php/net/stubbles/service/jsonrpc/stubJsonRpcProcessorTestCase.php

    r1361 r1435  
    117117        $jsonRpcProcessor->expects($this->once())->method('getSubProcessorClassName')->will($this->returnValue($subProcessorClass)); 
    118118        $jsonRpcProcessor->expects($this->once())->method('loadClassMap')->will($this->returnValue(array())); 
    119         $this->assertSame($jsonRpcProcessor, $jsonRpcProcessor->process()); 
     119        $jsonRpcProcessor->process(); 
    120120    } 
    121121 
  • trunk/src/test/php/net/stubbles/websites/stubFrontControllerTestCase.php

    r1408 r1435  
    187187                                         ->method('getPostInterceptors'); 
    188188        $this->mockRequest->expects($this->once())->method('isCancelled')->will($this->returnValue(true)); 
    189         $this->mockProcessor->expects($this->any()) 
    190                             ->method('process') 
    191                             ->will($this->returnValue($this->mockProcessor)); 
    192         $this->mockResponse2 = $this->getMock('stubResponse'); 
    193         $this->mockResponse2->expects($this->once())->method('send'); 
    194         $this->mockProcessor->expects($this->once()) 
    195                             ->method('getResponse') 
    196                             ->will($this->returnValue($this->mockResponse2)); 
     189        $this->mockProcessor->expects($this->any())->method('process'); 
     190        $this->mockResponse->expects($this->once())->method('send'); 
    197191        $this->frontController->process(); 
    198192    } 
     
    218212                          ->method('isCancelled') 
    219213                          ->will($this->onConsecutiveCalls(false, true)); 
    220         $this->mockProcessor->expects($this->any()) 
    221                             ->method('process') 
    222                             ->will($this->returnValue($this->mockProcessor)); 
    223         $this->mockResponse2 = $this->getMock('stubResponse'); 
    224         $this->mockResponse2->expects($this->once())->method('send'); 
    225         $this->mockProcessor->expects($this->once()) 
    226                             ->method('getResponse') 
    227                             ->will($this->returnValue($this->mockResponse2)); 
     214        $this->mockProcessor->expects($this->any())->method('process'); 
     215        $this->mockResponse->expects($this->once())->method('send'); 
    228216        $this->frontController->process(); 
    229217    } 
     
    251239                                         ->will($this->returnValue(array($postInterceptor1, $postInterceptor2))); 
    252240        $this->mockRequest->expects($this->any())->method('isCancelled')->will($this->returnValue(false)); 
    253         $this->mockProcessor->expects($this->any()) 
    254                             ->method('process') 
    255                             ->will($this->returnValue($this->mockProcessor)); 
    256         $this->mockResponse2 = $this->getMock('stubResponse'); 
    257         $this->mockResponse2->expects($this->once())->method('send'); 
    258         $this->mockProcessor->expects($this->once()) 
    259                             ->method('getResponse') 
    260                             ->will($this->returnValue($this->mockResponse2)); 
     241        $this->mockProcessor->expects($this->any())->method('process'); 
     242        $this->mockResponse->expects($this->once())->method('send'); 
    261243        $this->mockWebsiteCacheFactory->expects($this->once())->method('configure'); 
    262244        $this->frontController->setWebsiteCacheFactory($this->mockWebsiteCacheFactory);