regionId($regionId) ->name($this->clientName); } /** * @throws ClientException */ public function tearDown() { AlibabaCloud::del($this->clientName); } /** * @throws ClientException */ public function testCCC() { try { (new ListPhoneNumbersRequest()) ->client($this->clientName) ->withInstanceId(\getenv('CC_INSTANCE_ID')) ->withOutboundOnly(true) ->scheme('https') ->host('ccc.cn-shanghai.aliyuncs.com') ->options([ 'verify' => false, ]) ->connectTimeout(25) ->timeout(30) ->request(); } catch (ServerException $e) { $result = $e->getResult(); self::assertEquals( 'InvalidBearerTokenException: Bearertoken has expired', $result['Message'] ); } } /** * @expectedException \AlibabaCloud\Client\Exception\ServerException * @expectedExceptionMessageRegExp /UnsupportedSignatureType: This signature type is not supported./ * @throws ClientException */ public function testEcs() { (new DescribeAccessPointsRequest()) ->client($this->clientName) ->connectTimeout(25) ->timeout(30) ->request(); } /** * @expectedException \AlibabaCloud\Client\Exception\ServerException * @expectedExceptionMessageRegExp /UnsupportedSignatureType: This signature type is not supported./ * @throws ClientException */ public function testCdn() { (new DescribeCdnServiceRequest())->client($this->clientName) ->connectTimeout(25) ->timeout(30) ->request(); } }