ClientTest.php 715 B

1234567891011121314151617181920212223
  1. <?php
  2. namespace Alipay\EasySDK\Test\base\image;
  3. use Alipay\EasySDK\Kernel\Factory;
  4. use Alipay\EasySDK\Test\TestAccount;
  5. use Alipay\EasySDK\Kernel\Util\ResponseChecker;
  6. use PHPUnit\Framework\TestCase;
  7. class ClientTest extends TestCase
  8. {
  9. public function testUpload(){
  10. $account = new TestAccount();
  11. $responseChecker = new ResponseChecker();
  12. Factory::setOptions($account->getTestAccount());
  13. $filePath = $account->getResourcesPath(). '/resources/fixture/sample.png';
  14. $result = Factory::base()->image()->upload("测试图片", $filePath);
  15. $this->assertEquals(true, $responseChecker->success($result));
  16. $this->assertEquals('Success', $result->msg);
  17. }
  18. }