ClientTest.php 768 B

123456789101112131415161718192021222324
  1. <?php
  2. namespace Alipay\EasySDK\Test\base\video;
  3. use Alipay\EasySDK\Kernel\Factory;
  4. use Alipay\EasySDK\Kernel\Util\ResponseChecker;
  5. use Alipay\EasySDK\Test\TestAccount;
  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.mp4';
  14. $result = Factory::base()->video()->upload("测试视频", $filePath);
  15. $this->assertEquals(true, $responseChecker->success($result));
  16. $this->assertEquals('10000', $result->code);
  17. $this->assertEquals('Success', $result->msg);
  18. }
  19. }