From 06f945f27840b53e57795dadbc38e76f7e11ab1c Mon Sep 17 00:00:00 2001 From: Horus3 Date: Mon, 24 Feb 2014 16:42:14 +0100 Subject: init --- zend/tests/Zend/Gdata/BooksOnlineTest.php | 108 ++++++++++++++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 zend/tests/Zend/Gdata/BooksOnlineTest.php (limited to 'zend/tests/Zend/Gdata/BooksOnlineTest.php') diff --git a/zend/tests/Zend/Gdata/BooksOnlineTest.php b/zend/tests/Zend/Gdata/BooksOnlineTest.php new file mode 100644 index 0000000..561b78a --- /dev/null +++ b/zend/tests/Zend/Gdata/BooksOnlineTest.php @@ -0,0 +1,108 @@ +gdata = new Zend_Gdata_Books($client); + } + + public function testGetVolumeFeed() + { + $query = $this->gdata->newVolumeQuery(); + $query->setQuery('Hamlet'); + $query->setStartIndex(5); + $query->setMaxResults(8); + $query->setMinViewability('partial_view'); + $feed = $this->gdata->getVolumeFeed($query); + + $this->assertTrue($feed instanceof Zend_Gdata_Books_VolumeFeed); + foreach ($feed->entries as $entry) { + $this->assertTrue($entry instanceof Zend_Gdata_Books_VolumeEntry); + $this->assertEquals($feed->getHttpClient(), $entry->getHttpClient()); + } + + $this->assertEquals(5, $feed->startIndex->text); + $this->assertEquals(8, $feed->itemsPerPage->text); + } + + public function testGetVolumetEntry() + { + $entry = $this->gdata->getVolumeEntry('Mfer_MFwQrkC'); + $this->assertTrue($entry instanceof Zend_Gdata_Books_VolumeEntry); + } + + public function testUserLibraryFeed() + { + $feed = $this->gdata->getUserLibraryFeed(); + $this->assertTrue($feed instanceof Zend_Gdata_Books_VolumeFeed); + foreach ($feed->entries as $entry) { + $this->assertTrue($entry instanceof Zend_Gdata_Books_VolumeEntry); + $this->assertEquals( + $feed->getHttpClient(), $entry->getHttpClient()); + } + + $entry = new Zend_Gdata_Books_VolumeEntry(); + $entry->setId(new Zend_Gdata_App_Extension_Id('Mfer_MFwQrkC')); + $newEntry = $this->gdata->insertVolume($entry); + $this->assertTrue($newEntry instanceof Zend_Gdata_Books_VolumeEntry); + $this->gdata->deleteVolume($newEntry); + } + + public function testUserAnnotationFeed() + { + $feed = $this->gdata->getUserAnnotationFeed(); + $this->assertTrue($feed instanceof Zend_Gdata_Books_VolumeFeed); + foreach ($feed->entries as $entry) { + $this->assertTrue($entry instanceof Zend_Gdata_Books_VolumeEntry); + $this->assertEquals( + $feed->getHttpClient(), $entry->getHttpClient()); + } + + $entry = new Zend_Gdata_Books_VolumeEntry(); + $entry->setId(new Zend_Gdata_App_Extension_Id('Mfer_MFwQrkC')); + $entry->setRating(new Zend_Gdata_Extension_Rating(3, 1, 5, 1)); + $newEntry = $this->gdata->insertVolume($entry, + Zend_Gdata_Books::MY_ANNOTATION_FEED_URI); + $this->assertTrue($newEntry instanceof Zend_Gdata_Books_VolumeEntry); + $this->gdata->deleteVolume($newEntry); + } +} -- cgit v1.2.3