regionId($regionId) ->name($this->clientName); } /** * Tears down the fixture, for example, close a network connection. * This method is called after a test is executed. * * @throws ClientException */ public function tearDown() { AlibabaCloud::del($this->clientName); } /** * @expectedException \AlibabaCloud\Client\Exception\ClientException * @expectedExceptionMessage Timeout or instance does not belong to Alibaba Cloud * @throws ClientException */ public function testGetSessionCredential() { try { (new DescribeRegionsRequest())->client($this->clientName) ->connectTimeout(25) ->timeout(30) ->request(); } catch (ServerException $e) { self::assertContains( $e->getErrorMessage(), [ 'Error in retrieving assume role credentials.', 'The role was not found in the instance', ] ); } } }