示例#1
0
 public function testGetEntryExceptionInvalidLocationType()
 {
     $gdata = new GData();
     try {
         // give it neither a string nor a ZendGData\Query object,
         // and see if it throws an exception.
         $feed = $gdata->getEntry(new \stdClass());
         $this->fail('Expecting to catch ZendGData\\App\\InvalidArgumentException');
     } catch (\Exception $e) {
         $this->assertInstanceOf('ZendGData\\App\\InvalidArgumentException', $e, 'Expecting ZendGData\\App\\InvalidArgumentException, got ' . get_class($e));
         $this->assertEquals('You must specify the location as either a string URI or a child of ZendGData\\Query', $e->getMessage());
     }
 }
示例#2
0
 public function testDisableAndReEnableXMLToObjectMappingReturnsObject()
 {
     $gdata = new GData();
     $gdata::useObjectMapping(false);
     $xmlString = $gdata->getEntry('http://gdata.youtube.com/feeds/api/videos/O4SWAfisH-8');
     $this->assertEquals('string', gettype($xmlString));
     $gdata::useObjectMapping(true);
     $entry = $gdata->getEntry('http://gdata.youtube.com/feeds/api/videos/O4SWAfisH-8');
     $this->assertTrue($entry instanceof Entry);
 }