Changeset 315

Show
Ignore:
Timestamp:
03/01/07 16:43:45 (1 year ago)
Author:
mikey
Message:

stubResponse is now available in preInterceptors

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/docroot/xml.php

    r309 r315  
    99                      'net.stubbles.ipo.request.filters.stubAbstractFilter', 
    1010                      'net.stubbles.ipo.request.stubRequestValueError', 
    11                       'net.stubbles.ipo.session.stubPHPSession' 
     11                      'net.stubbles.ipo.session.stubPHPSession', 
     12                      'net.stubbles.ipo.response.stubBaseResponse' 
    1213); 
    1314class TestFilter extends stubAbstractFilter 
     
    3031            unlink($file->getPathname()); 
    3132        } 
    32         $request     = new stubWebRequest(); 
    33         $session     = new stubPHPSession('stubSID'); 
     33         
     34        $request        = new stubWebRequest(); 
     35        $session        = new stubPHPSession('stubSID'); 
     36        $response       = new stubBaseResponse(); 
    3437        $preInterceptor = new stubXMLPreInterceptor(); 
    3538        $preInterceptor->setRequest($request); 
    3639        $preInterceptor->setSession($session); 
     40        $preInterceptor->setResponse($response); 
    3741        $preInterceptor->preProcess(); 
    3842        if ($request->isCancelled() == true) { 
     43            $response->send(); 
    3944            return; 
    4045        } 
    4146        $request->getFilteredValue(new TestFilter(), 'bar'); 
    4247        $pageFactory = new stubXJConfPageFactory(stubXJConfLoader::getInstance()); 
    43         $processor   = new stubXMLProcessor($request, $session, $pageFactory); 
     48        $processor   = new stubXMLProcessor($request, $session, $response, $pageFactory); 
    4449        $postInterceptor = new stubXMLPagePostInterceptor(); 
    4550        $response = $processor->process()->getResponse(); 
  • trunk/src/main/php/net/stubbles/websites/memphis/stubMemphisProcessor.php

    r301 r315  
    2424     * @param  stubRequest      $request      the current request 
    2525     * @param  stubSession      $session      the current session 
     26     * @param  stubResponse     $response     the current response 
    2627     * @param  stubPageFactory  $pageFactory  page factory to use to read the page configuration 
    2728     */ 
    28     public function __construct(stubRequest $request, stubSession $session, stubPageFactory $pageFactory) 
     29    public function __construct(stubRequest $request, stubSession $session, stubResponse $response, stubPageFactory $pageFactory) 
    2930    { 
    30         parent::__construct($request, $session, $pageFactory); 
    31         $this->response = new stubBaseResponse(); 
     31        parent::__construct($request, $session, $response, $pageFactory); 
    3232    } 
    3333 
  • trunk/src/main/php/net/stubbles/websites/processors/stubAbstractProcessor.php

    r280 r315  
    4646     * @param  stubRequest      $request      the current request 
    4747     * @param  stubSession      $session      the current session 
     48     * @param  stubResponse     $response     the current response 
    4849     * @param  stubPageFactory  $pageFactory  page factory to use to read the page configuration 
    4950     */ 
    50     public function __construct(stubRequest $request, stubSession $session, stubPageFactory $pageFactory) 
     51    public function __construct(stubRequest $request, stubSession $session, stubResponse $response, stubPageFactory $pageFactory) 
    5152    { 
    5253        $this->request     = $request; 
    5354        $this->session     = $session; 
     55        $this->response    = $response; 
    5456        $this->pageFactory = $pageFactory; 
    5557    } 
     
    7476     * returns the created response 
    7577     * 
    76      * @return  null 
     78     * @return  stubResponse 
    7779     */ 
    7880    public function getResponse() 
  • trunk/src/main/php/net/stubbles/websites/processors/stubDefaultProcessorResolver.php

    r284 r315  
    7272     * resolves the request and creates the appropriate processor 
    7373     * 
    74      * @param   stubRequest    $request  the current request 
    75      * @param   stubSession    $session  the current session 
     74     * @param   stubRequest    $request   the current request 
     75     * @param   stubSession    $session   the current session 
     76     * @param   stubResponse   $response  the current response 
    7677     * @return  stubProcessor 
    7778     * @throws  stubProcessorException 
    7879     */ 
    79     public function resolve(stubRequest $request, stubSession $session
     80    public function resolve(stubRequest $request, stubSession $session, stubResponse $response
    8081    { 
    8182        if (count($this->processors) == 0) { 
     
    9899        stubClassLoader::load($this->processors[$paramValue]); 
    99100        $className = stubClassLoader::getNonQualifiedClassName($this->processors[$paramValue]); 
    100         $processor = new $className($request, $session, $this->pageFactory); 
     101        $processor = new $className($request, $session, $response, $this->pageFactory); 
    101102        if (($processor instanceof stubProcessor) == false) { 
    102103            throw new stubProcessorException($this->processors[$paramValue] . ' is not an instance of ' . stubClassLoader::getFullQualifiedClassName('stubProcessor')); 
  • trunk/src/main/php/net/stubbles/websites/processors/stubProcessor.php

    r279 r315  
    2525     * @param  stubRequest      $request      the current request 
    2626     * @param  stubSession      $session      the current session 
     27     * @param  stubResponse     $response     the current response 
    2728     * @param  stubPageFactory  $pageFactory  page factory to use to read the page configuration 
    2829     */ 
    29     #public function __construct(stubRequest $request, stubSession $session, stubPageFactory $pageFactory); 
     30    #public function __construct(stubRequest $request, stubSession $session, , stubResponse $response, stubPageFactory $pageFactory); 
    3031 
    3132    /** 
  • trunk/src/main/php/net/stubbles/websites/processors/stubProcessorResolver.php

    r279 r315  
    3232     * resolves the request and creates the appropriate processor 
    3333     * 
    34      * @param   stubRequest    $request  the current request 
    35      * @param   stubSession    $session  the current session 
     34     * @param   stubRequest    $request   the current request 
     35     * @param   stubSession    $session   the current session 
     36     * @param   stubResponse   $response  the current response 
    3637     * @return  stubProcessor 
    3738     * @throws  stubProcessorException 
    3839     */ 
    39     public function resolve(stubRequest $request, stubSession $session); 
     40    public function resolve(stubRequest $request, stubSession $session, stubResponse $response); 
    4041} 
    4142?> 
  • trunk/src/main/php/net/stubbles/websites/processors/stubSimpleProcessorResolver.php

    r283 r315  
    5353     * resolves the request and creates the appropriate processor 
    5454     * 
    55      * @param   stubRequest    $request  the current request 
    56      * @param   stubSession    $session  the current session 
     55     * @param   stubRequest    $request   the current request 
     56     * @param   stubSession    $session   the current session 
     57     * @param   stubResponse   $response  the current response 
    5758     * @return  stubProcessor 
    5859     * @throws  stubProcessorException 
    5960     */ 
    60     public function resolve(stubRequest $request, stubSession $session
     61    public function resolve(stubRequest $request, stubSession $session, stubResponse $response
    6162    { 
    6263        if (null == $this->processor) { 
     
    6667        stubClassLoader::load($this->processor); 
    6768        $className = stubClassLoader::getNonQualifiedClassName($this->processor); 
    68         $processor = new $className($request, $session, $this->pageFactory); 
     69        $processor = new $className($request, $session, $response, $this->pageFactory); 
    6970        if (($processor instanceof stubProcessor) == false) { 
    7071            throw new stubProcessorException($this->processor . ' is not an instance of ' . stubClassLoader::getFullQualifiedClassName('stubProcessor')); 
  • trunk/src/main/php/net/stubbles/websites/stubFrontController.php

    r311 r315  
    1212                      'net.stubbles.ipo.session.stubPHPSession', 
    1313                      'net.stubbles.util.stubRegistry', 
    14                       'net.stubbles.util.xjconf.stubXJConfLoader' 
    15 ); 
    16 XJConfLoader::load('DefinitionParser', 
    17                    'XmlParser', 
    18                    'XJConfClassLoader' 
     14                      'net.stubbles.util.xjconf.xjconf' 
    1915); 
    2016/** 
     
    6359     */ 
    6460    protected $session; 
     61    /** 
     62     * response container 
     63     * 
     64     * @var  stubResponse 
     65     */ 
     66    protected $response; 
    6567 
    6668    /** 
    6769     * constructor 
     70     *  
     71     * @throws  stubXJConfException 
    6872     */ 
    6973    public function __construct() 
    7074    { 
    71         $tagParser = new DefinitionParser(array('http://stubbles.net/ipo/interceptors' => stubXJConfLoader::getInstance(), 
    72                                                 'http://stubbles.net/websites'         => stubXJConfLoader::getInstance() 
    73                                           ) 
    74                      ); 
    75         $defs      = $tagParser->parse(stubFactory::getResourceURI('xjconf/interceptors.xml')); 
    76         $xmlParser = new XmlParser(); 
    77         $xmlParser->setTagDefinitions($defs); 
    78         try { 
    79             $xmlParser->parse(stubConfig::getConfigPath() . '/xml/interceptors.xml'); 
    80         } catch (XJConfException $xjce) { 
    81             throw new stubException($xjce->getMessage()); 
    82         } 
     75        $xjconf = new stubXJConfFacade(array('http://stubbles.net/ipo/interceptors' => stubXJConfLoader::getInstance(), 
     76                                             'http://stubbles.net/websites'         => stubXJConfLoader::getInstance() 
     77                                       ) 
     78                  ); 
     79        $xjconf->setDefinitionFile(stubFactory::getResourceURI('xjconf/interceptors.xml')); 
     80        $xjconf->parse(stubConfig::getConfigPath() . '/xml/interceptors.xml'); 
     81        $this->preInterceptors  = $xjconf->getConfigValue('preInterceptors'); 
     82        $this->postInterceptors = $xjconf->getConfigValue('postInterceptors'); 
    8383         
    84         $this->preInterceptors  = $xmlParser->getConfigValue('preInterceptors'); 
    85         $this->postInterceptors = $xmlParser->getConfigValue('postInterceptors'); 
    86          
    87         $defs      = $tagParser->parse(stubFactory::getResourceURI('xjconf/processors.xml')); 
    88         $xmlParser = new XmlParser(); 
    89         $xmlParser->setTagDefinitions($defs); 
    90         try { 
    91             $xmlParser->parse(stubConfig::getConfigPath() . '/xml/processors.xml'); 
    92         } catch (XJConfException $xjce) { 
    93             throw new stubException($xjce->getMessage()); 
    94         } 
    95         $this->resolver     = $xmlParser->getConfigValue('resolver'); 
     84        $xjconf->setDefinitionFile(stubFactory::getResourceURI('xjconf/processors.xml')); 
     85        $xjconf->parse(stubConfig::getConfigPath() . '/xml/processors.xml'); 
     86        $this->resolver     = $xjconf->getConfigValue('resolver'); 
    9687         
    9788        $this->injectionMap = new stubInjectionMap(); 
     
    10091            stubClassLoader::load($fqClassName); 
    10192            $className = stubClassLoader::getNonQualifiedClassName($fqClassName); 
    102             $request  = new $className(); 
    103             if (($request instanceof stubRequest) == false) { 
     93            $this->request = new $className(); 
     94            if (($this->request instanceof stubRequest) == false) { 
    10495                throw new stubException('Configured request class is not an instance of stubRequest.'); 
    10596            } 
    106              
    107             $this->injectionMap->addInjection('stubRequest', $request); 
    10897        } else { 
    109             $this->injectionMap->addInjection('stubRequest', new stubWebRequest()); 
     98            $this->request = new stubWebRequest(); 
    11099        } 
     100        $this->injectionMap->addInjection('stubRequest', $this->request); 
    111101         
    112102        if (stubRegistry::hasConfig('net.stubbles.ipo.session.class') == true) { 
     
    114104            stubClassLoader::load($fqClassName); 
    115105            $className = stubClassLoader::getNonQualifiedClassName($fqClassName); 
    116             $session   = new $className(); 
    117             if (($session instanceof stubSession) == false) { 
     106            $this->session   = new $className(); 
     107            if (($this->session instanceof stubSession) == false) { 
    118108                throw new stubException('Configured session class is not an instance of stubSession.'); 
    119109            } 
    120              
    121             $this->injectionMap->addInjection('stubSession', $session); 
    122110        } else { 
    123             $this->injectionMap->addInjection('stubSession', new stubPHPSession()); 
     111            $this->session = new stubPHPSession(); 
    124112        } 
     113        $this->injectionMap->addInjection('stubSession', $this->session); 
     114         
     115        $this->response = new stubBaseResponse(); 
     116        $this->injectionMap->addInjection('stubResponse', $this->response); 
    125117    } 
    126118 
    127     /** 
    128      * processes all preinterceptors 
    129      */ 
    130     protected function startUp() 
    131     { 
    132         foreach ($this->preInterceptors as $preInterceptor) { 
    133             stubInjectAnnotation::factory($this->injectionMap, $preInterceptor); 
    134             $preInterceptor->preProcess(); 
    135         } 
    136     } 
    137  
    138     /** 
    139      * processes all postinterceptors 
    140      */ 
    141     protected function tearDown() 
    142     { 
    143         foreach ($this->postInterceptors as $postInterceptor) { 
    144             stubInjectAnnotation::factory($this->injectionMap, $postInterceptor); 
    145             $postInterceptor->postProcess(); 
    146         } 
    147     } 
    148      
    149119    /** 
    150120     * does the whole processing 
     
    152122    public function process() 
    153123    { 
    154         $this->startUp(); 
    155         $response = $this->resolver->resolve($this->request, $this->session)->process()->getResponse(); 
    156         $this->injectionMap->addInjection('stubResponse', $response); 
    157         $this->tearDown(); 
    158         $response->send(); 
     124        foreach ($this->preInterceptors as $preInterceptor) { 
     125            stubInjectAnnotation::factory($this->injectionMap, $preInterceptor); 
     126            $preInterceptor->preProcess(); 
     127            if ($this->request->isCancelled() == true) { 
     128                $this->response->send(); 
     129                return; 
     130            } 
     131        } 
     132         
     133        $this->response = $this->resolver->resolve($this->request, $this->session, $this->response)->process()->getResponse(); 
     134        $this->injectionMap->addInjection('stubResponse', $this->response); 
     135         
     136        foreach ($this->postInterceptors as $postInterceptor) { 
     137            stubInjectAnnotation::factory($this->injectionMap, $postInterceptor); 
     138            $postInterceptor->postProcess(); 
     139            if ($this->request->isCancelled() == true) { 
     140                break; 
     141            } 
     142        } 
     143         
     144        $this->response->send(); 
    159145    } 
    160146} 
  • trunk/src/main/php/net/stubbles/websites/xml/stubXMLPreInterceptor.php

    r295 r315  
    1919 * @package     stubbles 
    2020 * @subpackage  websites_xml 
    21  * @Inject(stubRequest:stubSession
     21 * @Inject(stubRequest:stubSession:stubResponse
    2222 */ 
    2323class stubXMLPreInterceptor extends stubBaseObject implements stubPreInterceptor 
     
    3535     */ 
    3636    protected $session; 
     37    /** 
     38     * the response instance 
     39     * 
     40     * @var  stubResponse 
     41     */ 
     42    protected $response; 
    3743     
    3844    /** 
     
    5763     
    5864    /** 
     65     * the response instance to use 
     66     * 
     67     * @param  stubResponse  $request 
     68     */ 
     69    public function setResponse(stubResponse $response) 
     70    { 
     71        $this->response = $response; 
     72    } 
     73     
     74    /** 
    5975     * does the preprocessing stuff 
    6076     */ 
     
    6278    { 
    6379        if ($this->request->hasValue('showLastRequestXML') == true && $this->session->isNew() == false) { 
    64             $response = new stubBaseResponse(); 
    65             $response->addHeader('Content-type', 'text/xml'); 
    66             $response->write($this->session->getValue('net.stubbles.websites.lastRequestResponseData')); 
     80            $this->response->addHeader('Content-type', 'text/xml'); 
     81            $this->response->write($this->session->getValue('net.stubbles.websites.lastRequestResponseData')); 
    6782            $this->request->cancel(); 
    68             $response->send(); 
    6983        } 
    7084    } 
  • trunk/src/main/php/net/stubbles/websites/xml/stubXMLProcessor.php

    r301 r315  
    2828     * @param  stubRequest      $request      the current request 
    2929     * @param  stubSession      $session      the current session 
     30     * @param  stubResponse     $response     the current response 
    3031     * @param  stubPageFactory  $pageFactory  page factory to use to read the page configuration 
    3132     */ 
    32     public function __construct(stubRequest $request, stubSession $session, stubPageFactory $pageFactory) 
     33    public function __construct(stubRequest $request, stubSession $session, stubResponse $response, stubPageFactory $pageFactory) 
    3334    { 
    34         parent::__construct($request, $session, $pageFactory); 
    35         $this->response = new stubXMLResponse(new stubBaseResponse()); 
     35        $response = new stubXMLResponse($response); 
     36        parent::__construct($request, $session, $response, $pageFactory); 
    3637    } 
    3738 
  • trunk/src/test/php/net/stubbles/websites/memphis/stubMemphisProcessorTestCase.php

    r300 r315  
    4040    protected $mockSession; 
    4141    /** 
     42     * mocked response instance 
     43     * 
     44     * @var  SimpleMock 
     45     */ 
     46    protected $mockResponse; 
     47    /** 
    4248     * mocked page factory instance 
    4349     * 
     
    5965        $this->mockRequest      = new MockstubRequest(); 
    6066        $this->mockSession      = new MockstubSession(); 
     67        $this->mockResponse     = new MockstubResponse(); 
    6168        $this->mockPageFactory  = new MockstubPageFactory(); 
    62         $this->memphisProcessor = new stubMemphisProcessor($this->mockRequest, $this->mockSession, $this->mockPageFactory); 
     69        $this->memphisProcessor = new stubMemphisProcessor($this->mockRequest, $this->mockSession, $this->mockResponse, $this->mockPageFactory); 
    6370        $this->mockPage = new MockstubPage(); 
    6471        $this->mockPageFactory->setReturnValue('getPage', $this->mockPage); 
  • trunk/src/test/php/net/stubbles/websites/processors/stubDefaultProcessorResolverTestCase.php

    r284 r315  
    3838    protected $mockRequest; 
    3939    /** 
     40     * mocked response instance 
     41     * 
     42     * @var  SimpleMock 
     43     */ 
     44    protected $mockResponse; 
     45    /** 
    4046     * mocked session to use 
    4147     * 
     
    5460        $this->defaultProcessorResolver->setPageFactory($this->mockPageFactory); 
    5561         
    56         $this->mockRequest = new MockstubRequest(); 
    57         $this->mockSession = new MockstubSession(); 
     62        $this->mockRequest  = new MockstubRequest(); 
     63        $this->mockSession  = new MockstubSession(); 
     64        $this->mockResponse = new MockstubResponse(); 
    5865    } 
    5966     
     
    7683        $this->addProcessors(); 
    7784        $this->mockRequest->setReturnValue('hasValue', false); 
    78         $processor = $this->defaultProcessorResolver->resolve($this->mockRequest, $this->mockSession); 
     85        $processor = $this->defaultProcessorResolver->resolve($this->mockRequest, $this->mockSession, $this->mockResponse); 
    7986        $this->assertIsA($processor, 'FooProcessor'); 
    8087        $request = $processor->getRequest(); 
     
    94101        $this->mockRequest->setReturnValue('hasValue', true); 
    95102        $this->mockRequest->setReturnValue('getValidatedValue', 'bar'); 
    96         $processor = $this->defaultProcessorResolver->resolve($this->mockRequest, $this->mockSession); 
     103        $processor = $this->defaultProcessorResolver->resolve($this->mockRequest, $this->mockSession, $this->mockResponse); 
    97104        $this->assertIsA($processor, 'BarProcessor'); 
    98105        $request = $processor->getRequest(); 
     
    112119        $this->mockRequest->setReturnValue('hasValue', true); 
    113120        $this->mockRequest->setReturnValue('getValidatedValue', null); 
    114         $processor = $this->defaultProcessorResolver->resolve($this->mockRequest, $this->mockSession); 
     121        $processor = $this->defaultProcessorResolver->resolve($this->mockRequest, $this->mockSession, $this->mockResponse); 
    115122        $this->assertIsA($processor, 'FooProcessor'); 
    116123    } 
     
    125132        $this->mockRequest->setReturnValue('getValidatedValue', 'baz'); 
    126133        $this->expectException('stubProcessorException'); 
    127         $this->defaultProcessorResolver->resolve($this->mockRequest, $this->mockSession); 
     134        $this->defaultProcessorResolver->resolve($this->mockRequest, $this->mockSession, $this->mockResponse); 
    128135    } 
    129136     
     
    134141    { 
    135142        $this->expectException('stubProcessorException'); 
    136         $this->defaultProcessorResolver->resolve($this->mockRequest, $this->mockSession); 
     143        $this->defaultProcessorResolver->resolve($this->mockRequest, $this->mockSession, $this->mockResponse); 
    137144    } 
    138145     
     
    145152        $this->defaultProcessorResolver->setDefaultProcessor('bar'); 
    146153        $this->expectException('stubProcessorException'); 
    147         $this->defaultProcessorResolver->resolve($this->mockRequest, $this->mockSession); 
     154        $this->defaultProcessorResolver->resolve($this->mockRequest, $this->mockSession, $this->mockResponse); 
    148155    } 
    149156} 
  • trunk/src/test/php/net/stubbles/websites/processors/stubSimpleProcessorResolverTestCase.php

    r285 r315  
    4343     */ 
    4444    protected $mockSession; 
     45    /** 
     46     * mocked response instance 
     47     * 
     48     * @var  SimpleMock 
     49     */ 
     50    protected $mockResponse; 
    4551     
    4652    /** 
     
    5561        $this->simpleProcessorResolver->setPageFactory($this->mockPageFactory); 
    5662         
    57         $this->mockRequest = new MockstubRequest(); 
    58         $this->mockSession = new MockstubSession(); 
     63        $this->mockRequest  = new MockstubRequest(); 
     64        $this->mockSession  = new MockstubSession(); 
     65        $this->mockResponse = new MockstubResponse(); 
    5966    } 
    6067     
     
    6572    { 
    6673        $this->simpleProcessorResolver->setProcessor('_test.FooProcessor'); 
    67         $processor = $this->simpleProcessorResolver->resolve($this->mockRequest, $this->mockSession); 
     74        $processor = $this->simpleProcessorResolver->resolve($this->mockRequest, $this->mockSession, $this->mockResponse); 
    6875        $this->assertIsA($processor, 'FooProcessor'); 
    6976        $request = $processor->getRequest(); 
     
    8289        $this->simpleProcessorResolver->setProcessor('_test.BazProcessor'); 
    8390        $this->expectException('stubProcessorException'); 
    84         $this->simpleProcessorResolver->resolve($this->mockRequest, $this->mockSession); 
     91        $this->simpleProcessorResolver->resolve($this->mockRequest, $this->mockSession, $this->mockResponse); 
    8592    } 
    8693     
     
    9198    { 
    9299        $this->expectException('stubProcessorException'); 
    93         $this->simpleProcessorResolver->resolve($this->mockRequest, $this->mockSession); 
     100        $this->simpleProcessorResolver->resolve($this->mockRequest, $this->mockSession, $this->mockResponse); 
    94101    } 
    95102} 
  • trunk/src/test/php/net/stubbles/websites/xml/stubXMLProcessorTestCase.php

    r297 r315  
    6666    protected $mockSession; 
    6767    /** 
     68     * mocked response instance 
     69     * 
     70     * @var  SimpleMock 
     71     */ 
     72    protected $mockResponse; 
     73    /** 
    6874     * mocked page factory instance 
    6975     * 
     
    98104        $this->mockRequest->setReturnValue('getValueErrors', array()); 
    99105        $this->mockSession         = new MockstubSession(); 
     106        $this->mockResponse        = new MockstubResponse(); 
    100107        $this->mockPageFactory     = new MockstubPageFactory(); 
    101         $this->xmlProcessor        = new PartialMockstubXMLProcessor($this->mockRequest, $this->mockSession, $this->mockPageFactory); 
     108        $this->xmlProcessor        = new PartialMockstubXMLProcessor($this->mockRequest, $this->mockSession, $this->mockResponse, $this->mockPageFactory); 
    102109        $this->mockXMLStreamWriter = new MockstubXMLStreamWriter(); 
    103110        $this->mockXMLSerializer   = new MockstubXMLSerializer(); 
     
    117124        $this->mockXMLStreamWriter->expectCallcount('writeStartElement', 4); 
    118125        $this->mockXMLStreamWriter->expectCallcount('writeEndElement', 4); 
    119         $this->mockXMLStreamWriter->setReturnValue('asXML', '<document />'); 
    120126        $this->mockXMLSerializer->expectNever('serialize'); 
    121127        $return = $this->xmlProcessor->process(); 
     
    123129        $response = $this->xmlProcessor->getResponse(); 
    124130        $this->assertIsA($response, 'stubResponse'); 
    125         $this->assertEqual($response->getData(), '<document />'); 
    126131    } 
    127132     
     
    147152        $this->mockXMLStreamWriter->expectCallcount('writeStartElement', 4); 
    148153        $this->mockXMLStreamWriter->expectCallcount('writeEndElement', 4); 
    149         $this->mockXMLStreamWriter->setReturnValue('asXML', '<document><foo>foo</foo><bar>bar</bar></document>'); 
    150154        $this->mockXMLSerializer->expectAt(0, 'serialize', array('foo', $this->mockXMLStreamWriter, array(stubXMLSerializer::OPT_ROOT_TAG => 'foo'))); 
    151155        $this->mockXMLSerializer->expectAt(1, 'serialize', array('bar', $this->mockXMLStreamWriter, array(stubXMLSerializer::OPT_ROOT_TAG => 'bar'))); 
     
    154158        $response = $this->xmlProcessor->getResponse(); 
    155159        $this->assertIsA($response, 'stubResponse'); 
    156         $this->assertEqual($response->getData(), '<document><foo>foo</foo><bar>bar</bar></document>'); 
    157160    } 
    158161