Jelajahi Sumber

ZF-8809
- Fixed issue with HttpTest not resetting Zend_Uri's static state
- Fixed BarcodeTest to use safer values and fixed the expected failure message

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@20382 44c647ce-9c0f-0410-b52a-842ac1e357ba

ralph 16 tahun lalu
induk
melakukan
7cd2a5d8a4
2 mengubah file dengan 10 tambahan dan 4 penghapusan
  1. 7 1
      tests/Zend/Uri/HttpTest.php
  2. 3 3
      tests/Zend/Validate/BarcodeTest.php

+ 7 - 1
tests/Zend/Uri/HttpTest.php

@@ -51,6 +51,12 @@ require_once 'PHPUnit/Framework/TestCase.php';
  */
 class Zend_Uri_HttpTest extends PHPUnit_Framework_TestCase
 {
+    
+    public function setup()
+    {
+        Zend_Uri::setConfig(array('allow_unwise' => false));
+    }
+    
     /**
      * Tests for proper URI decomposition
      */
@@ -236,7 +242,7 @@ class Zend_Uri_HttpTest extends PHPUnit_Framework_TestCase
             'http://example.com/?q=^',
             'http://example.com/?q=`',
         );
-
+        
         foreach ($unwise as $uri) {
             $this->assertFalse(Zend_Uri::check($uri), "failed for URI $uri");
         }

+ 3 - 3
tests/Zend/Validate/BarcodeTest.php

@@ -55,10 +55,10 @@ class Zend_Validate_BarcodeTest extends PHPUnit_Framework_TestCase
     public function testNoneExisting()
     {
         try {
-            $barcode = new Zend_Validate_Barcode('Zend');
-            $this->fail("'Zend' is not a valid barcode type'");
+            $barcode = new Zend_Validate_Barcode('Zend_Validate_BarcodeTest_NonExistentClassName');
+            $this->fail("'Zend_Validate_BarcodeTest_NonExistentClassName' is not a valid barcode type'");
         } catch (Exception $e) {
-            $this->assertContains("No such file", $e->getMessage());
+            $this->assertContains('not found', $e->getMessage());
         }
     }