Changeset 339
- Timestamp:
- 03/06/07 16:32:01 (2 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/docroot/xml.php
r338 r339 45 45 } 46 46 $request->getFilteredValue(new TestFilter(), 'foo_bar'); 47 $request->getFilteredValue(new TestFilter(), 'foo_bar'); 47 48 $pageFactory = new stubXJConfPageFactory(stubXJConfLoader::getInstance()); 48 49 $processor = new stubXMLProcessor($request, $session, $response, $pageFactory); trunk/src/main/php/net/stubbles/ipo/request/stubAbstractRequest.php
r298 r339 267 267 $error =& $this->getErrors($source); 268 268 if (isset($error[$valueName]) == false) { 269 $error[$valueName] = array(); 269 $error[$valueName] = array($fe->getError()); 270 } else { 271 $ids = array(); 272 foreach ($error[$valueName] as $errorValue) { 273 $ids[] = $errorValue->getId(); 274 } 275 276 if (in_array($fe->getError()->getId(), $ids) == false) { 277 $error[$valueName][] = $fe->getError(); 278 } 270 279 } 271 280 272 $error[$valueName][] = $fe->getError();273 281 return null; 274 282 } trunk/src/test/php/net/stubbles/ipo/request/stubAbstractRequestTestCase.php
r318 r339 7 7 * @subpackage ipo_test 8 8 */ 9 stubClassLoader::load('net.stubbles.ipo.request.stubAbstractRequest'); 9 stubClassLoader::load('net.stubbles.ipo.request.stubAbstractRequest', 10 'net.stubbles.ipo.request.filters.stubAbstractFilter' 11 ); 10 12 Mock::generate('stubValidator'); 11 13 Mock::generate('stubFilter'); 12 14 Mock::generate('stubEventListener'); 15 class stubTestExceptionFilter extends stubAbstractFilter 16 { 17 public function execute($value) 18 { 19 throw new stubFilterException(new stubRequestValueError('foo', array())); 20 } 21 } 13 22 class stubTestRequest extends stubAbstractRequest 14 23 { … … 294 303 $this->assertEqual($this->request->getValueErrors(stubRequest::SOURCE_COOKIE), array('foo' => array($errorValue))); 295 304 } 305 306 /** 307 * assure that the same error occurs only once in list of errors for a value 308 */ 309 public function testErrorOnlyAddedOnce() 310 { 311 $errorValue = new stubRequestValueError('foo', array()); 312 $this->request->setValueError('foo', $errorValue); 313 $this->assertEqual($this->request->getValueError('foo'), array($errorValue)); 314 $this->request->getFilteredValue(new stubTestExceptionFilter(), 'foo'); 315 $this->assertEqual($this->request->getValueError('foo'), array($errorValue)); 316 } 296 317 } 297 318 ?>
