Skip to content

Commit

Permalink
Zend\Service\SlideShare UT namespaced.
Browse files Browse the repository at this point in the history
Tests are not passing just yet, but classes has been moved to namespaces.
  • Loading branch information
farazdagi authored and weierophinney committed Jun 8, 2010
1 parent 4a7d0c6 commit e0b7da5
Showing 1 changed file with 19 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,16 @@


/**
* Test helper
* @namespace
*/
namespace ZendTest\Service\SlideShare;

use Zend\Service\SlideShare,
Zend\Service\SlideShare\SlideShare as SlideShareService,
Zend\Cache\Cache as Cache;

/**
* @see Zend_Service_SlideShare
* @see \Zend\Service\SlideShare
*/


Expand All @@ -39,29 +44,29 @@
* @group Zend_Service
* @group Zend_Service_SlideShare
*/
class Zend_Service_SlideShareTest extends PHPUnit_Framework_TestCase
class SlideShareTest extends \PHPUnit_Framework_TestCase
{
/**
* The Slide share object instance
*
* @var Zend_Service_SlideShare
* @var \Zend\Service\SlideShare
*/
protected static $_ss;

/**
* Enter description here...
*
* @return Zend_Service_SlideShare
* @return \Zend\Service\SlideShare
*/
protected function _getSSObject()
{
$ss = new Zend_Service_SlideShare(TESTS_ZEND_SERVICE_SLIDESHARE_APIKEY,
$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);

$cache = Zend_Cache::factory('Core', 'File', array('lifetime' => 0, 'automatic_serialization' => true),
$cache = Cache::factory('Core', 'File', array('lifetime' => 0, 'automatic_serialization' => true),
array('cache_dir' => dirname(__FILE__)."/SlideShare/_files"));
$ss->setCacheObject($cache);
return $ss;
Expand Down Expand Up @@ -99,7 +104,7 @@ public function testGetSlideShow()
$this->fail("Exception Caught retrieving Slideshow");
}

$this->assertTrue($result instanceof Zend_Service_SlideShare_SlideShow);
$this->assertTrue($result instanceof SlideShare\SlideShow);

}

Expand All @@ -116,7 +121,7 @@ public function testGetSlideShowByTag()

$this->assertTrue(is_array($results));
$this->assertTrue(count($results) == 1);
$this->assertTrue($results[0] instanceof Zend_Service_SlideShare_SlideShow);
$this->assertTrue($results[0] instanceof SlideShare\SlideShow);

}

Expand All @@ -135,7 +140,7 @@ public function testGetSlideShowByTags()

if(!empty($results)) {
$this->assertTrue(count($results) == 1);
$this->assertTrue($results[0] instanceof Zend_Service_SlideShare_SlideShow);
$this->assertTrue($results[0] instanceof SlideShare\SlideShow);
}
}

Expand All @@ -152,7 +157,7 @@ public function testGetSlideShowByUsername()

$this->assertTrue(is_array($results));
$this->assertTrue(count($results) == 1);
$this->assertTrue($results[0] instanceof Zend_Service_SlideShare_SlideShow);
$this->assertTrue($results[0] instanceof SlideShare\SlideShow);

}

Expand All @@ -163,7 +168,7 @@ public function testUploadSlideShow()
$title = "Unit Test for ZF SlideShare Component";
$ppt_file = dirname(__FILE__)."/SlideShare/_files/demo.ppt";

$show = new Zend_Service_SlideShare_SlideShow();
$show = new SlideShare\SlideShow();
$show->setFilename($ppt_file);
$show->setDescription("Unit Test");
$show->setTitle($title);
Expand All @@ -185,15 +190,15 @@ public function testUploadSlideShow()
}
}

$this->assertTrue($result instanceof Zend_Service_SlideShare_SlideShow);
$this->assertTrue($result instanceof SlideShare\SlideShow);
$this->assertTrue($result->getId() > 0);
$this->assertTrue($result->getTitle() === $title);

}

public function testSlideShowObj()
{
$ss = new Zend_Service_SlideShare_SlideShow();
$ss = new SlideShare\SlideShow();

$ss->setDescription("Foo");
$ss->setEmbedCode("Bar");
Expand Down

0 comments on commit e0b7da5

Please sign in to comment.