Browse Source

skip Zend_VersionTest::testFetchLatestVersion() if TESTS_ZEND_VERSION_ONLINE_ENABLED isn't defined.

Rob Allen 12 năm trước cách đây
mục cha
commit
577a1a733a
2 tập tin đã thay đổi với 16 bổ sung0 xóa
  1. 9 0
      tests/TestConfiguration.php.dist
  2. 7 0
      tests/Zend/VersionTest.php

+ 9 - 0
tests/TestConfiguration.php.dist

@@ -837,6 +837,15 @@ defined('TESTS_ZEND_SOAP_AUTODISCOVER_ONLINE_SERVER_BASEURI') || define('TESTS_Z
 defined('TESTS_ZEND_URI_CRASH_TEST_ENABLED') || define('TESTS_ZEND_URI_CRASH_TEST_ENABLED', false);
 
 /**
+ * Zend_Version tests
+ *
+ * Set ONLINE_ENABLED if you wish to run validators that require network
+ * connectivity.
+ */
+defined('TESTS_ZEND_VERSION_ONLINE_ENABLED') || define('TESTS_ZEND_VERSION_ONLINE_ENABLED', false);
+
+
+/**
  * Zend_Validate tests
  *
  * Set ONLINE_ENABLED if you wish to run validators that require network

+ 7 - 0
tests/Zend/VersionTest.php

@@ -89,6 +89,13 @@ class Zend_VersionTest extends PHPUnit_Framework_TestCase
      */
     public function testFetchLatestVersion()
     {
+        if (!defined('TESTS_ZEND_VERSION_ONLINE_ENABLED')
+            || !constant('TESTS_ZEND_VERSION_ONLINE_ENABLED')
+        ) {
+            $this->markTestSkipped('Testing fetchLatersVersion only works when TESTS_ZEND_VERSION_ONLINE_ENABLED is set.');
+            return;
+        }
+
         $actual = Zend_Version::getLatest();
         if ('not available' === $actual) {
             $this->markTestIncomplete('http://framework.zend.com/ may be down');