You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@shindig.apache.org by li...@apache.org on 2010/08/20 01:53:22 UTC

svn commit: r987355 - in /shindig/trunk/php: src/common/HttpServlet.php src/common/sample/BasicRemoteContent.php test/common/HttpServletTest.php test/gadgets/GadgetHtmlRendererTest.php test/gadgets/MakeRequestTest.php test/social/RestBase.php

Author: lindner
Date: Thu Aug 19 23:53:22 2010
New Revision: 987355

URL: http://svn.apache.org/viewvc?rev=987355&view=rev
Log:
Patch from Lee Thompson | Fixes that get PHPUnit tests to run with PHP 5.3.3 on Mac using MacPorts

Modified:
    shindig/trunk/php/src/common/HttpServlet.php
    shindig/trunk/php/src/common/sample/BasicRemoteContent.php
    shindig/trunk/php/test/common/HttpServletTest.php
    shindig/trunk/php/test/gadgets/GadgetHtmlRendererTest.php
    shindig/trunk/php/test/gadgets/MakeRequestTest.php
    shindig/trunk/php/test/social/RestBase.php

Modified: shindig/trunk/php/src/common/HttpServlet.php
URL: http://svn.apache.org/viewvc/shindig/trunk/php/src/common/HttpServlet.php?rev=987355&r1=987354&r2=987355&view=diff
==============================================================================
--- shindig/trunk/php/src/common/HttpServlet.php (original)
+++ shindig/trunk/php/src/common/HttpServlet.php Thu Aug 19 23:53:22 2010
@@ -77,6 +77,9 @@ class HttpServlet {
         }
       }
     }
+    else {
+      ob_end_flush();
+    }
   }
 
   public function getCharset() {

Modified: shindig/trunk/php/src/common/sample/BasicRemoteContent.php
URL: http://svn.apache.org/viewvc/shindig/trunk/php/src/common/sample/BasicRemoteContent.php?rev=987355&r1=987354&r2=987355&view=diff
==============================================================================
--- shindig/trunk/php/src/common/sample/BasicRemoteContent.php (original)
+++ shindig/trunk/php/src/common/sample/BasicRemoteContent.php Thu Aug 19 23:53:22 2010
@@ -157,6 +157,7 @@ class BasicRemoteContent extends RemoteC
           // prefer to use the servers notion of the time since there could be a clock-skew, but otherwise use our own
           $date = $request->getResponseHeader('Date') != null ? $request->getResponseHeader('Date') : gmdate('D, d M Y H:i:s', $_SERVER['REQUEST_TIME']) . ' GMT';
           // convert both dates to unix epoch seconds, and calculate the TTL
+          date_default_timezone_set('GMT');
           $date = strtotime($date);
           $expires = strtotime($expires);
           $ttl = $expires - $date;

Modified: shindig/trunk/php/test/common/HttpServletTest.php
URL: http://svn.apache.org/viewvc/shindig/trunk/php/test/common/HttpServletTest.php?rev=987355&r1=987354&r2=987355&view=diff
==============================================================================
--- shindig/trunk/php/test/common/HttpServletTest.php (original)
+++ shindig/trunk/php/test/common/HttpServletTest.php Thu Aug 19 23:53:22 2010
@@ -46,6 +46,7 @@ class HttpServletTest extends PHPUnit_Fr
     $this->HttpServlet->setNoCache($this->noCache);
     $this->HttpServlet->setContentType($this->contentType);
     $this->HttpServlet->setCacheTime($this->cacheTime);
+    $this->HttpServlet->noHeaders = true;
   }
 
   /**
@@ -54,7 +55,6 @@ class HttpServletTest extends PHPUnit_Fr
   
   protected function tearDown() {
     $this->HttpServlet = null;
-    ob_end_clean();
     parent::tearDown();
   }
 
@@ -118,4 +118,4 @@ class HttpServletTest extends PHPUnit_Fr
     $this->assertNotEquals($this->noCache, $this->HttpServlet->getNoCache());
   }
 
-}
\ No newline at end of file
+}

Modified: shindig/trunk/php/test/gadgets/GadgetHtmlRendererTest.php
URL: http://svn.apache.org/viewvc/shindig/trunk/php/test/gadgets/GadgetHtmlRendererTest.php?rev=987355&r1=987354&r2=987355&view=diff
==============================================================================
--- shindig/trunk/php/test/gadgets/GadgetHtmlRendererTest.php (original)
+++ shindig/trunk/php/test/gadgets/GadgetHtmlRendererTest.php Thu Aug 19 23:53:22 2010
@@ -117,6 +117,7 @@ class GadgetHtmlRendererTest extends PHP
    * Tests GadgetHtmlRenderer->renderGadget()
    */
   public function testRenderGadget() {
+    Config::set('P3P', ''); // prevents "modify header information" errors
     ob_start();
     $this->gadgetHtmlRenderer->renderGadget($this->gadget, $this->view);
     ob_end_clean();
@@ -159,4 +160,4 @@ class GadgetHtmlRendererTest extends PHP
   }
 
 }
-?>
\ No newline at end of file
+?>

Modified: shindig/trunk/php/test/gadgets/MakeRequestTest.php
URL: http://svn.apache.org/viewvc/shindig/trunk/php/test/gadgets/MakeRequestTest.php?rev=987355&r1=987354&r2=987355&view=diff
==============================================================================
--- shindig/trunk/php/test/gadgets/MakeRequestTest.php (original)
+++ shindig/trunk/php/test/gadgets/MakeRequestTest.php Thu Aug 19 23:53:22 2010
@@ -36,6 +36,7 @@ class MockMakeRequestFetcher extends Rem
    */
   public function __construct() {
     $_SERVER["HTTP_HOST"] = 'localhost';
+    date_default_timezone_set('GMT');
     $this->responses = array();
     $this->requests = array();
   }

Modified: shindig/trunk/php/test/social/RestBase.php
URL: http://svn.apache.org/viewvc/shindig/trunk/php/test/social/RestBase.php?rev=987355&r1=987354&r2=987355&view=diff
==============================================================================
--- shindig/trunk/php/test/social/RestBase.php (original)
+++ shindig/trunk/php/test/social/RestBase.php Thu Aug 19 23:53:22 2010
@@ -48,6 +48,7 @@ class RestBase extends PHPUnit_Framework
     $_GET = array('st' => $this->securityToken);
     $servlet = new DataServiceServlet();
     $servletMethod = 'do' . ucfirst(strtolower($method));
+    $servlet->noHeaders = true; // prevents "modify header information" errors
     ob_start();
     $servlet->$servletMethod();
     $ret = ob_get_clean();