Author: ts
Date: Thu Oct 11 16:26:25 2007
New Revision: 6431

Log:
- Adjusted client test case to new output struct.

Modified:
    trunk/Webdav/src/transport.php
    trunk/Webdav/tests/classes/transport_test_mock.php
    trunk/Webdav/tests/client_test.php

Modified: trunk/Webdav/src/transport.php
==============================================================================
--- trunk/Webdav/src/transport.php [iso-8859-1] (original)
+++ trunk/Webdav/src/transport.php [iso-8859-1] Thu Oct 11 16:26:25 2007
@@ -365,39 +365,34 @@
      */
     protected function flattenResponse( ezcWebdavDisplayInformation $info )
     {
-        $headers     = array_merge( $info->response->getHeaders() );
-        $body        = '';
-
-        $output = new ezcWebdavOutputResult();
-        $output->status = (string) $info->response;
+        $output          = new ezcWebdavOutputResult();
+        $output->status  = (string) $info->response;
+        $output->headers = $info->response->getHeaders();
+        $output->body    = '';
 
         switch ( true )
         {
             case ( $info instanceof ezcWebdavXmlDisplayInformation ):
-                $headers['Content-Type']  = ( isset( $headers['Content-Type'] 
) ? $headers['Content-Type'] : 'text/xml; charset="utf-8"' );
+                $output->headers['Content-Type']  = ( isset( 
$output->headers['Content-Type'] ) ? $output->headers['Content-Type'] : 
'text/xml; charset="utf-8"' );
                 $info->body->formatOutput = true;
-                $body                     = $info->body->saveXML( $info->body 
);
+                $output->body                     = $info->body->saveXML( 
$info->body );
                 break;
             case ( $info instanceof ezcWebdavStringDisplayInformation ):
                 if ( $info->response->getHeader( 'Content-Type' ) === null )
                 {
                     throw new ezcWebdavMissingHeaderException( 'ContentType' );
                 }
-                $body = $info->body;
+                $output->body = $info->body;
                 break;
-
             case ( $info instanceof ezcWebdavEmptyDisplayInformation ):
             default:
                 if ( ( $contenTypeHeader = $info->response->getHeader( 
'Content-Type' ) ) !== null  )
                 {
                     throw new ezcWebdavInvalidHeaderException( 'Content-Type', 
$contenTypeHeader, 'null' );
                 }
-                $body = '';
+                $output->body = '';
                 break;
         }
-
-        $output->headers = $headers;
-        $output->body    = $body;
         
         return $output;
     }

Modified: trunk/Webdav/tests/classes/transport_test_mock.php
==============================================================================
--- trunk/Webdav/tests/classes/transport_test_mock.php [iso-8859-1] (original)
+++ trunk/Webdav/tests/classes/transport_test_mock.php [iso-8859-1] Thu Oct 11 
16:26:25 2007
@@ -9,6 +9,7 @@
 
     protected function sendResponse( ezcWebdavOutputResult $output )
     {
+        $GLOBALS['EZC_WEBDAV_TRANSPORT_TEST_RESPONSE_STATUS']  = 
$output->status;
         $GLOBALS['EZC_WEBDAV_TRANSPORT_TEST_RESPONSE_HEADERS'] = 
$output->headers;
         $GLOBALS['EZC_WEBDAV_TRANSPORT_TEST_RESPONSE_BODY']    = $output->body;
     }

Modified: trunk/Webdav/tests/client_test.php
==============================================================================
--- trunk/Webdav/tests/client_test.php [iso-8859-1] (original)
+++ trunk/Webdav/tests/client_test.php [iso-8859-1] Thu Oct 11 16:26:25 2007
@@ -182,6 +182,7 @@
         
         $responseBody    = $GLOBALS['EZC_WEBDAV_TRANSPORT_TEST_RESPONSE_BODY'];
         $responseHeaders = 
$GLOBALS['EZC_WEBDAV_TRANSPORT_TEST_RESPONSE_HEADERS'];
+        $responseStatus  = 
$GLOBALS['EZC_WEBDAV_TRANSPORT_TEST_RESPONSE_STATUS'];
 
         if ( $response['result'] === false )
         {
@@ -221,8 +222,7 @@
         else
         {
             // FIXME
-            $response['result']['headers'][''] = 
$response['result']['headers'][0];
-            unset( $response['result']['headers'][0] );
+            $responseHeaders[0] = $responseStatus;
             if ( !empty( $responseBody ) && !isset( 
$response['result']['headers']['Content-Type'] ) )
             {
                 $response['result']['headers']['Content-Type'] = 'text/xml; 
charset="utf-8"';


-- 
svn-components mailing list
[email protected]
http://lists.ez.no/mailman/listinfo/svn-components

Reply via email to