AlipayOpenFileApiTest.php 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. <?php
  2. /**
  3. * AlipayOpenFileApiTest
  4. * PHP version 7.4
  5. *
  6. * @category Class
  7. * @package Alipay\OpenAPISDK
  8. * @author OpenAPI Generator team
  9. * @link https://openapi-generator.tech
  10. */
  11. /**
  12. * 支付宝开放平台API
  13. *
  14. * 支付宝开放平台v3协议文档
  15. *
  16. * The version of the OpenAPI document: 1.0
  17. * Generated by: https://openapi-generator.tech
  18. * OpenAPI Generator version: 6.0.0
  19. */
  20. /**
  21. * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
  22. * https://openapi-generator.tech
  23. * Please update the test case below to test the endpoint.
  24. */
  25. namespace Alipay\OpenAPISDK\Test\Api;
  26. use Alipay\OpenAPISDK\Api\AlipayOpenFileApi;
  27. use \Alipay\OpenAPISDK\Configuration;
  28. use \Alipay\OpenAPISDK\ApiException;
  29. use Alipay\OpenAPISDK\Model\AlipayOpenFileUploadModel;
  30. use \Alipay\OpenAPISDK\ObjectSerializer;
  31. use Alipay\OpenAPISDK\Util\AlipayConfigUtil;
  32. use Alipay\OpenAPISDK\Util\Model\AlipayConfig;
  33. use GuzzleHttp\Client;
  34. use PHPUnit\Framework\TestCase;
  35. /**
  36. * AlipayOpenFileApiTest Class Doc Comment
  37. *
  38. * @category Class
  39. * @package Alipay\OpenAPISDK
  40. * @author OpenAPI Generator team
  41. * @link https://openapi-generator.tech
  42. */
  43. class AlipayOpenFileApiTest extends TestCase
  44. {
  45. private $apiInstance;
  46. /**
  47. * Setup before running any test cases
  48. */
  49. public static function setUpBeforeClass(): void
  50. {
  51. }
  52. /**
  53. * Setup before running each test case
  54. */
  55. public function setUp(): void
  56. {
  57. $alipayConfig = new AlipayConfig();
  58. $alipayConfig->setAppId('2021003126677278');
  59. $alipayConfig->setPrivateKey('');
  60. $alipayConfig->setAlipayPublicKey('MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAlr+2Mir816Ye8ybsC8QgIigrG2oqVTwYeCjiJQPGP0x7iRVVwQuuM54rO+OyyfJcvI5UWFtfcpy+si+3JyaInKP69DA0AS4XkVPV/81xcIHMZP/CJAYOtLFLhhyEwp1CMoN45BtJes5lG65UXz/7QzVjcF+6AC+qVKx66HKSsT9b5HyWRxfDkOYixy1gZt39w+sgxaAPVt6pf7UZHX+ENE/gYpTCHHflVPzPfl8TIXTZmEMGqjBLY8GFXVJkvATX3h12VX3AwUlIndY4gJND9l1isFV9BfpmZYyv864z14UH6Kq9u8WVWdF5bsJevo4oU0Q0UB8EmyOdlxBPTDiOzwIDAQAB');
  61. $alipayConfig->setEncryptKey('');
  62. // $alipayConfig->setAppId('2021003156675030');
  63. // $alipayConfig->setPrivateKey('');
  64. // $alipayConfig->setAlipayPublicCertPath('test/cert/alipayCertPublicKey_RSA2.crt');
  65. // $alipayConfig->setAppCertPath('test/cert/appCertPublicKey_2021003156675030.crt');
  66. // $alipayConfig->setRootCertPath('test/cert/alipayRootCert.crt');
  67. // $alipayConfig->setEncryptKey('');
  68. $alipayConfigUtil = new AlipayConfigUtil($alipayConfig);
  69. // $this->apiInstance = new AlipayOpenFileApi(
  70. // // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
  71. // // This is optional, `GuzzleHttp\Client` will be used as default.
  72. // new Client()
  73. // );
  74. // $this->apiInstance->setAlipayConfigUtil($alipayConfigUtil);
  75. }
  76. /**
  77. * Clean up after running each test case
  78. */
  79. public function tearDown(): void
  80. {
  81. }
  82. /**
  83. * Clean up after running all test cases
  84. */
  85. public static function tearDownAfterClass(): void
  86. {
  87. }
  88. /**
  89. * Test case for upload
  90. *
  91. * 支付宝文件上传接口.
  92. *
  93. */
  94. public function testUpload()
  95. {
  96. // $model = new AlipayOpenFileUploadModel();
  97. // $model->setBizCode("content_creation");
  98. // $this->apiInstance->upload(null,"", $model, "test/cert/pic.jpg");
  99. // TODO: implement
  100. // $this->markTestIncomplete('Not implemented');
  101. }
  102. }