Преглед изворни кода

Merge r25282 to 1.12 release branch

git-svn-id: http://framework.zend.com/svn/framework/standard/branches/release-1.12@25283 44c647ce-9c0f-0410-b52a-842ac1e357ba
frosch пре 13 година
родитељ
комит
981e5108d6

+ 131 - 89
library/Zend/Service/SlideShare.php

@@ -49,7 +49,6 @@ require_once 'Zend/Service/SlideShare/SlideShow.php';
  */
 class Zend_Service_SlideShare
 {
-
     /**
      * Web service result code mapping
      */
@@ -71,17 +70,17 @@ class Zend_Service_SlideShare
     /**
      * Slide share Web service communication URIs
      */
-    const SERVICE_UPLOAD_URI                  = 'http://www.slideshare.net/api/1/upload_slideshow';
-    const SERVICE_GET_SHOW_URI                = 'http://www.slideshare.net/api/1/get_slideshow';
-    const SERVICE_GET_SHOW_BY_USER_URI        = 'http://www.slideshare.net/api/1/get_slideshow_by_user';
-    const SERVICE_GET_SHOW_BY_TAG_URI         = 'http://www.slideshare.net/api/1/get_slideshow_by_tag';
-    const SERVICE_GET_SHOW_BY_GROUP_URI       = 'http://www.slideshare.net/api/1/get_slideshows_from_group';
+    const SERVICE_UPLOAD_URI            = 'https://www.slideshare.net/api/2/upload_slideshow';
+    const SERVICE_GET_SHOW_URI          = 'https://www.slideshare.net/api/2/get_slideshow';
+    const SERVICE_GET_SHOW_BY_USER_URI  = 'https://www.slideshare.net/api/2/get_slideshows_by_user';
+    const SERVICE_GET_SHOW_BY_TAG_URI   = 'https://www.slideshare.net/api/2/get_slideshows_by_tag';
+    const SERVICE_GET_SHOW_BY_GROUP_URI = 'https://www.slideshare.net/api/2/get_slideshows_by_group';
 
     /**
      * The MIME type of Slideshow files
      *
      */
-    const POWERPOINT_MIME_TYPE    = "application/vnd.ms-powerpoint";
+    const POWERPOINT_MIME_TYPE = "application/vnd.ms-powerpoint";
 
     /**
      * The API key to use in requests
@@ -147,15 +146,20 @@ class Zend_Service_SlideShare
     public function getHttpClient()
     {
 
-        if(!($this->_httpclient instanceof Zend_Http_Client)) {
+        if (!($this->_httpclient instanceof Zend_Http_Client)) {
             $client = new Zend_Http_Client();
-            $client->setConfig(array('maxredirects' => 2,
-                                     'timeout' => 5));
+            $client->setConfig(
+                array(
+                     'maxredirects' => 2,
+                     'timeout'      => 5
+                )
+            );
 
             $this->setHttpClient($client);
         }
 
         $this->_httpclient->resetParameters();
+
         return $this->_httpclient;
     }
 
@@ -181,10 +185,16 @@ class Zend_Service_SlideShare
     public function getCacheObject()
     {
 
-        if(!($this->_cacheobject instanceof Zend_Cache_Core)) {
-            $cache = Zend_Cache::factory('Core', 'File', array('lifetime' => 43200,
-                                                               'automatic_serialization' => true),
-                                                         array('cache_dir' => '/tmp'));
+        if (!($this->_cacheobject instanceof Zend_Cache_Core)) {
+            $cache = Zend_Cache::factory(
+                'Core',
+                'File',
+                array(
+                     'lifetime'                => 43200,
+                     'automatic_serialization' => true
+                ),
+                array('cache_dir' => '/tmp')
+            );
 
             $this->setCacheObject($cache);
         }
@@ -283,17 +293,19 @@ class Zend_Service_SlideShare
     /**
      * The Constructor
      *
-     * @param string $apikey The API key
+     * @param string $apikey       The API key
      * @param string $sharedSecret The shared secret
-     * @param string $username The username
-     * @param string $password The password
+     * @param string $username     The username
+     * @param string $password     The password
      */
-    public function __construct($apikey, $sharedSecret, $username = null, $password = null)
+    public function __construct(
+        $apikey, $sharedSecret, $username = null, $password = null
+    )
     {
         $this->setApiKey($apikey)
-             ->setSharedSecret($sharedSecret)
-             ->setUserName($username)
-             ->setPassword($password);
+            ->setSharedSecret($sharedSecret)
+            ->setUserName($username)
+            ->setPassword($password);
 
         $this->_httpclient = new Zend_Http_Client();
     }
@@ -301,41 +313,47 @@ class Zend_Service_SlideShare
     /**
      * Uploads the specified Slide show the the server
      *
-     * @param Zend_Service_SlideShare_SlideShow $ss The slide show object representing the slide show to upload
-     * @param boolean $make_src_public Determines if the the slide show's source file is public or not upon upload
+     * @param Zend_Service_SlideShare_SlideShow $ss            The slide show object representing the slide show to upload
+     * @param boolean                           $makeSrcPublic Determines if the the slide show's source file is public or not upon upload
      * @return Zend_Service_SlideShare_SlideShow The passed Slide show object, with the new assigned ID provided
+     * @throws Zend_Service_SlideShare_Exception
      */
-    public function uploadSlideShow(Zend_Service_SlideShare_SlideShow $ss, $make_src_public = true)
+    public function uploadSlideShow(
+        Zend_Service_SlideShare_SlideShow $ss, $makeSrcPublic = true
+    )
     {
-
         $timestamp = time();
 
-        $params = array('api_key' => $this->getApiKey(),
-                        'ts' => $timestamp,
-                        'hash' => sha1($this->getSharedSecret().$timestamp),
-                        'username' => $this->getUserName(),
-                        'password' => $this->getPassword(),
-                        'slideshow_title' => $ss->getTitle());
+        $params = array(
+            'api_key'         => $this->getApiKey(),
+            'ts'              => $timestamp,
+            'hash'            => sha1($this->getSharedSecret() . $timestamp),
+            'username'        => $this->getUserName(),
+            'password'        => $this->getPassword(),
+            'slideshow_title' => $ss->getTitle()
+        );
 
         $description = $ss->getDescription();
-        $tags = $ss->getTags();
+        $tags        = $ss->getTags();
 
         $filename = $ss->getFilename();
 
-        if(!file_exists($filename) || !is_readable($filename)) {
+        if (!file_exists($filename) || !is_readable($filename)) {
             require_once 'Zend/Service/SlideShare/Exception.php';
-            throw new Zend_Service_SlideShare_Exception("Specified Slideshow for upload not found or unreadable");
+            throw new Zend_Service_SlideShare_Exception(
+                'Specified Slideshow for upload not found or unreadable'
+            );
         }
 
-        if(!empty($description)) {
+        if (!empty($description)) {
             $params['slideshow_description'] = $description;
         } else {
             $params['slideshow_description'] = "";
         }
 
-        if(!empty($tags)) {
+        if (!empty($tags)) {
             $tmp = array();
-            foreach($tags as $tag) {
+            foreach ($tags as $tag) {
                 $tmp[] = "\"$tag\"";
             }
             $params['slideshow_tags'] = implode(' ', $tmp);
@@ -343,7 +361,6 @@ class Zend_Service_SlideShare
             $params['slideshow_tags'] = "";
         }
 
-
         $client = $this->getHttpClient();
         $client->setUri(self::SERVICE_UPLOAD_URI);
         $client->setParameterPost($params);
@@ -352,23 +369,29 @@ class Zend_Service_SlideShare
         require_once 'Zend/Http/Client/Exception.php';
         try {
             $response = $client->request('POST');
-        } catch(Zend_Http_Client_Exception $e) {
+        } catch (Zend_Http_Client_Exception $e) {
             require_once 'Zend/Service/SlideShare/Exception.php';
-            throw new Zend_Service_SlideShare_Exception("Service Request Failed: {$e->getMessage()}", 0, $e);
+            throw new Zend_Service_SlideShare_Exception(
+                "Service Request Failed: {$e->getMessage()}", 0, $e
+            );
         }
 
         $sxe = simplexml_load_string($response->getBody());
 
-        if($sxe->getName() == "SlideShareServiceError") {
+        if ($sxe->getName() == "SlideShareServiceError") {
             $message = (string)$sxe->Message[0];
             list($code, $error_str) = explode(':', $message);
             require_once 'Zend/Service/SlideShare/Exception.php';
-            throw new Zend_Service_SlideShare_Exception(trim($error_str), $code);
+            throw new Zend_Service_SlideShare_Exception(trim(
+                $error_str
+            ), $code);
         }
 
-        if(!$sxe->getName() == "SlideShowUploaded") {
+        if (!$sxe->getName() == "SlideShowUploaded") {
             require_once 'Zend/Service/SlideShare/Exception.php';
-            throw new Zend_Service_SlideShare_Exception("Unknown XML Respons Received");
+            throw new Zend_Service_SlideShare_Exception(
+                'Unknown XML Respons Received'
+            );
         }
 
         $ss->setId((int)(string)$sxe->SlideShowID);
@@ -381,21 +404,24 @@ class Zend_Service_SlideShare
      *
      * @param int $ss_id The slide show ID
      * @return Zend_Service_SlideShare_SlideShow the Slideshow object
+     * @throws Zend_Service_SlideShare_Exception
      */
     public function getSlideShow($ss_id)
     {
         $timestamp = time();
 
-        $params = array('api_key' => $this->getApiKey(),
-                        'ts' => $timestamp,
-                        'hash' => sha1($this->getSharedSecret().$timestamp),
-                        'slideshow_id' => $ss_id);
+        $params = array(
+            'api_key'      => $this->getApiKey(),
+            'ts'           => $timestamp,
+            'hash'         => sha1($this->getSharedSecret() . $timestamp),
+            'slideshow_id' => $ss_id
+        );
 
         $cache = $this->getCacheObject();
 
         $cache_key = md5("__zendslideshare_cache_$ss_id");
 
-        if(!$retval = $cache->load($cache_key)) {
+        if (!$retval = $cache->load($cache_key)) {
             $client = $this->getHttpClient();
 
             $client->setUri(self::SERVICE_GET_SHOW_URI);
@@ -404,26 +430,31 @@ class Zend_Service_SlideShare
             require_once 'Zend/Http/Client/Exception.php';
             try {
                 $response = $client->request('POST');
-            } catch(Zend_Http_Client_Exception $e) {
+            } catch (Zend_Http_Client_Exception $e) {
                 require_once 'Zend/Service/SlideShare/Exception.php';
-                throw new Zend_Service_SlideShare_Exception("Service Request Failed: {$e->getMessage()}", 0, $e);
+                throw new Zend_Service_SlideShare_Exception(
+                    "Service Request Failed: {$e->getMessage()}", 0, $e
+                );
             }
 
             $sxe = simplexml_load_string($response->getBody());
 
-            if($sxe->getName() == "SlideShareServiceError") {
+            if ($sxe->getName() == "SlideShareServiceError") {
                 $message = (string)$sxe->Message[0];
                 list($code, $error_str) = explode(':', $message);
                 require_once 'Zend/Service/SlideShare/Exception.php';
-                throw new Zend_Service_SlideShare_Exception(trim($error_str), $code);
+                throw new Zend_Service_SlideShare_Exception(trim(
+                    $error_str
+                ), $code);
             }
 
-            if(!$sxe->getName() == 'Slideshows') {
+            if (!($sxe->getName() == 'Slideshow')) {
                 require_once 'Zend/Service/SlideShare/Exception.php';
-                throw new Zend_Service_SlideShare_Exception('Unknown XML Repsonse Received');
+                throw new Zend_Service_SlideShare_Exception(
+                    'Unknown XML Repsonse Received'
+                );
             }
-
-            $retval = $this->_slideShowNodeToObject(clone $sxe->Slideshow[0]);
+            $retval = $this->_slideShowNodeToObject(clone $sxe);
 
             $cache->save($retval, $cache_key);
         }
@@ -439,9 +470,13 @@ class Zend_Service_SlideShare
      * @param int $limit The maximum number of slide shows to retrieve
      * @return array An array of Zend_Service_SlideShare_SlideShow objects
      */
-    public function getSlideShowsByUsername($username, $offset = null, $limit = null)
+    public function getSlideShowsByUsername(
+        $username, $offset = null, $limit = null
+    )
     {
-        return $this->_getSlideShowsByType('username_for', $username, $offset, $limit);
+        return $this->_getSlideShowsByType(
+            'username_for', $username, $offset, $limit
+        );
     }
 
     /**
@@ -455,9 +490,9 @@ class Zend_Service_SlideShare
     public function getSlideShowsByTag($tag, $offset = null, $limit = null)
     {
 
-        if(is_array($tag)) {
+        if (is_array($tag)) {
             $tmp = array();
-            foreach($tag as $t) {
+            foreach ($tag as $t) {
                 $tmp[] = "\"$t\"";
             }
 
@@ -484,33 +519,35 @@ class Zend_Service_SlideShare
      * Retrieves Zend_Service_SlideShare_SlideShow object arrays based on the type of
      * list desired
      *
-     * @param string $key The type of slide show object to retrieve
-     * @param string $value The specific search query for the slide show type to look up
-     * @param int $offset The offset of the list to start retrieving from
-     * @param int $limit The maximum number of slide shows to retrieve
+     * @param string $key    The type of slide show object to retrieve
+     * @param string $value  The specific search query for the slide show type to look up
+     * @param int    $offset The offset of the list to start retrieving from
+     * @param int    $limit  The maximum number of slide shows to retrieve
      * @return array An array of Zend_Service_SlideShare_SlideShow objects
+     * @throws Zend_Service_SlideShare_Exception
      */
     protected function _getSlideShowsByType($key, $value, $offset = null, $limit = null)
     {
-
         $key = strtolower($key);
 
-        switch($key) {
+        switch ($key) {
             case 'username_for':
                 $responseTag = 'User';
-                $queryUri = self::SERVICE_GET_SHOW_BY_USER_URI;
+                $queryUri    = self::SERVICE_GET_SHOW_BY_USER_URI;
                 break;
             case 'group_name':
                 $responseTag = 'Group';
-                $queryUri = self::SERVICE_GET_SHOW_BY_GROUP_URI;
+                $queryUri    = self::SERVICE_GET_SHOW_BY_GROUP_URI;
                 break;
             case 'tag':
                 $responseTag = 'Tag';
-                $queryUri = self::SERVICE_GET_SHOW_BY_TAG_URI;
+                $queryUri    = self::SERVICE_GET_SHOW_BY_TAG_URI;
                 break;
             default:
                 require_once 'Zend/Service/SlideShare/Exception.php';
-                throw new Zend_Service_SlideShare_Exception("Invalid SlideShare Query");
+                throw new Zend_Service_SlideShare_Exception(
+                    'Invalid SlideShare Query'
+                );
         }
 
         $timestamp = time();
@@ -520,11 +557,11 @@ class Zend_Service_SlideShare
                         'hash' => sha1($this->getSharedSecret().$timestamp),
                         $key => $value);
 
-        if($offset !== null) {
+        if ($offset !== null) {
             $params['offset'] = (int)$offset;
         }
 
-        if($limit !== null) {
+        if ($limit !== null) {
             $params['limit'] = (int)$limit;
         }
 
@@ -532,8 +569,7 @@ class Zend_Service_SlideShare
 
         $cache_key = md5($key.$value.$offset.$limit);
 
-        if(!$retval = $cache->load($cache_key)) {
-
+        if (!$retval = $cache->load($cache_key)) {
             $client = $this->getHttpClient();
 
             $client->setUri($queryUri);
@@ -542,29 +578,35 @@ class Zend_Service_SlideShare
             require_once 'Zend/Http/Client/Exception.php';
             try {
                 $response = $client->request('POST');
-            } catch(Zend_Http_Client_Exception $e) {
+            } catch (Zend_Http_Client_Exception $e) {
                 require_once 'Zend/Service/SlideShare/Exception.php';
-                throw new Zend_Service_SlideShare_Exception("Service Request Failed: {$e->getMessage()}", 0, $e);
+                throw new Zend_Service_SlideShare_Exception(
+                    "Service Request Failed: {$e->getMessage()}", 0, $e
+                );
             }
 
             $sxe = simplexml_load_string($response->getBody());
 
-            if($sxe->getName() == "SlideShareServiceError") {
+            if ($sxe->getName() == "SlideShareServiceError") {
                 $message = (string)$sxe->Message[0];
                 list($code, $error_str) = explode(':', $message);
                 require_once 'Zend/Service/SlideShare/Exception.php';
-                throw new Zend_Service_SlideShare_Exception(trim($error_str), $code);
+                throw new Zend_Service_SlideShare_Exception(
+                    trim($error_str), $code
+                );
             }
 
-            if(!$sxe->getName() == $responseTag) {
+            if (!$sxe->getName() == $responseTag) {
                 require_once 'Zend/Service/SlideShare/Exception.php';
-                throw new Zend_Service_SlideShare_Exception('Unknown or Invalid XML Repsonse Received');
+                throw new Zend_Service_SlideShare_Exception(
+                    'Unknown or Invalid XML Repsonse Received'
+                );
             }
 
             $retval = array();
 
-            foreach($sxe->children() as $node) {
-                if($node->getName() == 'Slideshow') {
+            foreach ($sxe->children() as $node) {
+                if ($node->getName() == 'Slideshow') {
                     $retval[] = $this->_slideShowNodeToObject($node);
                 }
             }
@@ -581,12 +623,12 @@ class Zend_Service_SlideShare
      *
      * @param SimpleXMLElement $node The input XML from the slideshare.net service
      * @return Zend_Service_SlideShare_SlideShow The resulting object
+     * @throws Zend_Service_SlideShare_Exception
      */
     protected function _slideShowNodeToObject(SimpleXMLElement $node)
     {
 
         if($node->getName() == 'Slideshow') {
-
             $ss = new Zend_Service_SlideShare_SlideShow();
 
             $ss->setId((string)$node->ID);
@@ -597,9 +639,8 @@ class Zend_Service_SlideShare
             $ss->setStatus((string)$node->Status);
             $ss->setStatusDescription((string)$node->StatusDescription);
 
-            foreach(explode(",", (string)$node->Tags) as $tag) {
-
-                if(!in_array($tag, $ss->getTags())) {
+            foreach (explode(",", (string)$node->Tags) as $tag) {
+                if (!in_array($tag, $ss->getTags())) {
                     $ss->addTag($tag);
                 }
             }
@@ -610,10 +651,11 @@ class Zend_Service_SlideShare
             $ss->setTranscript((string)$node->Transcript);
 
             return $ss;
-
         }
 
         require_once 'Zend/Service/SlideShare/Exception.php';
-        throw new Zend_Service_SlideShare_Exception("Was not provided the expected XML Node for processing");
+        throw new Zend_Service_SlideShare_Exception(
+            'Was not provided the expected XML Node for processing'
+        );
     }
 }

+ 1 - 2
library/Zend/Service/SlideShare/SlideShow.php

@@ -33,7 +33,6 @@
  */
 class Zend_Service_SlideShare_SlideShow
 {
-
     /**
      * Status constant mapping for web service
      *
@@ -328,7 +327,7 @@ class Zend_Service_SlideShare_SlideShow
     /**
      * Sets the description for the Slide show
      *
-     * @param strign $desc The description of the slide show
+     * @param string $desc The description of the slide show
      * @return Zend_Service_SlideShare_SlideShow
      */
     public function setDescription($desc)

+ 94 - 60
tests/Zend/Service/SlideShareTest.php

@@ -25,7 +25,6 @@
  */
 require_once 'Zend/Service/SlideShare.php';
 
-
 /**
  * @category   Zend
  * @package    Zend_Service_SlideShare
@@ -51,52 +50,64 @@ class Zend_Service_SlideShareTest extends PHPUnit_Framework_TestCase
      */
     protected function _getSSObject()
     {
-        $ss = new Zend_Service_SlideShare(TESTS_ZEND_SERVICE_SLIDESHARE_APIKEY,
-                                                 TESTS_ZEND_SERVICE_SLIDESHARE_SHAREDSECRET,
-                                                 TESTS_ZEND_SERVICE_SLIDESHARE_USERNAME,
-                                                 TESTS_ZEND_SERVICE_SLIDESHARE_PASSWORD,
-                                                 TESTS_ZEND_SERVICE_SLIDESHARE_SLIDESHOWID);
-
-        $cache = Zend_Cache::factory('Core', 'File', array('lifetime' => 0, 'automatic_serialization' => true),
-                                                     array('cache_dir' => dirname(__FILE__)."/SlideShare/_files"));
+        $ss = new Zend_Service_SlideShare(
+            TESTS_ZEND_SERVICE_SLIDESHARE_APIKEY,
+            TESTS_ZEND_SERVICE_SLIDESHARE_SHAREDSECRET,
+            TESTS_ZEND_SERVICE_SLIDESHARE_USERNAME,
+            TESTS_ZEND_SERVICE_SLIDESHARE_PASSWORD,
+            TESTS_ZEND_SERVICE_SLIDESHARE_SLIDESHOWID
+        );
+
+        $cache = Zend_Cache::factory(
+            'Core',
+            'File',
+            array(
+                 'lifetime'                => 0,
+                 'automatic_serialization' => true
+            ),
+            array('cache_dir' => dirname(__FILE__) . "/SlideShare/_files")
+        );
         $ss->setCacheObject($cache);
+
         return $ss;
     }
 
     public function setUp()
     {
-
-        if(!defined("TESTS_ZEND_SERVICE_SLIDESHARE_APIKEY") ||
-           !defined("TESTS_ZEND_SERVICE_SLIDESHARE_SHAREDSECRET") ||
-           !defined("TESTS_ZEND_SERVICE_SLIDESHARE_USERNAME") ||
-           !defined("TESTS_ZEND_SERVICE_SLIDESHARE_PASSWORD") ||
-           (TESTS_ZEND_SERVICE_SLIDESHARE_APIKEY == "") ||
-           (TESTS_ZEND_SERVICE_SLIDESHARE_SHAREDSECRET == "") ||
-           (TESTS_ZEND_SERVICE_SLIDESHARE_USERNAME == "") ||
-           (TESTS_ZEND_SERVICE_SLIDESHARE_PASSWORD == "")) {
-
-               $this->markTestSkipped("You must configure an account for slideshare to run these tests");
+        if (!defined("TESTS_ZEND_SERVICE_SLIDESHARE_APIKEY")
+            || !defined("TESTS_ZEND_SERVICE_SLIDESHARE_SHAREDSECRET")
+            || !defined("TESTS_ZEND_SERVICE_SLIDESHARE_USERNAME")
+            || !defined("TESTS_ZEND_SERVICE_SLIDESHARE_PASSWORD")
+            || (TESTS_ZEND_SERVICE_SLIDESHARE_APIKEY == "")
+            || (TESTS_ZEND_SERVICE_SLIDESHARE_SHAREDSECRET == "")
+            || (TESTS_ZEND_SERVICE_SLIDESHARE_USERNAME == "")
+            || (TESTS_ZEND_SERVICE_SLIDESHARE_PASSWORD == "")
+        ) {
+            $this->markTestSkipped(
+                "You must configure an account for slideshare to run these tests"
+            );
         }
     }
 
-
     public function testGetSlideShow()
     {
-
-        if(!defined("TESTS_ZEND_SERVICE_SLIDESHARE_SLIDESHOWID") ||
-           (TESTS_ZEND_SERVICE_SLIDESHARE_SLIDESHOWID <= 0)) {
-               $this->markTestSkipped("You must provide a Slideshow ID to retrieve to perform this test");
+        if (!defined("TESTS_ZEND_SERVICE_SLIDESHARE_SLIDESHOWID")
+            || (TESTS_ZEND_SERVICE_SLIDESHARE_SLIDESHOWID <= 0)
+        ) {
+            $this->markTestSkipped(
+                "You must provide a Slideshow ID to retrieve to perform this test"
+            );
         }
 
         $ss = $this->_getSSObject();
         try {
-            $result = $ss->getSlideShow(TESTS_ZEND_SERVICE_SLIDESHARE_SLIDESHOWID);
-        } catch(Exception $e) {
+            $result =
+                $ss->getSlideShow(TESTS_ZEND_SERVICE_SLIDESHARE_SLIDESHOWID);
+        } catch (Exception $e) {
             $this->fail("Exception Caught retrieving Slideshow");
         }
 
         $this->assertTrue($result instanceof Zend_Service_SlideShare_SlideShow);
-
     }
 
     public function testGetSlideShowByTag()
@@ -106,58 +117,67 @@ class Zend_Service_SlideShareTest extends PHPUnit_Framework_TestCase
 
         try {
             $results = $ss->getSlideShowsByTag('zend', 0, 1);
-        } catch(Exception $e) {
+        } catch (Exception $e) {
             $this->fail("Exception Caught retrieving Slideshow List (tag)");
         }
 
         $this->assertTrue(is_array($results));
         $this->assertTrue(count($results) == 1);
-        $this->assertTrue($results[0] instanceof Zend_Service_SlideShare_SlideShow);
-
+        $this->assertTrue(
+            $results[0] instanceof Zend_Service_SlideShare_SlideShow
+        );
     }
 
     public function testGetSlideShowByTags()
     {
-
         $ss = $this->_getSSObject();
 
         try {
-            $results = $ss->getSlideShowsByTag(array('zend', 'php'), 0, 1);
-        } catch(Exception $e) {
+            $results = $ss->getSlideShowsByTag(
+                array(
+                     'zend',
+                     'php'
+                ), 0, 1
+            );
+        } catch (Exception $e) {
             $this->fail("Exception Caught retrieving Slideshow List (tag)");
         }
 
         $this->assertTrue(is_array($results));
 
-        if(!empty($results)) {
+        if (!empty($results)) {
             $this->assertTrue(count($results) == 1);
-            $this->assertTrue($results[0] instanceof Zend_Service_SlideShare_SlideShow);
+            $this->assertTrue(
+                $results[0] instanceof Zend_Service_SlideShare_SlideShow
+            );
         }
     }
 
     public function testGetSlideShowByUsername()
     {
-
         $ss = $this->_getSSObject();
 
         try {
-            $results = $ss->getSlideShowsByUsername(TESTS_ZEND_SERVICE_SLIDESHARE_USERNAME, 0, 1);
-        } catch(Exception $e) {
+            $results = $ss->getSlideShowsByUsername(
+                TESTS_ZEND_SERVICE_SLIDESHARE_USERNAME, 0, 1
+            );
+        } catch (Exception $e) {
             $this->fail("Exception Caught retrieving Slideshow List (tag)");
         }
 
         $this->assertTrue(is_array($results));
         $this->assertTrue(count($results) == 1);
-        $this->assertTrue($results[0] instanceof Zend_Service_SlideShare_SlideShow);
-
+        $this->assertTrue(
+            $results[0] instanceof Zend_Service_SlideShare_SlideShow
+        );
     }
 
     public function testUploadSlideShow()
     {
         $ss = $this->_getSSObject();
 
-        $title = "Unit Test for ZF SlideShare Component";
-        $ppt_file = dirname(__FILE__)."/SlideShare/_files/demo.ppt";
+        $title    = "Unit Test for ZF SlideShare Component";
+        $ppt_file = dirname(__FILE__) . "/SlideShare/_files/demo.ppt";
 
         $show = new Zend_Service_SlideShare_SlideShow();
         $show->setFilename($ppt_file);
@@ -168,9 +188,11 @@ class Zend_Service_SlideShareTest extends PHPUnit_Framework_TestCase
 
         try {
             $result = $ss->uploadSlideShow($show, false);
-        } catch(Exception $e) {
+        } catch (Exception $e) {
 
-            if($e->getCode() == Zend_Service_SlideShare::SERVICE_ERROR_NOT_SOURCEOBJ) {
+            if ($e->getCode()
+                == Zend_Service_SlideShare::SERVICE_ERROR_NOT_SOURCEOBJ
+            ) {
                 // We ignore this exception, the web service sometimes throws this
                 // error code because it seems to be buggy. Unfortunately it seems
                 // to be sparatic so we can't code around it and have to call this
@@ -184,7 +206,6 @@ class Zend_Service_SlideShareTest extends PHPUnit_Framework_TestCase
         $this->assertTrue($result instanceof Zend_Service_SlideShare_SlideShow);
         $this->assertTrue($result->getId() > 0);
         $this->assertTrue($result->getTitle() === $title);
-
     }
 
     public function testSlideShowObj()
@@ -200,7 +221,12 @@ class Zend_Service_SlideShareTest extends PHPUnit_Framework_TestCase
         $ss->setPermaLink("nowhere");
         $ss->setStatus(124);
         $ss->setStatusDescription("Boo");
-        $ss->setTags(array('bar', 'baz'));
+        $ss->setTags(
+            array(
+                 'bar',
+                 'baz'
+            )
+        );
         $ss->addTag('fon');
         $ss->setThumbnailUrl('asdf');
         $ss->setTitle('title');
@@ -215,24 +241,32 @@ class Zend_Service_SlideShareTest extends PHPUnit_Framework_TestCase
         $this->assertEquals($ss->getPermaLink(), "nowhere");
         $this->assertEquals($ss->getStatus(), 124);
         $this->assertEquals($ss->getStatusDescription(), "Boo");
-        $this->assertEquals($ss->getTags(), array('bar', 'baz', 'fon'));
+        $this->assertEquals(
+            $ss->getTags(),
+            array(
+                 'bar',
+                 'baz',
+                 'fon'
+            )
+        );
         $this->assertEquals($ss->getThumbnailUrl(), "asdf");
         $this->assertEquals($ss->getTitle(), "title");
         $this->assertEquals($ss->getTranscript(), "none");
-
     }
 
     /**
-     * @group   ZF-3247
+     * @group ZF-3247
      */
-	public function testSlideShareObjectHandlesUnicodeCharactersWell()
-	{
-		$slideShow = new Zend_Service_SlideShare_SlideShow();
-		$slideShow->setTitle('Unicode test: ஸ்றீனிவாஸ ராமானுஜன் ஐயங்கார்');
-
-		if (!extension_loaded('mbstring')) {
-		    $this->markTestSkipped('Extension "mbstring" not loaded');
-		}
-        $this->assertEquals('UTF-8', mb_detect_encoding($slideShow->getTitle()));
-	}
+    public function testSlideShareObjectHandlesUnicodeCharactersWell()
+    {
+        $slideShow = new Zend_Service_SlideShare_SlideShow();
+        $slideShow->setTitle('Unicode test: ஸ்றீனிவாஸ ராமானுஜன் ஐயங்கார்');
+
+        if (!extension_loaded('mbstring')) {
+            $this->markTestSkipped('Extension "mbstring" not loaded');
+        }
+        $this->assertEquals(
+            'UTF-8', mb_detect_encoding($slideShow->getTitle())
+        );
+    }
 }