Pārlūkot izejas kodu

merge r25082 to release-1.12

git-svn-id: http://framework.zend.com/svn/framework/standard/branches/release-1.12@25083 44c647ce-9c0f-0410-b52a-842ac1e357ba
rob 13 gadi atpakaļ
vecāks
revīzija
6aa52acfa6

+ 1 - 1
library/Zend/Feed/Writer/Entry.php

@@ -114,7 +114,7 @@ class Zend_Feed_Writer_Entry
          * Array notation (above) is preferred and will be the sole supported input from ZF 2.0
          */
         } else {
-            if (empty($name['name']) || !is_string($name['name'])) {
+            if (empty($name) || !is_string($name)) {
                 require_once 'Zend/Feed/Exception.php';
                 throw new Zend_Feed_Exception('Invalid parameter: "name" must be a non-empty string value');
             }

+ 1 - 1
library/Zend/Feed/Writer/Feed/FeedAbstract.php

@@ -117,7 +117,7 @@ class Zend_Feed_Writer_Feed_FeedAbstract
                 $author['uri'] = $name['uri'];
             }
         } else {
-            if (empty($name['name']) || !is_string($name['name'])) {
+            if (empty($name) || !is_string($name)) {
                 require_once 'Zend/Feed/Exception.php';
                 throw new Zend_Feed_Exception('Invalid parameter: "name" must be a non-empty string value');
             }

+ 4 - 4
tests/Zend/Feed/Entry/RssTest.php

@@ -39,10 +39,10 @@ class Zend_Feed_Entry_RssTest extends PHPUnit_Framework_TestCase
     public function testContentEncodedSupport()
     {
         $feed = Zend_Feed::importFile(dirname(__FILE__) . '/../_files/TestFeedEntryRssContentEncoded.xml');
-        $this->assertType('Zend_Feed_Rss', $feed);
+        $this->assertTrue($feed instanceof Zend_Feed_Rss);
 
         $item = $feed->current();
-        $this->assertType('Zend_Feed_Entry_Rss', $item);
+        $this->assertTrue($item instanceof Zend_Feed_Entry_Rss);
 
         $this->assertTrue(isset($item->content));
         $this->assertContains(
@@ -60,11 +60,11 @@ class Zend_Feed_Entry_RssTest extends PHPUnit_Framework_TestCase
     public function testContentEncodedNullIfEmpty()
     {
         $feed = Zend_Feed::importFile(dirname(__FILE__) . '/../_files/TestFeedEntryRssContentEncoded.xml');
-        $this->assertType('Zend_Feed_Rss', $feed);
+        $this->assertTrue($feed instanceof Zend_Feed_Rss);
 
         $feed->next();
         $item =  $feed->current();
-        $this->assertType('Zend_Feed_Entry_Rss', $item);
+        $this->assertTrue($item instanceof Zend_Feed_Entry_Rss);
         $this->assertFalse(isset($item->content));
         $this->assertNull($item->content());
         // $this->assertNull($item->content); // always return DOMElement Object

+ 12 - 12
tests/Zend/Feed/ImportTest.php

@@ -212,7 +212,7 @@ class Zend_Feed_ImportTest extends PHPUnit_Framework_TestCase
     public function testRssImportFullArray()
     {
         $feed = Zend_Feed::importArray($this->_getFullArray(), 'rss');
-        $this->assertType('Zend_Feed_Rss', $feed);
+        $this->assertTrue($feed instanceof Zend_Feed_Rss);
     }
 
     /**
@@ -240,7 +240,7 @@ class Zend_Feed_ImportTest extends PHPUnit_Framework_TestCase
     public function testRssImportFullBuilder()
     {
         $feed = Zend_Feed::importBuilder(new Zend_Feed_Builder($this->_getFullArray()), 'rss');
-        $this->assertType('Zend_Feed_Rss', $feed);
+        $this->assertTrue($feed instanceof Zend_Feed_Rss);
     }
 
     /**
@@ -259,7 +259,7 @@ class Zend_Feed_ImportTest extends PHPUnit_Framework_TestCase
         $array['itunes']['block'] = 'no';
         $array['itunes']['new-feed-url'] = 'http://www.example/itunes.xml';
         $feed = Zend_Feed::importBuilder(new Zend_Feed_Builder($array), 'rss');
-        $this->assertType('Zend_Feed_Rss', $feed);
+        $this->assertTrue($feed instanceof Zend_Feed_Rss);
     }
 
     /**
@@ -279,7 +279,7 @@ class Zend_Feed_ImportTest extends PHPUnit_Framework_TestCase
         $feed = Zend_Feed::importBuilder(new Zend_Feed_Builder($this->_getFullArray()), 'atom');
 
         $feed = Zend_Feed::importString($feed->saveXml());
-        $this->assertType('Zend_Feed_Atom', $feed);
+        $this->assertTrue($feed instanceof Zend_Feed_Atom);
     }
 
     /**
@@ -288,9 +288,9 @@ class Zend_Feed_ImportTest extends PHPUnit_Framework_TestCase
     public function testRssImportFullBuilderValid()
     {
         $feed = Zend_Feed::importBuilder(new Zend_Feed_Builder($this->_getFullArray()), 'rss');
-        $this->assertType('Zend_Feed_Rss', $feed);
+        $this->assertTrue($feed instanceof Zend_Feed_Rss);
         $feed = Zend_Feed::importString($feed->saveXml());
-        $this->assertType('Zend_Feed_Rss', $feed);
+        $this->assertTrue($feed instanceof Zend_Feed_Rss);
     }
 
     /**
@@ -299,9 +299,9 @@ class Zend_Feed_ImportTest extends PHPUnit_Framework_TestCase
     public function testAtomGetLink()
     {
         $feed = Zend_Feed::importBuilder(new Zend_Feed_Builder($this->_getFullArray()), 'atom');
-        $this->assertType('Zend_Feed_Atom', $feed);
+        $this->assertTrue($feed instanceof Zend_Feed_Atom);
         $feed = Zend_Feed::importString($feed->saveXml());
-        $this->assertType('Zend_Feed_Atom', $feed);
+        $this->assertTrue($feed instanceof Zend_Feed_Atom);
         $href = $feed->link('self');
         $this->assertEquals('http://www.example.com', $href);
     }
@@ -323,7 +323,7 @@ class Zend_Feed_ImportTest extends PHPUnit_Framework_TestCase
             $feed = Zend_Feed::import('http://localhost');
             $this->fail('Expected Zend_Feed_Exception not thrown');
         } catch (Zend_Feed_Exception $e) {
-            $this->assertType('Zend_Feed_Exception', $e);
+            $this->assertTrue($e instanceof Zend_Feed_Exception);
             $this->assertRegExp('/(XDebug is running|Empty string)/', $e->getMessage());
         }
     }
@@ -416,7 +416,7 @@ class Zend_Feed_ImportTest extends PHPUnit_Framework_TestCase
         $this->_adapter->setResponse($response);
 
         $feed = Zend_Feed::import('http://localhost');
-        $this->assertType('Zend_Feed_Atom', $feed);
+        $this->assertTrue($feed instanceof Zend_Feed_Atom);
     }
 
     /**
@@ -428,7 +428,7 @@ class Zend_Feed_ImportTest extends PHPUnit_Framework_TestCase
         $this->_adapter->setResponse($response);
 
         $feed = Zend_Feed::import('http://localhost');
-        $this->assertType('Zend_Feed_Rss', $feed);
+        $this->assertTrue($feed instanceof Zend_Feed_Rss);
         return $feed;
     }
 
@@ -444,7 +444,7 @@ class Zend_Feed_ImportTest extends PHPUnit_Framework_TestCase
             $feed = Zend_Feed::import('http://localhost');
             $this->fail('Expected Zend_Feed_Exception not thrown');
         } catch (Zend_Feed_Exception $e) {
-            $this->assertType('Zend_Feed_Exception', $e);
+            $this->assertTrue($e instanceof Zend_Feed_Exception);
         }
     }
 

+ 8 - 2
tests/Zend/Feed/IteratorTest.php

@@ -74,12 +74,18 @@ class Zend_Feed_IteratorTest extends PHPUnit_Framework_TestCase
     public function testCurrent()
     {
         foreach ($this->_feed as $f) {
-            $this->assertType('Zend_Feed_Entry_Atom', $f, 'Each feed entry should be an instance of Zend_Feed_Entry_Atom');
+            $this->assertTrue(
+                $f instanceof Zend_Feed_Entry_Atom,
+                'Each feed entry should be an instance of Zend_Feed_Entry_Atom'
+            );
             break;
         }
 
         foreach ($this->_nsfeed as $f) {
-            $this->assertType('Zend_Feed_Entry_Atom', $f, 'Each feed entry should be an instance of Zend_Feed_Entry_Atom');
+            $this->assertTrue(
+                $f instanceof Zend_Feed_Entry_Atom,
+                'Each feed entry should be an instance of Zend_Feed_Entry_Atom'
+            );
             break;
         }
     }

+ 3 - 1
tests/Zend/Feed/Pubsubhubbub/PubsubhubbubTest.php

@@ -41,7 +41,9 @@ class Zend_Feed_Pubsubhubbub_PubsubhubbubTest extends PHPUnit_Framework_TestCase
     public function testCanSetCustomHttpClient()
     {
         Zend_Feed_Pubsubhubbub::setHttpClient(new Test_Http_Client_Pubsub());
-        $this->assertType('Test_Http_Client_Pubsub', Zend_Feed_Pubsubhubbub::getHttpClient());
+        $this->assertTrue(
+            Zend_Feed_Pubsubhubbub::getHttpClient() instanceof Test_Http_Client_Pubsub
+        );
     }
 
     public function testCanDetectHubs()