Changeset 1378

Show
Ignore:
Timestamp:
02/26/08 17:37:39 (6 months ago)
Author:
mikey
Message:

removed net::stubbles::ipo::request::stubRequestValueErrorFactoryMappingDecorator, not required any more

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/main/php/net/stubbles/ipo/request/broker/annotations/stubAbstractFilterAnnotation.php

    r1323 r1378  
    5151     */ 
    5252    protected $defaultValue    = null; 
    53     /** 
    54      * list of error mappings 
    55      * 
    56      * @var  array<array<string,string>> 
    57      */ 
    58     protected $mappings        = array(); 
    5953 
    6054    /** 
     
    106100    { 
    107101        $this->defaultValue = $defaultValue; 
    108     } 
    109  
    110     /** 
    111      * sets the error mapping 
    112      * 
    113      * @param  string  $errorMapping 
    114      */ 
    115     public function setErrorMapping($errorMapping) 
    116     { 
    117         $mappings = explode(':', $errorMapping); 
    118         foreach ($mappings as $mapping) { 
    119             $errorIds         = explode('=>', $mapping); 
    120             $this->mappings[trim($errorIds[0])] = trim($errorIds[1]); 
    121         } 
    122102    } 
    123103 
     
    174154        } 
    175155         
    176         if (count($this->mappings) === 0) { 
    177             return $this->rveFactory; 
    178         } 
    179          
    180         stubClassLoader::load('net::stubbles::ipo::request::stubRequestValueErrorFactoryMappingDecorator'); 
    181         $this->rveFactory = new stubRequestValueErrorFactoryMappingDecorator($this->rveFactory); 
    182         foreach ($this->mappings as $oldErrorId => $newErrorId) { 
    183             $this->rveFactory->addMapping($oldErrorId, $newErrorId); 
    184         } 
    185          
    186156        return $this->rveFactory; 
    187157    } 
  • trunk/src/test/php/net/stubbles/ipo/IPOTestSuite.php

    r1365 r1378  
    2929        $suite->addTestFile($dir . '/request/stubAbstractRequestTestCase.php'); 
    3030        $suite->addTestFile($dir . '/request/stubRequestPrefixDecoratorTestCase.php'); 
    31         $suite->addTestFile($dir . '/request/stubRequestValueErrorFactoryMappingDecoratorTestCase.php'); 
    3231        $suite->addTestFile($dir . '/request/stubRequestValueErrorTestCase.php'); 
    3332        $suite->addTestFile($dir . '/request/stubWebRequestTestCase.php'); 
  • trunk/src/test/php/net/stubbles/ipo/request/broker/annotations/stubAbstractFilterAnnotationTestCase.php

    r1323 r1378  
    161161 
    162162    /** 
    163      * test that mapping is added correct 
    164      * 
    165      * @test 
    166      */ 
    167     public function mappedRequestErrorValueFactory() 
    168     { 
    169         $abstractFilterAnnotation = new TeststubAbstractFilterAnnotation(); 
    170         $abstractFilterAnnotation->setErrorMapping('FIELD_EMPTY=>FOO_EMPTY:TOO_SMALL=>TOO_GREAT'); 
    171         $rveFactory = $abstractFilterAnnotation->getRVEFactory(); 
    172         $this->assertType('stubRequestValueErrorFactoryMappingDecorator', $rveFactory); 
    173         $this->assertEquals(array('FIELD_EMPTY' => 'FOO_EMPTY', 
    174                                   'TOO_SMALL'   => 'TOO_GREAT' 
    175                             ), 
    176                             $rveFactory->getMappings() 
    177         ); 
    178         $this->assertSame($rveFactory, $abstractFilterAnnotation->getRVEFactory()); 
    179     } 
    180  
    181     /** 
    182163     * test that the correct RequestErrorValueFactory is created 
    183164     *