12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- <?php
- include_once '../../Config.php';
- use PHPUnit\Framework\TestCase;
- class EndPointByLocationTest extends TestCase
- {
-
- private $locationService;
-
- private $clientProfile;
- private function initClient()
- {
-
- $this->clientProfile = DefaultProfile::getProfile(
- "cn-shanghai",
- "<your AK>",
- "<your Secret>"
- );
- $this->locationService = new LocationService($this->clientProfile);
- }
- public function testFindProductDomain()
- {
- $this->initClient();
- $domain = $this->locationService->findProductDomain("cn-shanghai", "apigateway", "openAPI", "CloudAPI");
- $this->assertEquals("apigateway.cn-shanghai.aliyuncs.com", $domain);
- }
- public function testFindProductDomainWithAddEndPoint()
- {
- DefaultProfile::addEndpoint("cn-shanghai", "cn-shanghai", "CloudAPI", "apigateway.cn-shanghai123.aliyuncs.com");
- $this->initClient();
- $domain = $this->locationService->findProductDomain("cn-shanghai", "apigateway", "openAPI", "CloudAPI");
- $this->assertEquals("apigateway.cn-shanghai123.aliyuncs.com", $domain);
- }
- }
|