Changeset 1533
- Timestamp:
- 04/12/08 18:35:23 (1 month ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/main/php/net/stubbles/websites/stubFrontController.php
r1531 r1533 116 116 public function process() 117 117 { 118 if ($this->request->isCancelled() === true) { 119 $this->response->send(); 120 return; 121 } 122 118 123 $processorResolverFactory = $this->websiteInitializer->getProcessorResolverFactory(); 119 124 $processorResolverFactory->init(); trunk/src/test/php/net/stubbles/websites/stubFrontControllerTestCase.php
r1464 r1533 150 150 * @test 151 151 */ 152 public function processWithAlreadyCancelledRequest() 153 { 154 $this->mockRequest->expects($this->once())->method('isCancelled')->will($this->returnValue(true)); 155 $this->mockResponse->expects($this->once())->method('send'); 156 $this->mockProcessor->expects($this->never())->method('forceSSL'); 157 $this->mockInterceptorInitializer->expects($this->never())->method('getPreInterceptors'); 158 $this->mockInterceptorInitializer->expects($this->never())->method('getPostInterceptors'); 159 $this->mockProcessor->expects($this->never())->method('getInterceptorDescriptor'); 160 $this->mockProcessor->expects($this->never())->method('process'); 161 $this->mockWebsiteCacheFactory->expects($this->never())->method('configure'); 162 $this->frontController->setWebsiteCacheFactory($this->mockWebsiteCacheFactory); 163 $this->frontController->process(); 164 } 165 166 /** 167 * assure that processing ends when request is cancelled 168 * 169 * @test 170 */ 152 171 public function processWithPreInterceptorCancellingRequest() 153 172 { … … 161 180 ->will($this->returnValue(array($preInterceptor1, $preInterceptor2))); 162 181 $this->mockInterceptorInitializer->expects($this->never())->method('getPostInterceptors'); 163 $this->mockRequest->expects($this-> once())->method('isCancelled')->will($this->returnValue(true));182 $this->mockRequest->expects($this->exactly(2))->method('isCancelled')->will($this->onConsecutiveCalls(false, true)); 164 183 $this->mockResponse->expects($this->once())->method('send'); 165 184 $this->mockProcessor->expects($this->once()) … … 189 208 $this->mockInterceptorInitializer->expects($this->never()) 190 209 ->method('getPostInterceptors'); 191 $this->mockRequest->expects($this-> once())->method('isCancelled')->will($this->returnValue(true));210 $this->mockRequest->expects($this->exactly(2))->method('isCancelled')->will($this->onConsecutiveCalls(false, true)); 192 211 $this->mockProcessor->expects($this->any())->method('process'); 193 212 $this->mockResponse->expects($this->once())->method('send'); … … 213 232 ->method('getPostInterceptors') 214 233 ->will($this->returnValue(array($postInterceptor1, $postInterceptor2))); 215 $this->mockRequest->expects($this->exactly( 2))234 $this->mockRequest->expects($this->exactly(3)) 216 235 ->method('isCancelled') 217 ->will($this->onConsecutiveCalls(false, true));236 ->will($this->onConsecutiveCalls(false, false, true)); 218 237 $this->mockProcessor->expects($this->any())->method('process'); 219 238 $this->mockResponse->expects($this->once())->method('send');
