Author: chabotc
Date: Tue May 12 12:51:39 2009
New Revision: 773874

URL: http://svn.apache.org/viewvc?rev=773874&view=rev
Log:
SHINDIG-1059 by lipeng : CacheMemcacheTest file depend on php have loaded 
memchache extension

Modified:
    incubator/shindig/trunk/php/test/common/CacheMemcacheTest.php

Modified: incubator/shindig/trunk/php/test/common/CacheMemcacheTest.php
URL: 
http://svn.apache.org/viewvc/incubator/shindig/trunk/php/test/common/CacheMemcacheTest.php?rev=773874&r1=773873&r2=773874&view=diff
==============================================================================
--- incubator/shindig/trunk/php/test/common/CacheMemcacheTest.php (original)
+++ incubator/shindig/trunk/php/test/common/CacheMemcacheTest.php Tue May 12 
12:51:39 2009
@@ -40,10 +40,17 @@
    * Prepares the environment before running a test.
    */
   protected function setUp() {
+    if (!extension_loaded('memcache')) {
+      $message = 'memcache requires the memcache extention';
+      throw new PHPUnit_Framework_SkippedTestSuiteError($message);
+    }
     parent::setUp();
     $this->time = new MockRequestTime();
-    $this->cache = Cache::createCache('CacheStorageMemcache', 'TestCache',
-                                      $this->time);
+    $this->cache = Cache::createCache('CacheStorageMemcache', 'TestCache', 
$this->time);
+    if (! is_resource($this->cache)) {
+      $message = 'memcache server can not connect';
+      throw new PHPUnit_Framework_SkippedTestSuiteError($message);
+    }
   }
 
   /**


Reply via email to