markTestSkipped('TESTS_ZEND_SERVICE_DEVELOPERGARDEN_ONLINE_ENABLED is not enabled'); } if (!defined('TESTS_ZEND_SERVICE_DEVELOPERGARDEN_ONLINE_LOGIN')) { define('TESTS_ZEND_SERVICE_DEVELOPERGARDEN_ONLINE_LOGIN', 'Unknown'); } if (!defined('TESTS_ZEND_SERVICE_DEVELOPERGARDEN_ONLINE_PASSWORD')) { define('TESTS_ZEND_SERVICE_DEVELOPERGARDEN_ONLINE_PASSWORD', 'Unknown'); } $config = array( 'username' => TESTS_ZEND_SERVICE_DEVELOPERGARDEN_ONLINE_LOGIN, 'password' => TESTS_ZEND_SERVICE_DEVELOPERGARDEN_ONLINE_PASSWORD, ); $this->service = new Zend_Service_DeveloperGarden_BaseUserService_Mock($config); } public function testSmsQuotaSandbox() { $resp = $this->service->getSmsQuotaInformation(Zend_Service_DeveloperGarden_BaseUserService_Mock::ENV_SANDBOX); $this->assertTrue($resp->isValid()); $this->assertFalse($resp->hasError()); } public function testSmsQuotaProduction() { $resp = $this->service->getSmsQuotaInformation(Zend_Service_DeveloperGarden_BaseUserService_Mock::ENV_PRODUCTION); $this->assertTrue($resp->isValid()); $this->assertFalse($resp->hasError()); } public function testVoiceCallQuotaSandbox() { $resp = $this->service->getVoiceCallQuotaInformation(Zend_Service_DeveloperGarden_BaseUserService_Mock::ENV_SANDBOX); $this->assertTrue($resp->isValid()); $this->assertFalse($resp->hasError()); } public function testVoiceCallQuotaProduction() { $resp = $this->service->getVoiceCallQuotaInformation(Zend_Service_DeveloperGarden_BaseUserService_Mock::ENV_PRODUCTION); $this->assertTrue($resp->isValid()); $this->assertFalse($resp->hasError()); } public function testConfernceCallQuotaSandbox() { $resp = $this->service->getConfernceCallQuotaInformation(Zend_Service_DeveloperGarden_BaseUserService_Mock::ENV_SANDBOX); $this->assertTrue($resp->isValid()); $this->assertFalse($resp->hasError()); } public function testConfernceCallQuotaProduction() { $resp = $this->service->getConfernceCallQuotaInformation(Zend_Service_DeveloperGarden_BaseUserService_Mock::ENV_PRODUCTION); $this->assertTrue($resp->isValid()); $this->assertFalse($resp->hasError()); } public function testLocalSearchQuotaSandbox() { $resp = $this->service->getLocalSearchQuotaInformation(Zend_Service_DeveloperGarden_BaseUserService_Mock::ENV_SANDBOX); $this->assertTrue($resp->isValid()); $this->assertFalse($resp->hasError()); } public function testLocalSearchQuotaProduction() { $resp = $this->service->getLocalSearchQuotaInformation(Zend_Service_DeveloperGarden_BaseUserService_Mock::ENV_PRODUCTION); $this->assertTrue($resp->isValid()); $this->assertFalse($resp->hasError()); } public function testIPLocationQuotaSandbox() { $resp = $this->service->getIPLocationQuotaInformation(Zend_Service_DeveloperGarden_BaseUserService_Mock::ENV_SANDBOX); $this->assertTrue($resp->isValid()); $this->assertFalse($resp->hasError()); } public function testIPLocationQuotaProduction() { $resp = $this->service->getIPLocationQuotaInformation(Zend_Service_DeveloperGarden_BaseUserService_Mock::ENV_PRODUCTION); $this->assertTrue($resp->isValid()); $this->assertFalse($resp->hasError()); } public function testChangeSmsQuotaPoolProduction() { $this->service->changeSmsQuotaPool($this->_limit, Zend_Service_DeveloperGarden_BaseUserService_Mock::ENV_PRODUCTION); } public function testChangeSmsQuotaPoolSandbox() { $this->service->changeSmsQuotaPool($this->_limit, Zend_Service_DeveloperGarden_BaseUserService_Mock::ENV_SANDBOX); } public function testChangeVoiceCallQuotaPoolProduction() { $this->service->changeVoiceCallQuotaPool($this->_limit, Zend_Service_DeveloperGarden_BaseUserService_Mock::ENV_PRODUCTION); } public function testChangeVoiceCallQuotaPoolSandbox() { $this->service->changeVoiceCallQuotaPool($this->_limit, Zend_Service_DeveloperGarden_BaseUserService_Mock::ENV_SANDBOX); } public function testChangeIPLocationQuotaPoolProduction() { $this->service->changeIPLocationQuotaPool($this->_limit, Zend_Service_DeveloperGarden_BaseUserService_Mock::ENV_PRODUCTION); } public function testChangeIPLocationQuotaPoolSandbox() { $this->service->changeIPLocationQuotaPool($this->_limit, Zend_Service_DeveloperGarden_BaseUserService_Mock::ENV_SANDBOX); } public function testChangeConferenceCallQuotaPoolProduction() { $this->service->changeConferenceCallQuotaPool($this->_limit, Zend_Service_DeveloperGarden_BaseUserService_Mock::ENV_PRODUCTION); } public function testChangeConferenceCallQuotaPoolSandbox() { $this->service->changeConferenceCallQuotaPool($this->_limit, Zend_Service_DeveloperGarden_BaseUserService_Mock::ENV_SANDBOX); } public function testChangeLocalSearchQuotaPoolProduction() { $this->service->changeLocalSearchQuotaPool($this->_limit, Zend_Service_DeveloperGarden_BaseUserService_Mock::ENV_PRODUCTION); } public function testChangeLocalSearchQuotaPoolSandbox() { $this->service->changeLocalSearchQuotaPool($this->_limit, Zend_Service_DeveloperGarden_BaseUserService_Mock::ENV_SANDBOX); } public function testAccountBalance() { $result = $this->service->getAccountBalance(); $this->assertEquals('0000', $result->getErrorCode()); $this->assertTrue(is_array($result->Account)); } public function testAccountBalanceLoop() { $result = $this->service->getAccountBalance(); $this->assertEquals('0000', $result->getErrorCode()); $this->assertTrue(is_array($result->Account)); foreach ($result->Account as $k => $v) { $this->assertTrue( $v instanceof Zend_Service_DeveloperGarden_BaseUserService_AccountBalance ); $this->assertTrue(is_string($v->getAccount())); $this->assertTrue(is_int($v->getCredits())); } } } class Zend_Service_DeveloperGarden_BaseUserService_Mock extends Zend_Service_DeveloperGarden_BaseUserService { /** * returns the correct module string * * @param string $module * @param integer $environment * @return string */ public function getBuildModuleString($module, $environment) { return $this->_buildModuleString($module, $environment); } public function checkModuleId($moduleId) { return $this->_checkModuleId($moduleId); } public function buildModuleString($module, $environment) { return $this->_buildModuleString($module, $environment); } } if (PHPUnit_MAIN_METHOD == 'Zend_Service_DeveloperGarden_BaseUserServiceTest::main') { Zend_Service_DeveloperGarden_BaseUserServiceTest::main(); }