Skip to content
This repository has been archived by the owner on Dec 7, 2019. It is now read-only.

Commit

Permalink
Merge branch 'master' of github.com:drigani/ZendService_SlideShare in…
Browse files Browse the repository at this point in the history
…to drigani-master

Conflicts:
	composer.json
  • Loading branch information
coogle committed Nov 10, 2014
2 parents 0534608 + 26a88af commit 73c91db
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 15 deletions.
9 changes: 5 additions & 4 deletions composer.json
Expand Up @@ -23,10 +23,11 @@
],
"require": {
"php": ">=5.3.3",
"zendframework/zend-http": "~2.0",
"zendframework/zend-uri": "~2.0",
"zendframework/zend-version": "~2.0",
"zendframework/zendxml": "~1.0-dev"
"zendframework/zendxml" : "~1.0-dev",
"zendframework/zend-http": ">=2.0.0",
"zendframework/zend-uri": ">=2.0.0",
"zendframework/zend-version": ">=2.0.0",
"zendframework/zend-cache": ">=2.0.0"
},
"extra": {
"branch-alias": {
Expand Down
11 changes: 6 additions & 5 deletions library/ZendService/SlideShare/SlideShare.php
Expand Up @@ -335,9 +335,10 @@ public function uploadSlideShow(SlideShow $ss, $makeSourcePublic = true)
$request->setUri(self::SERVICE_UPLOAD_URI);
$request->getPost()->fromArray($params);
$request->setMethod(HttpRequest::METHOD_POST);
$request->getFile()->set('slideshow_srcfile', $filename);
$httpClient->setEncType(HttpClient::ENC_URLENCODED);

$httpClient->setRequest($request);
$httpClient->setFileUpload($filename, 'slideshow_srcfile');

try {
$response = $httpClient->send();
} catch(HttpException\ExceptionInterface $e) {
Expand Down Expand Up @@ -395,7 +396,7 @@ public function getSlideShow($ss_id)
$httpClient->setEncType(HttpClient::ENC_URLENCODED);

try {
$response = $httpClient->send();
$response = $httpClient->send($request);
} catch(HttpException\ExceptionInterface $e) {
throw new HttpException\RuntimeException("Service Request Failed: {$e->getMessage()}", 0, $e);
}
Expand Down Expand Up @@ -533,7 +534,7 @@ protected function getSlideShowsByType($key, $value, $offset = null, $limit = nu
$httpClient->setEncType(HttpClient::ENC_URLENCODED);

try {
$response = $httpClient->send();
$response = $httpClient->send($request);
} catch(HttpException\ExceptionInterface $e) {
throw new HttpException\RuntimeException("Service Request Failed: {$e->getMessage()}", 0, $e);
}
Expand Down Expand Up @@ -598,7 +599,7 @@ public function searchSlideShows($query)
$httpClient->setEncType(HttpClient::ENC_URLENCODED);

try {
$response = $httpClient->send();
$response = $httpClient->send($request);
} catch(HttpException\ExceptionInterface $e) {
throw new HttpException\RuntimeException("Service Request Failed: {$e->getMessage()}", 0, $e);
}
Expand Down
16 changes: 10 additions & 6 deletions tests/ZendService/SlideShare/SlideShareTest.php
Expand Up @@ -10,6 +10,7 @@

namespace ZendServiceTest\SlideShare;

use Zend\Http\Client as HttpClient;
use ZendService\SlideShare;
use ZendService\SlideShare\SlideShare as SlideShareService;
use Zend\Cache\StorageFactory as CacheFactory;
Expand Down Expand Up @@ -39,10 +40,14 @@ class SlideShareTest extends \PHPUnit_Framework_TestCase
protected function _getSSObject()
{
$ss = new SlideShareService(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);
TESTS_ZEND_SERVICE_SLIDESHARE_SHAREDSECRET,
TESTS_ZEND_SERVICE_SLIDESHARE_USERNAME,
TESTS_ZEND_SERVICE_SLIDESHARE_PASSWORD,
new HttpClient(null, array(
'maxredirects' => 2,
'timeout' => 5,
'sslverifypeer' => false
)));

$cache = CacheFactory::adapterFactory('memory', array('memory_limit' => 0));
$ss->setCacheObject($cache);
Expand Down Expand Up @@ -130,6 +135,7 @@ public function testGetSlideShowByUsername()
} catch(Exception $e) {
$this->fail("Exception Caught retrieving Slideshow List (tag)");
}


$this->assertTrue(is_array($results));
$this->assertTrue(count($results) == 1);
Expand Down Expand Up @@ -206,7 +212,6 @@ public function testSlideShowObj()
$ss->addTag('fon');
$ss->setThumbnailUrl('asdf');
$ss->setTitle('title');
$ss->setTranscript('none');

$this->assertEquals($ss->getDescription(), "Foo");
$this->assertEquals($ss->getEmbedCode(), "Bar");
Expand All @@ -220,7 +225,6 @@ public function testSlideShowObj()
$this->assertEquals($ss->getTags(), array('bar', 'baz', 'fon'));
$this->assertEquals($ss->getThumbnailUrl(), "asdf");
$this->assertEquals($ss->getTitle(), "title");
$this->assertEquals($ss->getTranscript(), "none");

}

Expand Down

1 comment on commit 73c91db

@necromant2005
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's an urgent critical patch. It must be a new release. Because current version v2.0.2 doesn't work at all without it.

Please sign in to comment.