gdata = new Zend_Gdata_Gapps(null, self::TEST_DOMAIN); } public function testMagicFactoryProvidesQueriesWithDomains() { $userQ = $this->gdata->newUserQuery(); $this->assertTrue($userQ instanceof Zend_Gdata_Gapps_UserQuery); $this->assertEquals(self::TEST_DOMAIN, $userQ->getDomain()); $this->assertEquals(null, $userQ->getUsername()); $userQ = $this->gdata->newUserQuery('foo'); $this->assertTrue($userQ instanceof Zend_Gdata_Gapps_UserQuery); $this->assertEquals(self::TEST_DOMAIN, $userQ->getDomain()); $this->assertEquals('foo', $userQ->getUsername()); } public function testMagicFactoryLeavesNonQueriesAlone() { $login = $this->gdata->newLogin('blah'); $this->assertTrue($login instanceof Zend_Gdata_Gapps_Extension_Login); $this->assertEquals('blah', $login->username); } public function testEmptyResponseExceptionRaisesException() { require_once('Zend/Gdata/App/HttpException.php'); $e = new Zend_Gdata_App_HttpException(); $e->setResponse(null); $success = false; try { $this->gdata->throwServiceExceptionIfDetected($e); } catch (Zend_Gdata_App_IOException $f) { $success = true; } $this->assertTrue($success, 'Zend_Gdata_App_IOException not thrown'); } }