AlibabaCloudTest.php 951 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. namespace AlibabaCloud\Client\Tests\Unit;
  3. use PHPUnit\Framework\TestCase;
  4. use AlibabaCloud\Client\AlibabaCloud;
  5. use AlibabaCloud\Client\Exception\ClientException;
  6. /**
  7. * Class AlibabaCloudTest
  8. *
  9. * @package AlibabaCloud\Client\Tests\Unit
  10. *
  11. * @coversDefaultClass \AlibabaCloud\Client\AlibabaCloud
  12. */
  13. class AlibabaCloudTest extends TestCase
  14. {
  15. /**
  16. * @after
  17. */
  18. protected function finalize()
  19. {
  20. parent::tearDown();
  21. AlibabaCloud::flush();
  22. }
  23. public function testCallStatic()
  24. {
  25. $this->expectException(ClientException::class);
  26. $reg = '/May not yet support product/';
  27. if (method_exists($this, 'expectExceptionMessageMatches')) {
  28. $this->expectExceptionMessageMatches($reg);
  29. } elseif (method_exists($this, 'expectExceptionMessageRegExp')) {
  30. $this->expectExceptionMessageRegExp($reg);
  31. }
  32. AlibabaCloud::Ecs();
  33. }
  34. }