소스 검색

Include in tests a reset of Zend_Date options to ensure ISO formatting is used. The original options are re-entered during teardown to prevent any option leaks into other test suites. Fixes the symptoms (of an unidentified settings leak outside of Zend_Feed_Reader) in ZF-8322.

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@19017 44c647ce-9c0f-0410-b52a-842ac1e357ba
padraic 16 년 전
부모
커밋
16f8b5d300

+ 12 - 0
tests/Zend/Feed/Reader/Entry/AtomTest.php

@@ -44,6 +44,18 @@ class Zend_Feed_Reader_Entry_AtomTest extends PHPUnit_Framework_TestCase
             unset($registry['Zend_Locale']);
         }
         $this->_feedSamplePath = dirname(__FILE__) . '/_files/Atom';
+        $this->_options = Zend_Date::setOptions();
+        foreach($this->_options as $k=>$v) {
+            if (is_null($v)) {
+                unset($this->_options[$k]);
+            }
+        }
+        Zend_Date::setOptions(array('format_type'=>'iso'));
+    }
+    
+    public function teardown()
+    {
+        Zend_Date::setOptions($this->_options);
     }
 
     /**

+ 12 - 0
tests/Zend/Feed/Reader/Entry/RssTest.php

@@ -44,6 +44,18 @@ class Zend_Feed_Reader_Entry_RssTest extends PHPUnit_Framework_TestCase
             unset($registry['Zend_Locale']);
         }
         $this->_feedSamplePath = dirname(__FILE__) . '/_files/Rss';
+        $this->_options = Zend_Date::setOptions();
+        foreach($this->_options as $k=>$v) {
+            if (is_null($v)) {
+                unset($this->_options[$k]);
+            }
+        }
+        Zend_Date::setOptions(array('format_type'=>'iso'));
+    }
+    
+    public function teardown()
+    {
+        Zend_Date::setOptions($this->_options);
     }
 
     /**

+ 14 - 0
tests/Zend/Feed/Reader/Feed/AtomTest.php

@@ -36,6 +36,8 @@ class Zend_Feed_Reader_Feed_AtomTest extends PHPUnit_Framework_TestCase
 {
 
     protected $_feedSamplePath = null;
+    
+    protected $_options = array();
 
     public function setup()
     {
@@ -44,6 +46,18 @@ class Zend_Feed_Reader_Feed_AtomTest extends PHPUnit_Framework_TestCase
             unset($registry['Zend_Locale']);
         }
         $this->_feedSamplePath = dirname(__FILE__) . '/_files/Atom';
+        $this->_options = Zend_Date::setOptions();
+        foreach($this->_options as $k=>$v) {
+            if (is_null($v)) {
+                unset($this->_options[$k]);
+            }
+        }
+        Zend_Date::setOptions(array('format_type'=>'iso'));
+    }
+    
+    public function teardown()
+    {
+        Zend_Date::setOptions($this->_options);
     }
 
     /**

+ 12 - 0
tests/Zend/Feed/Reader/Feed/RssTest.php

@@ -44,6 +44,18 @@ class Zend_Feed_Reader_Feed_RssTest extends PHPUnit_Framework_TestCase
             unset($registry['Zend_Locale']);
         }
         $this->_feedSamplePath = dirname(__FILE__) . '/_files/Rss';
+        $this->_options = Zend_Date::setOptions();
+        foreach($this->_options as $k=>$v) {
+            if (is_null($v)) {
+                unset($this->_options[$k]);
+            }
+        }
+        Zend_Date::setOptions(array('format_type'=>'iso'));
+    }
+    
+    public function teardown()
+    {
+        Zend_Date::setOptions($this->_options);
     }
 
     /**

+ 12 - 0
tests/Zend/Feed/Reader/Integration/H-OnlineComAtom10Test.php

@@ -40,6 +40,18 @@ class Zend_Feed_Reader_Integration_HOnlineComAtom10Test extends PHPUnit_Framewor
     public function setup()
     {
         $this->_feedSamplePath = dirname(__FILE__) . '/_files/h-online.com-atom10.xml';
+        $this->_options = Zend_Date::setOptions();
+        foreach($this->_options as $k=>$v) {
+            if (is_null($v)) {
+                unset($this->_options[$k]);
+            }
+        }
+        Zend_Date::setOptions(array('format_type'=>'iso'));
+    }
+    
+    public function teardown()
+    {
+        Zend_Date::setOptions($this->_options);
     }
 
     public function testGetsTitle()

+ 12 - 0
tests/Zend/Feed/Reader/Integration/LautDeRdfTest.php

@@ -40,6 +40,18 @@ class Zend_Feed_Reader_Integration_LautDeRdfTest extends PHPUnit_Framework_TestC
     public function setup()
     {
         $this->_feedSamplePath = dirname(__FILE__) . '/_files/laut.de-rdf.xml';
+        $this->_options = Zend_Date::setOptions();
+        foreach($this->_options as $k=>$v) {
+            if (is_null($v)) {
+                unset($this->_options[$k]);
+            }
+        }
+        Zend_Date::setOptions(array('format_type'=>'iso'));
+    }
+    
+    public function teardown()
+    {
+        Zend_Date::setOptions($this->_options);
     }
 
     /**

+ 12 - 0
tests/Zend/Feed/Reader/Integration/PodcastRss2Test.php

@@ -41,6 +41,18 @@ class Zend_Feed_Reader_Integration_PodcastRss2Test extends PHPUnit_Framework_Tes
     public function setup()
     {
         $this->_feedSamplePath = dirname(__FILE__) . '/_files/podcast.xml';
+        $this->_options = Zend_Date::setOptions();
+        foreach($this->_options as $k=>$v) {
+            if (is_null($v)) {
+                unset($this->_options[$k]);
+            }
+        }
+        Zend_Date::setOptions(array('format_type'=>'iso'));
+    }
+    
+    public function teardown()
+    {
+        Zend_Date::setOptions($this->_options);
     }
 
     /**

+ 12 - 0
tests/Zend/Feed/Reader/Integration/WordpressAtom10Test.php

@@ -40,6 +40,18 @@ class Zend_Feed_Reader_Integration_WordpressAtom10Test extends PHPUnit_Framework
     public function setup()
     {
         $this->_feedSamplePath = dirname(__FILE__) . '/_files/wordpress-atom10.xml';
+        $this->_options = Zend_Date::setOptions();
+        foreach($this->_options as $k=>$v) {
+            if (is_null($v)) {
+                unset($this->_options[$k]);
+            }
+        }
+        Zend_Date::setOptions(array('format_type'=>'iso'));
+    }
+    
+    public function teardown()
+    {
+        Zend_Date::setOptions($this->_options);
     }
 
     public function testGetsTitle()