Преглед изворни кода

TESTS_ZEND_REST_ONLINE_ENABLED to control online tests within Zend_Rest_ClientTest.

Rob Allen пре 12 година
родитељ
комит
c1e89de6b3
2 измењених фајлова са 18 додато и 0 уклоњено
  1. 6 0
      tests/TestConfiguration.php.dist
  2. 12 0
      tests/Zend/Rest/ClientTest.php

+ 6 - 0
tests/TestConfiguration.php.dist

@@ -582,6 +582,12 @@ defined('TESTS_ZEND_QUEUE_PLATFORMJQ_HOST') || define('TESTS_ZEND_QUEUE_PLATFORM
 defined('TESTS_ZEND_QUEUE_PLATFORMJQ_PASS') || define('TESTS_ZEND_QUEUE_PLATFORMJQ_PASS', false);
 
 /**
+ * Zend_Rest tests
+ */
+defined('TESTS_ZEND_REST_ONLINE_ENABLED') || define('TESTS_ZEND_REST_ONLINE_ENABLED', false);
+
+
+/**
  * Zend_Serializer adapter tests
  *
  * TESTS_ZEND_SERIALIZER_ADAPTER_WDDX_ENABLED:

+ 12 - 0
tests/Zend/Rest/ClientTest.php

@@ -62,6 +62,12 @@ class Zend_Rest_ClientTest extends PHPUnit_Framework_TestCase
      */
     public function testCanPostFileInPresetHttpClient()
     {
+        if (!defined('TESTS_ZEND_REST_ONLINE_ENABLED')
+            || !constant('TESTS_ZEND_REST_ONLINE_ENABLED')
+        ) {
+            $this->markTestSkipped('Define TESTS_ZEND_REST_ONLINE_ENABLED to test Zend_Rest_ClientTest online.');
+        }
+
         $client = new Zend_Rest_Client('http://framework.zend.com');
         $httpClient = new Zend_Http_Client();
         $text = 'this is some plain text';
@@ -75,6 +81,12 @@ class Zend_Rest_ClientTest extends PHPUnit_Framework_TestCase
 
     public function testUri()
     {
+        if (!defined('TESTS_ZEND_REST_ONLINE_ENABLED')
+            || !constant('TESTS_ZEND_REST_ONLINE_ENABLED')
+        ) {
+            $this->markTestSkipped('Define TESTS_ZEND_REST_ONLINE_ENABLED to test Zend_Rest_ClientTest online.');
+        }
+
         $client = new Zend_Rest_Client('http://framework.zend.com/rest/');
         $uri = $client->getUri();
         $this->assertTrue($uri instanceof Zend_Uri_Http);