diff --git a/src/Exception.php b/src/Exception.php index 941f155d..f8c0275e 100644 --- a/src/Exception.php +++ b/src/Exception.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Feed - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -31,7 +31,7 @@ * @uses \Exception * @category Zend * @package Zend_Feed - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Exception extends \Exception diff --git a/src/PubSubHubbub/AbstractCallback.php b/src/PubSubHubbub/AbstractCallback.php index 6a8c69bf..30064f67 100644 --- a/src/PubSubHubbub/AbstractCallback.php +++ b/src/PubSubHubbub/AbstractCallback.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Feed_Pubsubhubbub * @subpackage Callback - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -31,7 +31,7 @@ * @category Zend * @package Zend_Feed_Pubsubhubbub * @subpackage Callback - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class AbstractCallback implements Callback diff --git a/src/PubSubHubbub/Callback.php b/src/PubSubHubbub/Callback.php index bc9114fe..8f09bd6e 100644 --- a/src/PubSubHubbub/Callback.php +++ b/src/PubSubHubbub/Callback.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Feed_Pubsubhubbub * @subpackage Callback - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -28,7 +28,7 @@ * @category Zend * @package Zend_Feed_Pubsubhubbub * @subpackage Callback - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Callback diff --git a/src/PubSubHubbub/Exception.php b/src/PubSubHubbub/Exception.php index 95baf7c9..6fae2de6 100644 --- a/src/PubSubHubbub/Exception.php +++ b/src/PubSubHubbub/Exception.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Feed_Pubsubhubbub - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -27,7 +27,7 @@ * @uses \Exception * @category Zend * @package Zend_Feed_Pubsubhubbub - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Exception extends \Exception diff --git a/src/PubSubHubbub/HttpResponse.php b/src/PubSubHubbub/HttpResponse.php index 2140697b..ee93de65 100644 --- a/src/PubSubHubbub/HttpResponse.php +++ b/src/PubSubHubbub/HttpResponse.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Feed_Pubsubhubbub - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -28,7 +28,7 @@ * @uses \Zend\Feed\PubSubHubbub\Exception * @category Zend * @package Zend_Feed_Pubsubhubbub - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class HttpResponse diff --git a/src/PubSubHubbub/Model/AbstractModel.php b/src/PubSubHubbub/Model/AbstractModel.php index a2a8bece..add51525 100644 --- a/src/PubSubHubbub/Model/AbstractModel.php +++ b/src/PubSubHubbub/Model/AbstractModel.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Feed_Pubsubhubbub - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -23,12 +23,14 @@ */ namespace Zend\Feed\PubSubHubbub\Model; +use \Zend\Db\TableGateway; + /** * @uses \Zend\Db\Table\Table * @uses \Zend\Registry * @category Zend * @package Zend_Feed_Pubsubhubbub - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class AbstractModel @@ -47,12 +49,12 @@ class AbstractModel * @param \Zend\Db\Table\AbstractTable $tableGateway * @return void */ - public function __construct(\Zend\Db\Table\AbstractTable $tableGateway = null) + public function __construct(TableGateway\TableGatewayInterface $tableGateway = null) { if ($tableGateway === null) { $parts = explode('\\', get_class($this)); $table = strtolower(array_pop($parts)); - $this->_db = new \Zend\Db\Table\Table($table); + $this->_db = new TableGateway\TableGateway($table); } else { $this->_db = $tableGateway; } diff --git a/src/PubSubHubbub/Model/Subscription.php b/src/PubSubHubbub/Model/Subscription.php index 578674f0..d0aa6a3d 100644 --- a/src/PubSubHubbub/Model/Subscription.php +++ b/src/PubSubHubbub/Model/Subscription.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Feed_Pubsubhubbub * @subpackage Entity - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -34,7 +34,7 @@ * @category Zend * @package Zend_Feed_Pubsubhubbub * @subpackage Entity - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Subscription extends AbstractModel implements SubscriptionPersistence @@ -53,7 +53,7 @@ public function setSubscription(array $data) 'ID must be set before attempting a save' ); } - $result = $this->_db->find($data['id']); + $result = $this->_db->select(array('id' => $data['id'])); if ($result && (0 < count($result))) { $data['created_time'] = $result->current()->created_time; $now = new Date\Date; @@ -65,7 +65,7 @@ public function setSubscription(array $data) } $this->_db->update( $data, - $this->_db->getAdapter()->quoteInto('id = ?', $data['id']) + array('id' => $data['id']) ); return false; } @@ -86,9 +86,9 @@ public function getSubscription($key) throw new PubSubHubbub\Exception('Invalid parameter "key"' .' of "' . $key . '" must be a non-empty string'); } - $result = $this->_db->find($key); + $result = $this->_db->select(array('id' => $key)); if (count($result)) { - return $result->current()->toArray(); + return $result->current()->getArrayCopy(); } return false; } @@ -105,7 +105,7 @@ public function hasSubscription($key) throw new PubSubHubbub\Exception('Invalid parameter "key"' .' of "' . $key . '" must be a non-empty string'); } - $result = $this->_db->find($key); + $result = $this->_db->select(array('id' => $key)); if (count($result)) { return true; } @@ -120,10 +120,10 @@ public function hasSubscription($key) */ public function deleteSubscription($key) { - $result = $this->_db->find($key); + $result = $this->_db->select(array('id' => $key)); if (count($result)) { $this->_db->delete( - $this->_db->getAdapter()->quoteInto('id = ?', $key) + array('id' => $key) ); return true; } diff --git a/src/PubSubHubbub/Model/SubscriptionPersistence.php b/src/PubSubHubbub/Model/SubscriptionPersistence.php index edc77f84..1f46a5cf 100644 --- a/src/PubSubHubbub/Model/SubscriptionPersistence.php +++ b/src/PubSubHubbub/Model/SubscriptionPersistence.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Feed_Pubsubhubbub * @subpackage Entity - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -28,7 +28,7 @@ * @category Zend * @package Zend_Feed_Pubsubhubbub * @subpackage Entity - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface SubscriptionPersistence diff --git a/src/PubSubHubbub/PubSubHubbub.php b/src/PubSubHubbub/PubSubHubbub.php index 0a7608db..6348ccf8 100644 --- a/src/PubSubHubbub/PubSubHubbub.php +++ b/src/PubSubHubbub/PubSubHubbub.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Feed_Pubsubhubbub - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -29,7 +29,7 @@ /** * @category Zend * @package Zend_Feed_Pubsubhubbub - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class PubSubHubbub diff --git a/src/PubSubHubbub/Publisher.php b/src/PubSubHubbub/Publisher.php index 3a65ff06..73bcbe97 100644 --- a/src/PubSubHubbub/Publisher.php +++ b/src/PubSubHubbub/Publisher.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Feed_Pubsubhubbub - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -28,7 +28,7 @@ /** * @category Zend * @package Zend_Feed_Pubsubhubbub - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Publisher @@ -384,7 +384,7 @@ public function getErrors() protected function _getHttpClient() { $client = PubSubHubbub::getHttpClient(); - $client->setMethod(\Zend\Http\Client::POST); + $client->setMethod(\Zend\Http\Request::METHOD_POST); $client->setConfig(array( 'useragent' => 'Zend_Feed_Pubsubhubbub_Publisher/' . \Zend\Version::VERSION, )); @@ -403,7 +403,7 @@ protected function _getHttpClient() $params[] = urlencode($name) . '=' . urlencode($value); } $paramString = implode('&', $params); - $client->setRawData($paramString); + $client->setRawBody($paramString); return $client; } } diff --git a/src/PubSubHubbub/Subscriber.php b/src/PubSubHubbub/Subscriber.php index 0be6de5c..e64bcfe5 100644 --- a/src/PubSubHubbub/Subscriber.php +++ b/src/PubSubHubbub/Subscriber.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Feed_Pubsubhubbub - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -29,7 +29,7 @@ /** * @category Zend * @package Zend_Feed_Pubsubhubbub - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Subscriber @@ -715,7 +715,7 @@ protected function _getRequestParameters($hubUrl, $mode) $params['hub.callback'] = rtrim($this->getCallbackUrl(), '/') . '/' . PubSubHubbub::urlencode($key); } - if ($mode == 'subscribe' && !is_null($this->getLeaseSeconds())) { + if ($mode == 'subscribe' && $this->getLeaseSeconds() !== null) { $params['hub.lease_seconds'] = $this->getLeaseSeconds(); } diff --git a/src/PubSubHubbub/Subscriber/Callback.php b/src/PubSubHubbub/Subscriber/Callback.php index eeea2011..5de9452b 100644 --- a/src/PubSubHubbub/Subscriber/Callback.php +++ b/src/PubSubHubbub/Subscriber/Callback.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Feed_Pubsubhubbub - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -29,7 +29,7 @@ /** * @category Zend * @package Zend_Feed_Pubsubhubbub - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Callback extends PubSubHubbub\AbstractCallback @@ -199,7 +199,7 @@ public function setFeedUpdate($feed) */ public function hasFeedUpdate() { - if (is_null($this->_feedUpdate)) { + if ($this->_feedUpdate === null) { return false; } return true; diff --git a/src/Reader/AbstractEntry.php b/src/Reader/AbstractEntry.php index cf366b9e..5f7b2136 100644 --- a/src/Reader/AbstractEntry.php +++ b/src/Reader/AbstractEntry.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Feed_Reader - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -28,7 +28,7 @@ * @uses \Zend\Feed\Reader\Reader * @category Zend * @package Zend_Feed_Reader - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class AbstractEntry diff --git a/src/Reader/AbstractFeed.php b/src/Reader/AbstractFeed.php index 38ec5878..85af5751 100644 --- a/src/Reader/AbstractFeed.php +++ b/src/Reader/AbstractFeed.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Feed_Reader - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -29,7 +29,7 @@ * @uses Zend\Feed\Reader\Feed * @category Zend * @package Zend_Feed_Reader - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class AbstractFeed implements Feed diff --git a/src/Reader/Collection.php b/src/Reader/Collection.php index fb71b6ff..56976930 100644 --- a/src/Reader/Collection.php +++ b/src/Reader/Collection.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Feed_Reader - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -27,7 +27,7 @@ * @uses ArrayObject * @category Zend * @package Zend_Feed_Reader - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Collection extends \ArrayObject diff --git a/src/Reader/Collection/AbstractCollection.php b/src/Reader/Collection/AbstractCollection.php index cb5bd26a..81c21dda 100644 --- a/src/Reader/Collection/AbstractCollection.php +++ b/src/Reader/Collection/AbstractCollection.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Feed_Reader - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -26,7 +26,7 @@ /** * @category Zend * @package Zend_Feed_Reader - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class AbstractCollection extends \ArrayObject diff --git a/src/Reader/Collection/Author.php b/src/Reader/Collection/Author.php index 12dd8086..bfb3ef8a 100644 --- a/src/Reader/Collection/Author.php +++ b/src/Reader/Collection/Author.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Feed_Reader - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -27,7 +27,7 @@ * @uses \Zend\Feed\Reader\Collection\AbstractCollection * @category Zend * @package Zend_Feed_Reader -* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) +* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Author extends AbstractCollection diff --git a/src/Reader/Collection/Category.php b/src/Reader/Collection/Category.php index 8467d438..8d5f71dc 100644 --- a/src/Reader/Collection/Category.php +++ b/src/Reader/Collection/Category.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Feed_Reader - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -27,7 +27,7 @@ * @uses \Zend\Feed\Reader\Collection\CollectionAbstract * @category Zend * @package Zend_Feed_Reader -* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) +* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Category extends AbstractCollection diff --git a/src/Reader/Collection/Collection.php b/src/Reader/Collection/Collection.php index 9c4e214f..112082d5 100644 --- a/src/Reader/Collection/Collection.php +++ b/src/Reader/Collection/Collection.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Feed_Reader - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -26,7 +26,7 @@ /** * @category Zend * @package Zend_Feed_Reader -* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) +* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Collection extends \ArrayObject diff --git a/src/Reader/Entry.php b/src/Reader/Entry.php index 67e79bb0..2cfc810b 100644 --- a/src/Reader/Entry.php +++ b/src/Reader/Entry.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Feed_Reader - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -26,7 +26,7 @@ /** * @category Zend * @package Zend_Feed_Reader -* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) +* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Entry diff --git a/src/Reader/Entry/AbstractEntry.php b/src/Reader/Entry/AbstractEntry.php index f308a9da..d6bb1508 100644 --- a/src/Reader/Entry/AbstractEntry.php +++ b/src/Reader/Entry/AbstractEntry.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Feed_Reader - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -30,7 +30,7 @@ * @uses \Zend\Feed\Reader\Reader * @category Zend * @package Zend_Feed_Reader -* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) +* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class AbstractEntry diff --git a/src/Reader/Entry/Atom.php b/src/Reader/Entry/Atom.php index 8c8a32ed..43c41776 100644 --- a/src/Reader/Entry/Atom.php +++ b/src/Reader/Entry/Atom.php @@ -14,7 +14,7 @@ * * @category Zend * @package Reader\Reader - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -31,7 +31,7 @@ * @uses \Zend\Feed\Reader\Extension\Atom\Entry * @category Zend * @package Zend_Feed_Reader -* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) +* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Atom extends AbstractEntry implements Reader\Entry diff --git a/src/Reader/Entry/Rss.php b/src/Reader/Entry/Rss.php index 7225bf08..eb25798f 100644 --- a/src/Reader/Entry/Rss.php +++ b/src/Reader/Entry/Rss.php @@ -14,7 +14,7 @@ * * @category Zend * @package Reader\Reader - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -40,7 +40,7 @@ * @uses \Zend\Feed\Reader\Extension\WellformedWeb\Entry * @category Zend * @package Reader\Reader -* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) +* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Rss extends AbstractEntry implements Reader\Entry diff --git a/src/Reader/Exception.php b/src/Reader/Exception.php index 17585125..a12bd542 100644 --- a/src/Reader/Exception.php +++ b/src/Reader/Exception.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Feed -* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) +* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -31,7 +31,7 @@ * @uses \Exception * @category Zend * @package Zend_Feed -* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) +* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Exception extends \Exception diff --git a/src/Reader/Extension/AbstractEntry.php b/src/Reader/Extension/AbstractEntry.php index fb56b15f..4d10964e 100644 --- a/src/Reader/Extension/AbstractEntry.php +++ b/src/Reader/Extension/AbstractEntry.php @@ -14,7 +14,7 @@ * * @category Zend * @package Reader\Reader - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -28,7 +28,7 @@ * @uses \Zend\Feed\Reader\Reader * @category Zend * @package Reader\Reader -* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) +* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class AbstractEntry diff --git a/src/Reader/Extension/AbstractFeed.php b/src/Reader/Extension/AbstractFeed.php index 3d51db8c..39cb000e 100644 --- a/src/Reader/Extension/AbstractFeed.php +++ b/src/Reader/Extension/AbstractFeed.php @@ -14,7 +14,7 @@ * * @category Zend * @package Reader\Reader - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -31,7 +31,7 @@ * @uses \Zend\Feed\Reader\Entry\RSS * @category Zend * @package Zend_Feed_Reader -* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) +* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class AbstractFeed diff --git a/src/Reader/Extension/Atom/Entry.php b/src/Reader/Extension/Atom/Entry.php index fdb3084b..becc58b2 100644 --- a/src/Reader/Extension/Atom/Entry.php +++ b/src/Reader/Extension/Atom/Entry.php @@ -14,7 +14,7 @@ * * @category Zend * @package Reader\Reader - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -35,7 +35,7 @@ /** * @category Zend * @package Reader\Reader -* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) +* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Entry extends Extension\AbstractEntry @@ -563,7 +563,7 @@ public function getSource() protected function _absolutiseUri($link) { if (!Uri\UriFactory::factory($link)->isValid()) { - if (!is_null($this->getBaseUrl())) { + if ($this->getBaseUrl() !== null) { $link = $this->getBaseUrl() . $link; if (!Uri\UriFactory::factory($link)->isValid()) { $link = null; diff --git a/src/Reader/Extension/Atom/Feed.php b/src/Reader/Extension/Atom/Feed.php index c5aac407..fb764af2 100644 --- a/src/Reader/Extension/Atom/Feed.php +++ b/src/Reader/Extension/Atom/Feed.php @@ -14,7 +14,7 @@ * * @category Zend * @package Reader\Reader - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -32,7 +32,7 @@ /** * @category Zend * @package Reader\Reader -* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) +* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Feed extends Extension\AbstractFeed @@ -504,7 +504,7 @@ protected function _getAuthor(\DOMElement $element) protected function _absolutiseUri($link) { if (!Uri\UriFactory::factory($link)->isValid()) { - if (!is_null($this->getBaseUrl())) { + if ($this->getBaseUrl() !== null) { $link = $this->getBaseUrl() . $link; if (!Uri\UriFactory::factory($link)->isValid()) { $link = null; diff --git a/src/Reader/Extension/Content/Entry.php b/src/Reader/Extension/Content/Entry.php index 342e8c9f..bdb2b34c 100644 --- a/src/Reader/Extension/Content/Entry.php +++ b/src/Reader/Extension/Content/Entry.php @@ -14,7 +14,7 @@ * * @category Zend * @package Reader\Reader - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -30,7 +30,7 @@ * @uses Reader\Reader_Entry_EntryAbstract * @category Zend * @package Reader\Reader -* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) +* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Entry extends Extension\AbstractEntry diff --git a/src/Reader/Extension/CreativeCommons/Entry.php b/src/Reader/Extension/CreativeCommons/Entry.php index fc572b55..fa76ca76 100644 --- a/src/Reader/Extension/CreativeCommons/Entry.php +++ b/src/Reader/Extension/CreativeCommons/Entry.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Feed_Reader - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -30,7 +30,7 @@ * @uses Reader\Reader_Entry_EntryAbstract * @category Zend * @package Reader\Reader -* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) +* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Entry extends Extension\AbstractEntry diff --git a/src/Reader/Extension/CreativeCommons/Feed.php b/src/Reader/Extension/CreativeCommons/Feed.php index f74be690..b2574ea8 100644 --- a/src/Reader/Extension/CreativeCommons/Feed.php +++ b/src/Reader/Extension/CreativeCommons/Feed.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Feed_Reader - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -30,7 +30,7 @@ * @uses Reader\Reader_Entry_EntryAbstract * @category Zend * @package Reader\Reader -* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) +* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Feed extends Extension\AbstractFeed diff --git a/src/Reader/Extension/DublinCore/Entry.php b/src/Reader/Extension/DublinCore/Entry.php index c35b3fc6..4aa87d2a 100644 --- a/src/Reader/Extension/DublinCore/Entry.php +++ b/src/Reader/Extension/DublinCore/Entry.php @@ -14,7 +14,7 @@ * * @category Zend * @package Reader\Reader - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -35,7 +35,7 @@ * @uses \Zend\Feed\Reader\Extension\EntryAbstract * @category Zend * @package Reader\Reader -* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) +* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Entry extends Extension\AbstractEntry diff --git a/src/Reader/Extension/DublinCore/Feed.php b/src/Reader/Extension/DublinCore/Feed.php index 6c91a9dc..dcc140e0 100644 --- a/src/Reader/Extension/DublinCore/Feed.php +++ b/src/Reader/Extension/DublinCore/Feed.php @@ -14,7 +14,7 @@ * * @category Zend * @package Reader\Reader - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -35,7 +35,7 @@ * @uses \Zend\Feed\Reader\Extension\AbstractEntry * @category Zend * @package Zend_Feed_Reader -* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) +* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Feed extends Extension\AbstractFeed diff --git a/src/Reader/Extension/Podcast/Entry.php b/src/Reader/Extension/Podcast/Entry.php index 9ab2c48b..6ad20322 100644 --- a/src/Reader/Extension/Podcast/Entry.php +++ b/src/Reader/Extension/Podcast/Entry.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Feed_Reader - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -29,7 +29,7 @@ * @uses \Zend\Feed\Reader\Extension\EntryAbstract * @category Zend * @package Zend_Feed_Reader -* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) +* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Entry extends Extension\AbstractEntry diff --git a/src/Reader/Extension/Podcast/Feed.php b/src/Reader/Extension/Podcast/Feed.php index 26e29ae5..0665310c 100644 --- a/src/Reader/Extension/Podcast/Feed.php +++ b/src/Reader/Extension/Podcast/Feed.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Feed_Reader - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -29,7 +29,7 @@ * @uses \Zend\Feed\Reader\Extension\EntryAbstract * @category Zend * @package Zend_Feed_Reader -* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) +* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Feed extends Extension\AbstractFeed diff --git a/src/Reader/Extension/Slash/Entry.php b/src/Reader/Extension/Slash/Entry.php index 28b4d3bb..8760388a 100644 --- a/src/Reader/Extension/Slash/Entry.php +++ b/src/Reader/Extension/Slash/Entry.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Feed_Reader - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -29,7 +29,7 @@ * @uses \Zend\Feed\Reader\Extension\EntryAbstract * @category Zend * @package Zend_Feed_Reader -* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) +* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Entry extends Extension\AbstractEntry diff --git a/src/Reader/Extension/Syndication/Feed.php b/src/Reader/Extension/Syndication/Feed.php index 60fdb970..4bd614a9 100644 --- a/src/Reader/Extension/Syndication/Feed.php +++ b/src/Reader/Extension/Syndication/Feed.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Feed_Reader - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -31,7 +31,7 @@ * @uses \Zend\Feed\Reader\Extension\AbstractFeed * @category Zend * @package Zend_Feed_Reader - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Feed extends \Zend\Feed\Reader\Extension\AbstractFeed diff --git a/src/Reader/Extension/Thread/Entry.php b/src/Reader/Extension/Thread/Entry.php index 067dfe77..8ada7545 100644 --- a/src/Reader/Extension/Thread/Entry.php +++ b/src/Reader/Extension/Thread/Entry.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Feed_Reader - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -29,7 +29,7 @@ * @uses \Zend\Feed\Reader\Extension\EntryAbstract * @category Zend * @package Zend_Feed_Reader -* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) +* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Entry extends Extension\AbstractEntry diff --git a/src/Reader/Extension/WellFormedWeb/Entry.php b/src/Reader/Extension/WellFormedWeb/Entry.php index bc35eabe..c8c0bb9d 100644 --- a/src/Reader/Extension/WellFormedWeb/Entry.php +++ b/src/Reader/Extension/WellFormedWeb/Entry.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Feed_Reader - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -29,7 +29,7 @@ * @uses \Zend\Feed\Reader\Extension\EntryAbstract * @category Zend * @package Zend_Feed_Reader -* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) +* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Entry extends Extension\AbstractEntry diff --git a/src/Reader/Feed.php b/src/Reader/Feed.php index f925dd9b..b0b91bbc 100644 --- a/src/Reader/Feed.php +++ b/src/Reader/Feed.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Feed_Reader - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -28,7 +28,7 @@ * @uses Iterator * @category Zend * @package Zend_Feed_Reader -* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) +* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Feed extends \Iterator, \Countable diff --git a/src/Reader/Feed/AbstractFeed.php b/src/Reader/Feed/AbstractFeed.php index 613fccdd..af162b1a 100644 --- a/src/Reader/Feed/AbstractFeed.php +++ b/src/Reader/Feed/AbstractFeed.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Feed_Reader - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -32,7 +32,7 @@ * @uses \Zend\Feed\Reader\Feed * @category Zend * @package Zend_Feed_Reader -* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) +* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class AbstractFeed implements Reader\Feed diff --git a/src/Reader/Feed/Atom.php b/src/Reader/Feed/Atom.php index e995015d..398d2da3 100644 --- a/src/Reader/Feed/Atom.php +++ b/src/Reader/Feed/Atom.php @@ -14,7 +14,7 @@ * * @category Zend * @package Reader - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -31,7 +31,7 @@ * @uses \Zend\Feed\Reader\Feed\AbstractFeed * @category Zend * @package Reader -* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) +* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Atom extends AbstractFeed diff --git a/src/Reader/Feed/Atom/Source.php b/src/Reader/Feed/Atom/Source.php index 375e87bd..e82c3706 100644 --- a/src/Reader/Feed/Atom/Source.php +++ b/src/Reader/Feed/Atom/Source.php @@ -14,7 +14,7 @@ * * @category Zend * @package Reader\Reader - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -32,7 +32,7 @@ * @uses \Zend\Feed\Reader\Feed\AbstractFeed * @category Zend * @package Reader -* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) +* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Source extends Feed\Atom diff --git a/src/Reader/Feed/Rss.php b/src/Reader/Feed/Rss.php index 1876fa40..98360e3c 100644 --- a/src/Reader/Feed/Rss.php +++ b/src/Reader/Feed/Rss.php @@ -14,7 +14,7 @@ * * @category Zend * @package Reader - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -36,7 +36,7 @@ * @uses \Zend\Feed\Reader\Feed\AbstractFeed * @category Zend * @package Reader -* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) +* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Rss extends AbstractFeed @@ -167,7 +167,7 @@ public function getCopyright() $copyright = $this->_xpath->evaluate('string(/rss/channel/copyright)'); } - if (!$copyright && !is_null($this->getExtension('DublinCore'))) { + if (!$copyright && $this->getExtension('DublinCore') !== null) { $copyright = $this->getExtension('DublinCore')->getCopyright(); } @@ -331,7 +331,7 @@ public function getDescription() $description = $this->_xpath->evaluate('string(/rdf:RDF/rss:channel/rss:description)'); } - if (!$description && !is_null($this->getExtension('DublinCore'))) { + if (!$description && $this->getExtension('DublinCore') !== null) { $description = $this->getExtension('DublinCore')->getDescription(); } @@ -366,7 +366,7 @@ public function getId() $id = $this->_xpath->evaluate('string(/rss/channel/guid)'); } - if (!$id && !is_null($this->getExtension('DublinCore'))) { + if (!$id && $this->getExtension('DublinCore') !== null) { $id = $this->getExtension('DublinCore')->getId(); } @@ -461,7 +461,7 @@ public function getLanguage() $language = $this->_xpath->evaluate('string(/rss/channel/language)'); } - if (!$language && !is_null($this->getExtension('DublinCore'))) { + if (!$language && $this->getExtension('DublinCore') !== null) { $language = $this->getExtension('DublinCore')->getLanguage(); } @@ -599,7 +599,7 @@ public function getTitle() $title = $this->_xpath->evaluate('string(/rdf:RDF/rss:channel/rss:title)'); } - if (!$title && !is_null($this->getExtension('DublinCore'))) { + if (!$title && $this->getExtension('DublinCore') !== null) { $title = $this->getExtension('DublinCore')->getTitle(); } diff --git a/src/Reader/FeedSet.php b/src/Reader/FeedSet.php index 114dd5bc..54378d00 100644 --- a/src/Reader/FeedSet.php +++ b/src/Reader/FeedSet.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Feed_Reader - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -29,7 +29,7 @@ /** * @category Zend * @package Zend_Feed_Reader -* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) +* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class FeedSet extends ArrayObject @@ -65,16 +65,16 @@ public function addLinks(\DOMNodeList $links, $uri) continue; } if (!isset($this->rss) && $link->getAttribute('type') == 'application/rss+xml') { - $this->rss = $this->_absolutiseUri(trim($link->getAttribute('href')), $uri); + $this->rss = $this->absolutiseUri(trim($link->getAttribute('href')), $uri); } elseif(!isset($this->atom) && $link->getAttribute('type') == 'application/atom+xml') { - $this->atom = $this->_absolutiseUri(trim($link->getAttribute('href')), $uri); + $this->atom = $this->absolutiseUri(trim($link->getAttribute('href')), $uri); } elseif(!isset($this->rdf) && $link->getAttribute('type') == 'application/rdf+xml') { - $this->rdf = $this->_absolutiseUri(trim($link->getAttribute('href')), $uri); + $this->rdf = $this->absolutiseUri(trim($link->getAttribute('href')), $uri); } $this[] = new self(array( 'rel' => 'alternate', 'type' => $link->getAttribute('type'), - 'href' => $this->_absolutiseUri(trim($link->getAttribute('href')), $uri), + 'href' => $this->absolutiseUri(trim($link->getAttribute('href')), $uri), )); } } @@ -82,9 +82,10 @@ public function addLinks(\DOMNodeList $links, $uri) /** * Attempt to turn a relative URI into an absolute URI */ - protected function _absolutiseUri($link, $uri = null) + protected function absolutiseUri($link, $uri = null) { - if (!Uri\UriFactory::factory($link)->isValid()) { + $linkUri = Uri\UriFactory::factory($link); + if (!$linkUri->isAbsolute() or !$linkUri->isValid()) { if ($uri !== null) { $uri = Uri\UriFactory::factory($uri); @@ -92,7 +93,7 @@ protected function _absolutiseUri($link, $uri = null) $link = $uri->getPath() . '/' . $link; } - $link = $uri->getScheme() . '://' . $uri->getHost() . '/' . $this->_canonicalizePath($link); + $link = $uri->getScheme() . '://' . $uri->getHost() . '/' . $this->canonicalizePath($link); if (!Uri\UriFactory::factory($link)->isValid()) { $link = null; } @@ -104,7 +105,7 @@ protected function _absolutiseUri($link, $uri = null) /** * Canonicalize relative path */ - protected function _canonicalizePath($path) + protected function canonicalizePath($path) { $parts = array_filter(explode('/', $path)); $absolutes = array(); diff --git a/src/Reader/Reader.php b/src/Reader/Reader.php index 7e67b3ea..69ba1a83 100644 --- a/src/Reader/Reader.php +++ b/src/Reader/Reader.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Feed_Reader - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -23,13 +23,15 @@ */ namespace Zend\Feed\Reader; -use Zend\Http, - Zend\Loader; +use Zend\Cache\Storage\Adapter as CacheAdapter, + Zend\Http, + Zend\Loader, + Zend\Stdlib\ErrorHandler; /** * @category Zend * @package Zend_Feed_Reader -* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) +* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Reader @@ -65,7 +67,7 @@ class Reader /** * Cache instance * - * @var \Zend\Cache\Frontend\Core + * @var CacheAdapter */ protected static $_cache = null; @@ -111,7 +113,7 @@ class Reader /** * Get the Feed cache * - * @return \Zend\Cache\Frontend\Core + * @return CacheAdapter */ public static function getCache() { @@ -121,10 +123,10 @@ public static function getCache() /** * Set the feed cache * - * @param \Zend\Cache\Frontend\Core $cache + * @param CacheAdapter $cache * @return void */ - public static function setCache(\Zend\Cache\Frontend\Core $cache) + public static function setCache(CacheAdapter $cache) { self::$_cache = $cache; } @@ -217,13 +219,13 @@ public static function import($uri, $etag = null, $lastModified = null) $cacheId = 'Zend_Feed_Reader_' . md5($uri); if (self::$_httpConditionalGet && $cache) { - $data = $cache->load($cacheId); + $data = $cache->getItem($cacheId); if ($data) { if ($etag === null) { - $etag = $cache->load($cacheId.'_etag'); + $etag = $cache->getItem($cacheId.'_etag'); } if ($lastModified === null) { - $lastModified = $cache->load($cacheId.'_lastmodified');; + $lastModified = $cache->getItem($cacheId.'_lastmodified');; } if ($etag) { $headers->addHeaderLine('If-None-Match', $etag); @@ -240,17 +242,17 @@ public static function import($uri, $etag = null, $lastModified = null) $responseXml = $data; } else { $responseXml = $response->getBody(); - $cache->save($responseXml, $cacheId); - if ($response->getHeader('ETag')) { - $cache->save($response->getHeader('ETag'), $cacheId.'_etag'); + $cache->setItem($cacheId, $responseXml); + if ($response->headers()->get('ETag')) { + $cache->setItem($cacheId . '_etag', $response->headers()->get('ETag')->getFieldValue()); } - if ($response->getHeader('Last-Modified')) { - $cache->save($response->getHeader('Last-Modified'), $cacheId.'_lastmodified'); + if ($response->headers()->get('Last-Modified')) { + $cache->setItem($cacheId . '_lastmodified', $response->headers()->get('Last-Modified')->getFieldValue()); } } return self::importString($responseXml); } elseif ($cache) { - $data = $cache->load($cacheId); + $data = $cache->getItem($cacheId); if ($data !== false) { return self::importString($data); } @@ -259,7 +261,7 @@ public static function import($uri, $etag = null, $lastModified = null) throw new Exception('Feed failed to load, got response code ' . $response->getStatusCode()); } $responseXml = $response->getBody(); - $cache->save($responseXml, $cacheId); + $cache->setItem($cacheId, $responseXml); return self::importString($responseXml); } else { $response = $client->send(); @@ -322,11 +324,11 @@ public static function importString($string) */ public static function importFile($filename) { - @ini_set('track_errors', 1); - $feed = @file_get_contents($filename); - @ini_restore('track_errors'); + ErrorHandler::start(); + $feed = file_get_contents($filename); + $err = ErrorHandler::stop(); if ($feed === false) { - throw new Exception("File could not be loaded: $php_errormsg"); + throw new Exception("File '{$filename}' could not be loaded", 0, $err); } return self::importString($feed); } @@ -454,7 +456,7 @@ public static function detectType($feed, $specOnly = false) if ($xpath->query('//atom:feed')->length) { return self::TYPE_ATOM_10; } - + if ($xpath->query('//atom:entry')->length) { if ($specOnly == true) { return self::TYPE_ATOM_10; @@ -643,7 +645,7 @@ protected static function _registerCoreExtensions() self::registerExtension('Thread'); self::registerExtension('Podcast'); } - + /** * Utility method to apply array_unique operation to a multidimensional * array. @@ -662,5 +664,5 @@ public static function arrayUnique(array $array) } return $array; } - + } diff --git a/src/Writer/AbstractFeed.php b/src/Writer/AbstractFeed.php index 6d2e5aa9..52d3b1f9 100644 --- a/src/Writer/AbstractFeed.php +++ b/src/Writer/AbstractFeed.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Feed_Writer - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -30,7 +30,7 @@ /** * @category Zend * @package Zend_Feed_Writer - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class AbstractFeed @@ -144,7 +144,7 @@ public function setDateCreated($date = null) $zdate = null; if ($date === null) { $zdate = new Date\Date; - } elseif (ctype_digit($date) && strlen($date) == 10) { + } elseif (ctype_digit((string)$date)) { $zdate = new Date\Date($date, Date\Date::TIMESTAMP); } elseif ($date instanceof Date\Date) { $zdate = $date; @@ -164,7 +164,7 @@ public function setDateModified($date = null) $zdate = null; if ($date === null) { $zdate = new Date\Date; - } elseif (ctype_digit($date) && strlen($date) == 10) { + } elseif (ctype_digit((string)$date)) { $zdate = new Date\Date($date, Date\Date::TIMESTAMP); } elseif ($date instanceof Date\Date) { $zdate = $date; @@ -184,7 +184,7 @@ public function setLastBuildDate($date = null) $zdate = null; if ($date === null) { $zdate = new Date\Date; - } elseif (ctype_digit($date) && strlen($date) == 10) { + } elseif (ctype_digit((string)$date)) { $zdate = new Date\Date($date, Date\Date::TIMESTAMP); } elseif ($date instanceof Date\Date) { $zdate = $date; diff --git a/src/Writer/Deleted.php b/src/Writer/Deleted.php index 8517549c..3fee2c9d 100644 --- a/src/Writer/Deleted.php +++ b/src/Writer/Deleted.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Feed_Writer - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -29,7 +29,7 @@ /** * @category Zend * @package Zend_Feed_Writer -* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) +* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Deleted @@ -131,7 +131,7 @@ public function setWhen($date = null) $zdate = null; if ($date === null) { $zdate = new Date\Date; - } elseif (ctype_digit($date) && strlen($date) == 10) { + } elseif (ctype_digit((string)$date)) { $zdate = new Date\Date($date, Date\Date::TIMESTAMP); } elseif ($date instanceof Date\Date) { $zdate = $date; diff --git a/src/Writer/Entry.php b/src/Writer/Entry.php index 95d13d24..08fdd421 100644 --- a/src/Writer/Entry.php +++ b/src/Writer/Entry.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Feed_Writer - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -29,7 +29,7 @@ /** * @category Zend * @package Zend_Feed_Writer -* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) +* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Entry @@ -197,7 +197,7 @@ public function setDateCreated($date = null) $zdate = null; if ($date === null) { $zdate = new Date\Date; - } elseif (ctype_digit($date) && strlen($date) == 10) { + } elseif (ctype_digit((string)$date)) { $zdate = new Date\Date($date, Date\Date::TIMESTAMP); } elseif ($date instanceof Date\Date) { $zdate = $date; @@ -217,7 +217,7 @@ public function setDateModified($date = null) $zdate = null; if ($date === null) { $zdate = new Date\Date; - } elseif (ctype_digit($date) && strlen($date) == 10) { + } elseif (ctype_digit((string)$date)) { $zdate = new Date\Date($date, Date\Date::TIMESTAMP); } elseif ($date instanceof Date\Date) { $zdate = $date; diff --git a/src/Writer/Exception.php b/src/Writer/Exception.php index 41ff41be..46dbc637 100644 --- a/src/Writer/Exception.php +++ b/src/Writer/Exception.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Feed -* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) +* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -31,7 +31,7 @@ * @uses \Exception * @category Zend * @package Zend_Feed -* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) +* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Exception extends \Exception diff --git a/src/Writer/Exception/InvalidArgumentException.php b/src/Writer/Exception/InvalidArgumentException.php new file mode 100644 index 00000000..7826dbc6 --- /dev/null +++ b/src/Writer/Exception/InvalidArgumentException.php @@ -0,0 +1,40 @@ + $value) { + // Setters + $key = static::convertKey($key); + $method = 'set' . $key; + if (method_exists($feed, $method)) { + switch ($method) { + case 'setfeedlink': + if (!is_array($value)) { + // Need an array + break; + } + if (!array_key_exists('link', $value) || !array_key_exists('type', $value)) { + // Need both keys to set this correctly + break; + } + $feed->setFeedLink($value['link'], $value['type']); + break; + default: + $feed->$method($value); + break; + } + continue; + } + + // Entries + if ('entries' == $key) { + static::createEntries($value, $feed); + continue; + } + } + + return $feed; + } + + /** + * Normalize a key + * + * @param string $key + * @return void + */ + protected static function convertKey($key) + { + $key = str_replace('_', '', strtolower($key)); + return $key; + } + + /** + * Create and attach entries to a feed + * + * @param array|Traversable $entries + * @param Feed $feed + * @return void + */ + protected static function createEntries($entries, Feed $feed) + { + if (!is_array($entries) && !$entries instanceof Traversable) { + throw new Exception\InvalidArgumentException(sprintf( + '%s::factory expects the "entries" value to be an array or Traversable; received "%s"', + get_called_class(), + (is_object($entries) ? get_class($entries) : gettype($entries)) + )); + } + + foreach ($entries as $data) { + if (!is_array($data) && !$data instanceof Traversable && !$data instanceof Entry) { + throw Exception\InvalidArgumentException(sprintf( + '%s expects an array, Traversable, or Zend\Feed\Writer\Entry argument; received "%s"', + __METHOD__, + (is_object($data) ? get_class($data) : gettype($data)) + )); + } + + // Use case 1: Entry item + if ($data instanceof Entry) { + $feed->addEntry($data); + continue; + } + + // Use case 2: iterate item and populate entry + $entry = $feed->createEntry(); + foreach ($data as $key => $value) { + $key = static::convertKey($key); + $method = 'set' . $key; + if (!method_exists($entry, $method)) { + continue; + } + $entry->$method($value); + } + $feed->addEntry($entry); + } + } +} diff --git a/src/Writer/InvalidMethodException.php b/src/Writer/InvalidMethodException.php index e0249e30..86f6763e 100644 --- a/src/Writer/InvalidMethodException.php +++ b/src/Writer/InvalidMethodException.php @@ -15,7 +15,7 @@ * * @category Zend * @package Zend_Feed - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -32,7 +32,7 @@ * @uses \Exception * @category Zend * @package Zend_Feed - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class InvalidMethodException extends \Exception diff --git a/src/Writer/Renderer.php b/src/Writer/Renderer.php index 5222755d..3e3316eb 100644 --- a/src/Writer/Renderer.php +++ b/src/Writer/Renderer.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Feed_Writer - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -26,7 +26,7 @@ /** * @category Zend * @package Zend_Feed_Writer - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Renderer diff --git a/src/Writer/Renderer/AbstractRenderer.php b/src/Writer/Renderer/AbstractRenderer.php index a91f3c82..8391ba9f 100644 --- a/src/Writer/Renderer/AbstractRenderer.php +++ b/src/Writer/Renderer/AbstractRenderer.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Feed_Writer - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -30,7 +30,7 @@ * @uses \Zend\Version * @category Zend * @package Zend_Feed_Writer -* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) +* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class AbstractRenderer diff --git a/src/Writer/Renderer/Entry/Atom.php b/src/Writer/Renderer/Entry/Atom.php index 012655c3..8da82b98 100644 --- a/src/Writer/Renderer/Entry/Atom.php +++ b/src/Writer/Renderer/Entry/Atom.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Feed_Writer - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -35,7 +35,7 @@ * @uses tidy * @category Zend * @package Zend_Feed_Writer - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Atom extends Renderer\AbstractRenderer implements Renderer\Renderer diff --git a/src/Writer/Renderer/Entry/Atom/Deleted.php b/src/Writer/Renderer/Entry/Atom/Deleted.php index 8eeab58f..4f210ace 100644 --- a/src/Writer/Renderer/Entry/Atom/Deleted.php +++ b/src/Writer/Renderer/Entry/Atom/Deleted.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Feed_Writer - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -30,7 +30,7 @@ * @uses \Zend\Feed\Writer\Renderer * @category Zend * @package Zend_Feed_Writer - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Deleted diff --git a/src/Writer/Renderer/Entry/AtomDeleted.php b/src/Writer/Renderer/Entry/AtomDeleted.php index c8aa0f2a..cffb7bf5 100644 --- a/src/Writer/Renderer/Entry/AtomDeleted.php +++ b/src/Writer/Renderer/Entry/AtomDeleted.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Feed_Writer - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -32,7 +32,7 @@ * @uses \Zend\Feed\Writer\Renderer\RendererInterface * @category Zend * @package Zend_Feed_Writer -* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) +* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class AtomDeleted extends Renderer\AbstractRenderer implements Renderer\Renderer diff --git a/src/Writer/Renderer/Entry/Rss.php b/src/Writer/Renderer/Entry/Rss.php index be4f961c..8920c48a 100644 --- a/src/Writer/Renderer/Entry/Rss.php +++ b/src/Writer/Renderer/Entry/Rss.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Feed_Writer - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -31,7 +31,7 @@ /** * @category Zend * @package Zend_Feed_Writer -* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) +* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Rss extends Renderer\AbstractRenderer implements Renderer\Renderer diff --git a/src/Writer/Renderer/Feed/AbstractAtom.php b/src/Writer/Renderer/Feed/AbstractAtom.php index 3e9993bf..f53e78e2 100644 --- a/src/Writer/Renderer/Feed/AbstractAtom.php +++ b/src/Writer/Renderer/Feed/AbstractAtom.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Feed_Writer - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -36,7 +36,7 @@ * @uses \Zend\Version * @category Zend * @package Zend_Feed_Writer -* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) +* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class AbstractAtom extends Renderer\AbstractRenderer diff --git a/src/Writer/Renderer/Feed/Atom.php b/src/Writer/Renderer/Feed/Atom.php index c94457fc..74487602 100644 --- a/src/Writer/Renderer/Feed/Atom.php +++ b/src/Writer/Renderer/Feed/Atom.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Feed_Writer - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -37,7 +37,7 @@ * @uses \Zend\Version * @category Zend * @package Zend_Feed_Writer -* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) +* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Atom extends AbstractAtom implements Renderer\Renderer diff --git a/src/Writer/Renderer/Feed/Atom/AbstractAtom.php b/src/Writer/Renderer/Feed/Atom/AbstractAtom.php index dcc0662d..63c22c53 100644 --- a/src/Writer/Renderer/Feed/Atom/AbstractAtom.php +++ b/src/Writer/Renderer/Feed/Atom/AbstractAtom.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Feed_Writer - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -34,7 +34,7 @@ * @uses \Zend\Version * @category Zend * @package Zend_Feed_Writer - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class AbstractAtom extends Feed\Writer\Renderer\AbstractRenderer diff --git a/src/Writer/Renderer/Feed/Atom/Source.php b/src/Writer/Renderer/Feed/Atom/Source.php index 5164e8bb..a3ac4de7 100644 --- a/src/Writer/Renderer/Feed/Atom/Source.php +++ b/src/Writer/Renderer/Feed/Atom/Source.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Feed_Writer - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -29,7 +29,7 @@ * @uses \Zend\Feed\Writer\Renderer * @category Zend * @package Zend_Feed_Writer - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Source extends AbstractAtom implements \Zend\Feed\Writer\Renderer diff --git a/src/Writer/Renderer/Feed/AtomSource.php b/src/Writer/Renderer/Feed/AtomSource.php index 2763ba54..a600ea46 100644 --- a/src/Writer/Renderer/Feed/AtomSource.php +++ b/src/Writer/Renderer/Feed/AtomSource.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Feed_Writer - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -31,7 +31,7 @@ * @uses \Zend\Feed\Writer\Renderer\RendererInterface * @category Zend * @package Zend_Feed_Writer -* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) +* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class AtomSource extends AtomAbstract implements Renderer\Renderer diff --git a/src/Writer/Renderer/Feed/Rss.php b/src/Writer/Renderer/Feed/Rss.php index dc6ed815..617fb24a 100644 --- a/src/Writer/Renderer/Feed/Rss.php +++ b/src/Writer/Renderer/Feed/Rss.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Feed_Writer - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -33,7 +33,7 @@ /** * @category Zend * @package Zend_Feed_Writer -* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) +* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Rss extends Renderer\AbstractRenderer implements Renderer\Renderer diff --git a/src/Writer/Renderer/Renderer.php b/src/Writer/Renderer/Renderer.php index 4e661c1c..a37042d2 100644 --- a/src/Writer/Renderer/Renderer.php +++ b/src/Writer/Renderer/Renderer.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Feed_Writer - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -26,7 +26,7 @@ /** * @category Zend * @package Zend_Feed_Writer -* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) +* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Renderer diff --git a/src/Writer/Source.php b/src/Writer/Source.php index 5b2d84e7..79794196 100644 --- a/src/Writer/Source.php +++ b/src/Writer/Source.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Feed_Writer - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -27,7 +27,7 @@ * @uses \Zend\Feed\Writer\Feed\FeedAbstract * @category Zend * @package Zend_Feed_Writer -* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) +* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Source extends AbstractFeed diff --git a/src/Writer/Writer.php b/src/Writer/Writer.php index 7b7e4102..7dd3260e 100644 --- a/src/Writer/Writer.php +++ b/src/Writer/Writer.php @@ -14,7 +14,7 @@ * * @category Zend * @package Zend_Feed_Writer - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -33,7 +33,7 @@ * @uses \Zend\Loader\PluginLoader * @category Zend * @package Zend_Feed_Writer -* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) +* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Writer diff --git a/test/PubSubHubbub/Model/SubscriptionTest.php b/test/PubSubHubbub/Model/SubscriptionTest.php index 727158fa..adb7c96c 100644 --- a/test/PubSubHubbub/Model/SubscriptionTest.php +++ b/test/PubSubHubbub/Model/SubscriptionTest.php @@ -14,13 +14,15 @@ * * @category Zend * @package UnitTests - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ namespace ZendTest\Feed\PubSubHubbub\Model; use Zend\Feed\PubSubHubbub\Model\Subscription; +use \Zend\Db\Adapter\Adapter as DbAdapter; +use \Zend\Db\TableGateway\TableGateway; /** * @category Zend @@ -28,7 +30,7 @@ * @subpackage UnitTests * @group Zend_Feed * @group Zend_Feed_Pubsubhubbub_Model - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class SubscriptionTest extends \PHPUnit_Framework_TestCase @@ -38,8 +40,13 @@ class SubscriptionTest extends \PHPUnit_Framework_TestCase */ public function testAllOperations() { - $this->_initDb(); - $subscription = new Subscription(); + $this->markTestIncomplete('PDO_Sqlite does not return row count, and no solution in Zend\Db yet for this'); + + $adapter = $this->initDb(); + $table = new TableGateway('subscription', $adapter); + + $subscription = new Subscription($table); + $id = uniqid(); $this->assertFalse($subscription->hasSubscription($id)); $this->assertFalse($subscription->getSubscription($id)); @@ -66,19 +73,20 @@ public function testImpemetsSubscriptionInterface() unset($reflection); } - protected function _initDb() + protected function initDb() { if (!extension_loaded('pdo') || !in_array('sqlite', \PDO::getAvailableDrivers()) ) { $this->markTestSkipped('Test only with pdo_sqlite'); } - $db = \Zend\Db\Db::factory('Pdo\Sqlite', array('dbname' => ':memory:')); - \Zend\Db\Table\AbstractTable::setDefaultAdapter($db); - $this->_createTable(); + $db = new DbAdapter(array('driver' => 'pdo_sqlite', 'dsn' => 'sqlite::memory:')); + $this->createTable($db); + + return $db; } - protected function _createTable() + protected function createTable($db) { $sql = "CREATE TABLE subscription (" . "id varchar(32) PRIMARY KEY NOT NULL DEFAULT '', " @@ -92,6 +100,6 @@ protected function _createTable() . "subscription_state varchar(12) DEFAULT NULL" . ");"; - \Zend\Db\Table\AbstractTable::getDefaultAdapter()->getConnection()->query($sql); + $db->query($sql)->execute(); } } diff --git a/test/PubSubHubbub/PubSubHubbubTest.php b/test/PubSubHubbub/PubSubHubbubTest.php index b2b7524f..cbf9da67 100644 --- a/test/PubSubHubbub/PubSubHubbubTest.php +++ b/test/PubSubHubbub/PubSubHubbubTest.php @@ -14,7 +14,7 @@ * * @category Zend * @package UnitTests - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -30,7 +30,7 @@ * @subpackage UnitTests * @group Zend_Feed * @group Zend_Feed_Subsubhubbub - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class PubSubHubbubTest extends \PHPUnit_Framework_TestCase @@ -44,7 +44,7 @@ public function teardown() public function testCanSetCustomHttpClient() { PubSubHubbub\PubSubHubbub::setHttpClient(new Pubsub()); - $this->assertType('ZendTest\Feed\PubSubHubbub\Pubsub', PubSubHubbub\PubSubHubbub::getHttpClient()); + $this->assertInstanceOf('ZendTest\Feed\PubSubHubbub\Pubsub', PubSubHubbub\PubSubHubbub::getHttpClient()); } public function testCanDetectHubs() diff --git a/test/PubSubHubbub/PublisherTest.php b/test/PubSubHubbub/PublisherTest.php index 4dd4588c..e52ed376 100644 --- a/test/PubSubHubbub/PublisherTest.php +++ b/test/PubSubHubbub/PublisherTest.php @@ -14,7 +14,7 @@ * * @category Zend * @package UnitTests - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -31,7 +31,7 @@ * @subpackage UnitTests * @group Zend_Feed * @group Zend_Feed_Subsubhubbub - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class PublisherTest extends \PHPUnit_Framework_TestCase @@ -309,7 +309,7 @@ public function request($method = null) { $response = new ResponseSuccess; return $response; } - public function getBody(){return $this->_prepareBody();} + public function getBody(){return $this->prepareBody();} } class ClientFail extends Http\Client { @@ -317,7 +317,7 @@ public function request($method = null) { $response = new ResponseFail; return $response; } - public function getBody(){return $this->_prepareBody();} + public function getBody(){return $this->prepareBody();} } class ResponseSuccess { diff --git a/test/PubSubHubbub/Subscriber/CallbackTest.php b/test/PubSubHubbub/Subscriber/CallbackTest.php index aeb202ca..b08e07e7 100644 --- a/test/PubSubHubbub/Subscriber/CallbackTest.php +++ b/test/PubSubHubbub/Subscriber/CallbackTest.php @@ -14,7 +14,7 @@ * * @category Zend * @package UnitTests - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -32,7 +32,7 @@ * @subpackage UnitTests * @group Zend_Feed * @group Zend_Feed_Subsubhubbub - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class CallbackTest extends \PHPUnit_Framework_TestCase @@ -45,13 +45,13 @@ public function setUp() $this->_callback = new \Zend\Feed\PubSubHubbub\Subscriber\Callback; $this->_adapter = $this->_getCleanMock( - 'Zend\Db\Adapter\AbstractAdapter' + '\Zend\Db\Adapter\Adapter' ); $this->_tableGateway = $this->_getCleanMock( - 'Zend\Db\Table\AbstractTable' + '\Zend\Db\TableGateway\TableGateway' ); $this->_rowset = $this->_getCleanMock( - 'Zend\Db\Table\AbstractRowset' + 'Zend\Db\ResultSet\ResultSet' ); $this->_tableGateway->expects($this->any())->method('getAdapter') @@ -144,7 +144,7 @@ public function testThrowsExceptionOnSettingAnyScalarTypeCastToAZeroOrLessIntege public function testCanSetStorageImplementation() { - $storage = new Model\Subscription($this->_tableGateway); + $storage = new Model\Subscription($this->_tableGateway); $this->_callback->setStorage($storage); $this->assertThat($this->_callback->getStorage(), $this->identicalTo($storage)); } @@ -154,14 +154,14 @@ public function testCanSetStorageImplementation() */ public function testValidatesValidHttpGetData() { - $mockReturnValue = $this->getMock('Result', array('toArray')); - $mockReturnValue->expects($this->any())->method('toArray')->will($this->returnValue(array( + $mockReturnValue = $this->getMock('Result', array('getArrayCopy')); + $mockReturnValue->expects($this->any())->method('getArrayCopy')->will($this->returnValue(array( 'verify_token' => hash('sha256', 'cba') ))); $this->_tableGateway->expects($this->any()) - ->method('find') - ->with($this->equalTo('verifytokenkey')) + ->method('select') + ->with($this->equalTo(array('id' => 'verifytokenkey'))) ->will($this->returnValue($this->_rowset)); $this->_rowset->expects($this->any()) ->method('current') @@ -205,15 +205,15 @@ public function testReturnsFalseIfVerifyTokenMissingFromHttpGetData() public function testReturnsTrueIfModeSetAsUnsubscribeFromHttpGetData() { - $mockReturnValue = $this->getMock('Result', array('toArray')); - $mockReturnValue->expects($this->any())->method('toArray')->will($this->returnValue(array( + $mockReturnValue = $this->getMock('Result', array('getArrayCopy')); + $mockReturnValue->expects($this->any())->method('getArrayCopy')->will($this->returnValue(array( 'verify_token' => hash('sha256', 'cba') ))); $this->_get['hub_mode'] = 'unsubscribe'; $this->_tableGateway->expects($this->any()) - ->method('find') - ->with($this->equalTo('verifytokenkey')) + ->method('select') + ->with($this->equalTo(array('id' => 'verifytokenkey'))) ->will($this->returnValue($this->_rowset)); $this->_rowset->expects($this->any()) ->method('current') @@ -267,8 +267,8 @@ public function testRespondsToValidConfirmationWith200Response() { $this->_get['hub_mode'] = 'unsubscribe'; $this->_tableGateway->expects($this->any()) - ->method('find') - ->with($this->equalTo('verifytokenkey')) + ->method('select') + ->with($this->equalTo(array('id' => 'verifytokenkey'))) ->will($this->returnValue($this->_rowset)); $t = new Date\Date; @@ -279,7 +279,8 @@ public function testRespondsToValidConfirmationWith200Response() 'lease_seconds' => 10000 ); - $row = new \Zend\Db\Table\Row(array('data' => $rowdata)); + $row = new \Zend\Db\ResultSet\Row; + $row->exchangeArray($rowdata); $this->_rowset->expects($this->any()) ->method('current') @@ -293,12 +294,8 @@ public function testRespondsToValidConfirmationWith200Response() ->method('update') ->with( $this->equalTo(array('id'=>'verifytokenkey','verify_token'=>hash('sha256', 'cba'),'created_time'=>$t->get(Date\Date::TIMESTAMP),'lease_seconds'=>1234567,'subscription_state'=>'verified','expiration_time'=>$t->add(1234567,Date\Date::SECOND)->get('yyyy-MM-dd HH:mm:ss'))), - $this->equalTo('id = \'verifytokenkey\'') + $this->equalTo(array('id' => 'verifytokenkey')) ); - $this->_adapter->expects($this->once()) - ->method('quoteInto') - ->with($this->equalTo('id = ?'), $this->equalTo('verifytokenkey')) - ->will($this->returnValue('id = \'verifytokenkey\'')); $this->_callback->handle($this->_get); $this->assertTrue($this->_callback->getHttpResponse()->getHttpResponseCode() == 200); @@ -307,8 +304,8 @@ public function testRespondsToValidConfirmationWith200Response() public function testRespondsToValidConfirmationWithBodyContainingHubChallenge() { $this->_tableGateway->expects($this->any()) - ->method('find') - ->with($this->equalTo('verifytokenkey')) + ->method('select') + ->with($this->equalTo(array('id' => 'verifytokenkey'))) ->will($this->returnValue($this->_rowset)); $t = new Date\Date; @@ -319,7 +316,8 @@ public function testRespondsToValidConfirmationWithBodyContainingHubChallenge() 'lease_seconds' => 10000 ); - $row = new \Zend\Db\Table\Row(array('data' => $rowdata)); + $row = new \Zend\Db\ResultSet\Row; + $row->exchangeArray($rowdata); $this->_rowset->expects($this->any()) ->method('current') @@ -333,12 +331,9 @@ public function testRespondsToValidConfirmationWithBodyContainingHubChallenge() ->method('update') ->with( $this->equalTo(array('id'=>'verifytokenkey','verify_token'=>hash('sha256', 'cba'),'created_time'=>$t->get(Date\Date::TIMESTAMP),'lease_seconds'=>1234567,'subscription_state'=>'verified','expiration_time'=>$t->add(1234567,Date\Date::SECOND)->get('yyyy-MM-dd HH:mm:ss'))), - $this->equalTo('id = \'verifytokenkey\'') + $this->equalTo(array('id' => 'verifytokenkey')) ); - $this->_adapter->expects($this->once()) - ->method('quoteInto') - ->with($this->equalTo('id = ?'), $this->equalTo('verifytokenkey')) - ->will($this->returnValue('id = \'verifytokenkey\'')); + $this->_callback->handle($this->_get); $this->assertTrue($this->_callback->getHttpResponse()->getBody() == 'abc'); } @@ -352,8 +347,8 @@ public function testRespondsToValidFeedUpdateRequestWith200Response() $GLOBALS['HTTP_RAW_POST_DATA'] = $feedXml; // dirty alternative to php://input $this->_tableGateway->expects($this->any()) - ->method('find') - ->with($this->equalTo('verifytokenkey')) + ->method('select') + ->with($this->equalTo(array('id' => 'verifytokenkey'))) ->will($this->returnValue($this->_rowset)); $t = new Date\Date; @@ -363,7 +358,7 @@ public function testRespondsToValidFeedUpdateRequestWith200Response() 'created_time' => time() ); - $row = new \Zend\Db\Table\Row(array('data' => $rowdata)); + $row = new \Zend\Db\ResultSet\Row(array('data' => $rowdata)); $this->_rowset->expects($this->any()) ->method('current') @@ -415,8 +410,8 @@ public function testRespondsToInvalidFeedUpdateWrongFeedTypeForMimeWith200Respon $GLOBALS['HTTP_RAW_POST_DATA'] = $feedXml; $this->_tableGateway->expects($this->any()) - ->method('find') - ->with($this->equalTo('verifytokenkey')) + ->method('select') + ->with($this->equalTo(array('id' => 'verifytokenkey'))) ->will($this->returnValue($this->_rowset)); $rowdata = array( @@ -426,7 +421,7 @@ public function testRespondsToInvalidFeedUpdateWrongFeedTypeForMimeWith200Respon 'lease_seconds' => 10000 ); - $row = new \Zend\Db\Table\Row(array('data' => $rowdata)); + $row = new \Zend\Db\ResultSet\Row(array('data' => $rowdata)); $this->_rowset->expects($this->any()) ->method('current') @@ -449,8 +444,8 @@ public function testRespondsToValidFeedUpdateWithXHubOnBehalfOfHeader() $GLOBALS['HTTP_RAW_POST_DATA'] = $feedXml; $this->_tableGateway->expects($this->any()) - ->method('find') - ->with($this->equalTo('verifytokenkey')) + ->method('select') + ->with($this->equalTo(array('id' => 'verifytokenkey'))) ->will($this->returnValue($this->_rowset)); $rowdata = array( @@ -460,7 +455,7 @@ public function testRespondsToValidFeedUpdateWithXHubOnBehalfOfHeader() 'lease_seconds' => 10000 ); - $row = new \Zend\Db\Table\Row(array('data' => $rowdata)); + $row = new \Zend\Db\ResultSet\Row(array('data' => $rowdata)); $this->_rowset->expects($this->any()) ->method('current') diff --git a/test/PubSubHubbub/SubscriberHttpTest.php b/test/PubSubHubbub/SubscriberHttpTest.php index d8648315..797bd035 100644 --- a/test/PubSubHubbub/SubscriberHttpTest.php +++ b/test/PubSubHubbub/SubscriberHttpTest.php @@ -14,7 +14,7 @@ * * @category Zend * @package UnitTests - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -37,7 +37,7 @@ * @subpackage UnitTests * @group Zend_Feed * @group Zend_Feed_Subsubhubbub - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class SubscriberHttpTest extends \PHPUnit_Framework_TestCase diff --git a/test/PubSubHubbub/SubscriberTest.php b/test/PubSubHubbub/SubscriberTest.php index 50b3a817..484ad86c 100644 --- a/test/PubSubHubbub/SubscriberTest.php +++ b/test/PubSubHubbub/SubscriberTest.php @@ -14,7 +14,7 @@ * * @category Zend * @package UnitTests - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -34,7 +34,7 @@ * @subpackage UnitTests * @group Zend_Feed * @group Zend_Feed_Subsubhubbub - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class SubscriberTest extends \PHPUnit_Framework_TestCase @@ -52,10 +52,10 @@ public function setUp() PubSubHubbub\PubSubHubbub::setHttpClient($client); $this->_subscriber = new \Zend\Feed\PubSubHubbub\Subscriber; $this->_adapter = $this->_getCleanMock( - '\Zend\Db\Adapter\AbstractAdapter' + '\Zend\Db\Adapter\Adapter' ); $this->_tableGateway = $this->_getCleanMock( - '\Zend\Db\Table\AbstractTable' + '\Zend\Db\TableGateway\TableGateway' ); $this->_tableGateway->expects($this->any())->method('getAdapter') ->will($this->returnValue($this->_adapter)); @@ -323,7 +323,7 @@ public function testPreferredVerificationModeDefaultsToSync() public function testCanSetStorageImplementation() { - $storage = new \Zend\Feed\PubSubHubbub\Model\Subscription($this->_tableGateway); + $storage = new \Zend\Feed\PubSubHubbub\Model\Subscription($this->_tableGateway); $this->_subscriber->setStorage($storage); $this->assertThat($this->_subscriber->getStorage(), $this->identicalTo($storage)); } diff --git a/test/Reader/Entry/AtomStandaloneEntryTest.php b/test/Reader/Entry/AtomStandaloneEntryTest.php index b3a1ef0a..8b863ade 100644 --- a/test/Reader/Entry/AtomStandaloneEntryTest.php +++ b/test/Reader/Entry/AtomStandaloneEntryTest.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Feed * @subpackage UnitTests - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -30,7 +30,7 @@ * @category Zend * @package Zend_Feed * @subpackage UnitTests -* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) +* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Feed * @group Zend_Feed_Reader diff --git a/test/Reader/Entry/AtomTest.php b/test/Reader/Entry/AtomTest.php index 71adb375..6fab6bfb 100644 --- a/test/Reader/Entry/AtomTest.php +++ b/test/Reader/Entry/AtomTest.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Feed * @subpackage UnitTests - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -30,7 +30,7 @@ * @category Zend * @package Zend_Feed * @subpackage UnitTests -* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) +* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Feed * @group Zend_Feed_Reader diff --git a/test/Reader/Entry/CommonTest.php b/test/Reader/Entry/CommonTest.php index 95565e45..d362b02f 100644 --- a/test/Reader/Entry/CommonTest.php +++ b/test/Reader/Entry/CommonTest.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Feed * @subpackage UnitTests - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -30,7 +30,7 @@ * @category Zend * @package Zend_Feed * @subpackage UnitTests -* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) +* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Feed * @group Zend_Feed_Reader diff --git a/test/Reader/Entry/RssTest.php b/test/Reader/Entry/RssTest.php index 07cf2685..98532553 100644 --- a/test/Reader/Entry/RssTest.php +++ b/test/Reader/Entry/RssTest.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Feed * @subpackage UnitTests - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -30,7 +30,7 @@ * @category Zend * @package Zend_Feed * @subpackage UnitTests - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Feed * @group Zend_Feed_Reader diff --git a/test/Reader/Feed/AtomSourceTest.php b/test/Reader/Feed/AtomSourceTest.php index fcaab14b..5b492bdd 100644 --- a/test/Reader/Feed/AtomSourceTest.php +++ b/test/Reader/Feed/AtomSourceTest.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Feed * @subpackage UnitTests - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -30,7 +30,7 @@ * @category Zend * @package Zend_Feed * @subpackage UnitTests -* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) +* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Feed * @group Zend_Feed_Reader diff --git a/test/Reader/Feed/AtomTest.php b/test/Reader/Feed/AtomTest.php index b2313a38..d8b75b95 100644 --- a/test/Reader/Feed/AtomTest.php +++ b/test/Reader/Feed/AtomTest.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Feed * @subpackage UnitTests - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -30,7 +30,7 @@ * @category Zend * @package Zend_Feed * @subpackage UnitTests -* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) +* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Feed * @group Zend_Feed_Reader diff --git a/test/Reader/Feed/CommonTest.php b/test/Reader/Feed/CommonTest.php index c8466c71..49469748 100644 --- a/test/Reader/Feed/CommonTest.php +++ b/test/Reader/Feed/CommonTest.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Feed * @subpackage UnitTests - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -29,7 +29,7 @@ * @category Zend * @package Zend_Feed * @subpackage UnitTests -* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) +* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Feed * @group Reader\Reader diff --git a/test/Reader/Feed/RssTest.php b/test/Reader/Feed/RssTest.php index e763a42a..1a129eea 100644 --- a/test/Reader/Feed/RssTest.php +++ b/test/Reader/Feed/RssTest.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Feed * @subpackage UnitTests - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -30,7 +30,7 @@ * @category Zend * @package Zend_Feed * @subpackage UnitTests -* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) +* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Feed * @group Zend_Feed_Reader diff --git a/test/Reader/Integration/H-OnlineComAtom10Test.php b/test/Reader/Integration/H-OnlineComAtom10Test.php index 7c70ff1f..67d1c74f 100644 --- a/test/Reader/Integration/H-OnlineComAtom10Test.php +++ b/test/Reader/Integration/H-OnlineComAtom10Test.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Feed * @subpackage UnitTests - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -30,7 +30,7 @@ * @category Zend * @package Zend_Feed * @subpackage UnitTests -* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) +* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Feed * @group Zend_Feed_Reader diff --git a/test/Reader/Integration/LautDeRdfTest.php b/test/Reader/Integration/LautDeRdfTest.php index 7cb4b767..dfc33453 100644 --- a/test/Reader/Integration/LautDeRdfTest.php +++ b/test/Reader/Integration/LautDeRdfTest.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Feed * @subpackage UnitTests - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -30,7 +30,7 @@ * @category Zend * @package Zend_Feed * @subpackage UnitTests -* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) +* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Feed * @group Zend_Feed_Reader diff --git a/test/Reader/Integration/PodcastRss2Test.php b/test/Reader/Integration/PodcastRss2Test.php index c642628b..8d9856ab 100644 --- a/test/Reader/Integration/PodcastRss2Test.php +++ b/test/Reader/Integration/PodcastRss2Test.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Feed * @subpackage UnitTests - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -30,7 +30,7 @@ * @category Zend * @package Zend_Feed * @subpackage UnitTests -* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) +* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Feed * @group Zend_Feed_Reader diff --git a/test/Reader/Integration/WordpressAtom10Test.php b/test/Reader/Integration/WordpressAtom10Test.php index 8d2b2e9b..0867b581 100644 --- a/test/Reader/Integration/WordpressAtom10Test.php +++ b/test/Reader/Integration/WordpressAtom10Test.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Feed * @subpackage UnitTests - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -30,7 +30,7 @@ * @category Zend * @package Zend_Feed * @subpackage UnitTests -* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) +* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Feed * @group Zend_Feed_Reader diff --git a/test/Reader/Integration/WordpressRss2DcAtomTest.php b/test/Reader/Integration/WordpressRss2DcAtomTest.php index 02a54361..57e1f689 100644 --- a/test/Reader/Integration/WordpressRss2DcAtomTest.php +++ b/test/Reader/Integration/WordpressRss2DcAtomTest.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Feed * @subpackage UnitTests - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -29,7 +29,7 @@ * @category Zend * @package Zend_Feed * @subpackage UnitTests -* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) +* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Feed * @group Zend_Feed_Reader diff --git a/test/Reader/ReaderTest.php b/test/Reader/ReaderTest.php index 91de4f10..f70e8d46 100644 --- a/test/Reader/ReaderTest.php +++ b/test/Reader/ReaderTest.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Feed * @subpackage UnitTests - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -29,7 +29,7 @@ * @category Zend * @package Zend_Feed * @subpackage UnitTests -* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) +* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Feed * @group Zend_Feed_Reader @@ -315,7 +315,7 @@ public function testAddsPrefixPath() public function testRegistersUserExtension() { try { - Reader\Reader::addPrefixPath('My\\FeedReader\\Extension', dirname(__FILE__) . '/_files/My/Extension'); + Reader\Reader::addPrefixPath('My\\Extension', dirname(__FILE__) . '/_files/My/Extension'); Reader\Reader::registerExtension('JungleBooks'); } catch(\Exception $e) { $this->fail($e->getMessage()); diff --git a/test/Reader/_files/My/Extension/JungleBooks/Entry.php b/test/Reader/_files/My/Extension/JungleBooks/Entry.php index 8e7d02af..799683be 100644 --- a/test/Reader/_files/My/Extension/JungleBooks/Entry.php +++ b/test/Reader/_files/My/Extension/JungleBooks/Entry.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Feed * @subpackage UnitTests - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -29,7 +29,7 @@ * @category Zend * @package Zend_Feed * @subpackage UnitTests - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Entry extends Extension\AbstractEntry diff --git a/test/Reader/_files/My/Extension/JungleBooks/Feed.php b/test/Reader/_files/My/Extension/JungleBooks/Feed.php index 8fc9d0a8..991db4f1 100644 --- a/test/Reader/_files/My/Extension/JungleBooks/Feed.php +++ b/test/Reader/_files/My/Extension/JungleBooks/Feed.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Feed * @subpackage UnitTests - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -29,7 +29,7 @@ * @category Zend * @package Zend_Feed * @subpackage UnitTests - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Feed extends Extension\AbstractFeed diff --git a/test/ReaderTest.php b/test/ReaderTest.php index dc9897ec..79263e49 100644 --- a/test/ReaderTest.php +++ b/test/ReaderTest.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Feed * @subpackage UnitTests - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -29,7 +29,7 @@ * @category Zend * @package Zend_Feed * @subpackage UnitTests - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @group Zend_Feed * @group Zend_Feed_Reader @@ -289,8 +289,12 @@ public function testGetsFeedLinksAndNormalisesRelativeUrlsOnUriWithPath() try { $currClient = Reader\Reader::getHttpClient(); + $response = new \Zend\Http\Response; + $response->setContent(''); + $response->setStatusCode(200); + $testAdapter = new \Zend\Http\Client\Adapter\Test(); - $testAdapter->setResponse(new \Zend\Http\Response(200, array(), '')); + $testAdapter->setResponse($response); Reader\Reader::setHttpClient(new \Zend\Http\Client(null, array('adapter' => $testAdapter))); $links = Reader\Reader::findFeedLinks('http://foo/bar'); diff --git a/test/Writer/DeletedTest.php b/test/Writer/DeletedTest.php index 3ad7fe16..c780b1d3 100644 --- a/test/Writer/DeletedTest.php +++ b/test/Writer/DeletedTest.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Feed * @subpackage UnitTests - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -32,7 +32,7 @@ * @subpackage UnitTests * @group Zend_Feed * @group Zend_Feed_Writer -* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) +* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class DeletedTest extends \PHPUnit_Framework_TestCase @@ -76,7 +76,29 @@ public function testSetWhenUsesGivenUnixTimestamp() $myDate = new Date\Date('1234567890', Date\Date::TIMESTAMP); $this->assertTrue($myDate->equals($entry->getWhen())); } + + /** + * @group ZF-12070 + */ + public function testSetWhenUsesGivenUnixTimestampWhenItIsLessThanTenDigits() + { + $entry = new Writer\Deleted; + $entry->setWhen(123456789); + $myDate = new Date\Date('123456789', Date\Date::TIMESTAMP); + $this->assertTrue($myDate->equals($entry->getWhen())); + } + /** + * @group ZF-11610 + */ + public function testSetWhenUsesGivenUnixTimestampWhenItIsAVerySmallInteger() + { + $entry = new Writer\Deleted; + $entry->setWhen(123); + $myDate = new Date\Date('123', Date\Date::TIMESTAMP); + $this->assertTrue($myDate->equals($entry->getWhen())); + } + public function testSetWhenUsesZendDateObject() { $entry = new Writer\Deleted; diff --git a/test/Writer/EntryTest.php b/test/Writer/EntryTest.php index bb6ca517..dfb5a1d0 100644 --- a/test/Writer/EntryTest.php +++ b/test/Writer/EntryTest.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Feed * @subpackage UnitTests - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -32,7 +32,7 @@ * @subpackage UnitTests * @group Zend_Feed * @group Zend_Feed_Writer -* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) +* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class EntryTest extends \PHPUnit_Framework_TestCase @@ -266,6 +266,28 @@ public function testSetDateCreatedUsesGivenUnixTimestamp() $this->assertTrue($myDate->equals($entry->getDateCreated())); } + /** + * @group ZF-12070 + */ + public function testSetDateCreatedUsesGivenUnixTimestampWhenItIsLessThanTenDigits() + { + $entry = new Writer\Entry; + $entry->setDateCreated(123456789); + $myDate = new Date\Date('123456789', Date\Date::TIMESTAMP); + $this->assertTrue($myDate->equals($entry->getDateCreated())); + } + + /** + * @group ZF-11610 + */ + public function testSetDateCreatedUsesGivenUnixTimestampWhenItIsAVerySmallInteger() + { + $entry = new Writer\Entry; + $entry->setDateCreated(123); + $myDate = new Date\Date('123', Date\Date::TIMESTAMP); + $this->assertTrue($myDate->equals($entry->getDateCreated())); + } + public function testSetDateCreatedUsesZendDateObject() { $entry = new Writer\Entry; @@ -290,6 +312,28 @@ public function testSetDateModifiedUsesGivenUnixTimestamp() $this->assertTrue($myDate->equals($entry->getDateModified())); } + /** + * @group ZF-12070 + */ + public function testSetDateModifiedUsesGivenUnixTimestampWhenItIsLessThanTenDigits() + { + $entry = new Writer\Entry; + $entry->setDateModified(123456789); + $myDate = new Date\Date('123456789', Date\Date::TIMESTAMP); + $this->assertTrue($myDate->equals($entry->getDateModified())); + } + + /** + * @group ZF-11610 + */ + public function testSetDateModifiedUsesGivenUnixTimestampWhenItIsAVerySmallInteger() + { + $entry = new Writer\Entry; + $entry->setDateModified(123); + $myDate = new Date\Date('123', Date\Date::TIMESTAMP); + $this->assertTrue($myDate->equals($entry->getDateModified())); + } + public function testSetDateModifiedUsesZendDateObject() { $entry = new Writer\Entry; diff --git a/test/Writer/Extension/ITunes/EntryTest.php b/test/Writer/Extension/ITunes/EntryTest.php index 4d216ba7..8c7a1180 100644 --- a/test/Writer/Extension/ITunes/EntryTest.php +++ b/test/Writer/Extension/ITunes/EntryTest.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Feed * @subpackage UnitTests - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -31,7 +31,7 @@ * @subpackage UnitTests * @group Zend_Feed * @group Zend_Feed_Writer -* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) +* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class EntryTest extends \PHPUnit_Framework_TestCase diff --git a/test/Writer/Extension/ITunes/FeedTest.php b/test/Writer/Extension/ITunes/FeedTest.php index 715cc386..811e2af2 100644 --- a/test/Writer/Extension/ITunes/FeedTest.php +++ b/test/Writer/Extension/ITunes/FeedTest.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Json * @subpackage UnitTests - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -31,7 +31,7 @@ * @subpackage UnitTests * @group Zend_Feed * @group Zend_Feed_Writer -* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) +* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class FeedTest extends \PHPUnit_Framework_TestCase diff --git a/test/Writer/FeedTest.php b/test/Writer/FeedTest.php index e4b7f64a..b64a510f 100644 --- a/test/Writer/FeedTest.php +++ b/test/Writer/FeedTest.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Feed * @subpackage UnitTests - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -33,7 +33,7 @@ * @subpackage UnitTests * @group Zend_Feed * @group Zend_Feed_Writer -* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) +* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class FeedTest extends \PHPUnit_Framework_TestCase @@ -203,6 +203,28 @@ public function testSetDateCreatedUsesGivenUnixTimestamp() $this->assertTrue($myDate->equals($writer->getDateCreated())); } + /** + * @group ZF-12023 + */ + public function testSetDateCreatedUsesGivenUnixTimestampThatIsLessThanTenDigits() + { + $writer = new Writer\Feed; + $writer->setDateCreated(123456789); + $myDate = new Date\Date('123456789', Date\Date::TIMESTAMP); + $this->assertTrue($myDate->equals($writer->getDateCreated())); + } + + /** + * @group ZF-11610 + */ + public function testSetDateCreatedUsesGivenUnixTimestampThatIsAVerySmallInteger() + { + $writer = new Writer\Feed; + $writer->setDateCreated(123); + $myDate = new Date\Date('123', Date\Date::TIMESTAMP); + $this->assertTrue($myDate->equals($writer->getDateCreated())); + } + public function testSetDateCreatedUsesZendDateObject() { $writer = new Writer\Feed; @@ -226,7 +248,29 @@ public function testSetDateModifiedUsesGivenUnixTimestamp() $myDate = new Date\Date('1234567890', Date\Date::TIMESTAMP); $this->assertTrue($myDate->equals($writer->getDateModified())); } + + /** + * @group ZF-12023 + */ + public function testSetDateModifiedUsesGivenUnixTimestampThatIsLessThanTenDigits() + { + $writer = new Writer\Feed; + $writer->setDateModified(123456789); + $myDate = new Date\Date('123456789', Date\Date::TIMESTAMP); + $this->assertTrue($myDate->equals($writer->getDateModified())); + } + /** + * @group ZF-11610 + */ + public function testSetDateModifiedUsesGivenUnixTimestampThatIsAVerySmallInteger() + { + $writer = new Writer\Feed; + $writer->setDateModified(123); + $myDate = new Date\Date('123', Date\Date::TIMESTAMP); + $this->assertTrue($myDate->equals($writer->getDateModified())); + } + public function testSetDateModifiedUsesZendDateObject() { $writer = new Writer\Feed; @@ -283,6 +327,28 @@ public function testSetLastBuildDateUsesGivenUnixTimestamp() $this->assertTrue($myDate->equals($writer->getLastBuildDate())); } + /** + * @group ZF-12023 + */ + public function testSetLastBuildDateUsesGivenUnixTimestampThatIsLessThanTenDigits() + { + $writer = new Writer\Feed; + $writer->setLastBuildDate(123456789); + $myDate = new Date\Date('123456789', Date\Date::TIMESTAMP); + $this->assertTrue($myDate->equals($writer->getLastBuildDate())); + } + + /** + * @group ZF-11610 + */ + public function testSetLastBuildDateUsesGivenUnixTimestampThatIsAVerySmallInteger() + { + $writer = new Writer\Feed; + $writer->setLastBuildDate(123); + $myDate = new Date\Date('123', Date\Date::TIMESTAMP); + $this->assertTrue($myDate->equals($writer->getLastBuildDate())); + } + public function testSetLastBuildDateUsesZendDateObject() { $writer = new Writer\Feed; diff --git a/test/Writer/Renderer/Entry/AtomTest.php b/test/Writer/Renderer/Entry/AtomTest.php index a19bb1f6..678ccbd9 100644 --- a/test/Writer/Renderer/Entry/AtomTest.php +++ b/test/Writer/Renderer/Entry/AtomTest.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Feed * @subpackage UnitTests - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -34,7 +34,7 @@ * @subpackage UnitTests * @group Zend_Feed * @group Zend_Feed_Writer -* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) +* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class AtomTest extends \PHPUnit_Framework_TestCase diff --git a/test/Writer/Renderer/Entry/RssTest.php b/test/Writer/Renderer/Entry/RssTest.php index 25340994..4d04bce6 100644 --- a/test/Writer/Renderer/Entry/RssTest.php +++ b/test/Writer/Renderer/Entry/RssTest.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Feed * @subpackage UnitTests - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -34,7 +34,7 @@ * @subpackage UnitTests * @group Zend_Feed * @group Zend_Feed_Writer -* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) +* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class RssTest extends \PHPUnit_Framework_TestCase diff --git a/test/Writer/Renderer/Feed/AtomTest.php b/test/Writer/Renderer/Feed/AtomTest.php index ebd7f99a..73e06792 100644 --- a/test/Writer/Renderer/Feed/AtomTest.php +++ b/test/Writer/Renderer/Feed/AtomTest.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Feed * @subpackage UnitTests - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -34,7 +34,7 @@ * @subpackage UnitTests * @group Zend_Feed * @group Zend_Feed_Writer -* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) +* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class AtomTest extends \PHPUnit_Framework_TestCase diff --git a/test/Writer/Renderer/Feed/RssTest.php b/test/Writer/Renderer/Feed/RssTest.php index 94424c98..09d7b389 100644 --- a/test/Writer/Renderer/Feed/RssTest.php +++ b/test/Writer/Renderer/Feed/RssTest.php @@ -15,7 +15,7 @@ * @category Zend * @package Zend_Feed * @subpackage UnitTests - * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ @@ -34,7 +34,7 @@ * @subpackage UnitTests * @group Zend_Feed * @group Zend_Feed_Writer -* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) +* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class RssTest extends \PHPUnit_Framework_TestCase