ClientTest.php 757 B

123456789101112131415161718192021222324252627
  1. <?php
  2. use Alipay\EasySDK\Kernel\Factory;
  3. use Alipay\EasySDK\Test\TestAccount;
  4. use PHPUnit\Framework\TestCase;
  5. class ClientTest extends TestCase
  6. {
  7. public function __construct($name = null, array $data = [], $dataName = '')
  8. {
  9. parent::__construct($name, $data, $dataName);
  10. $account = new TestAccount();
  11. Factory::setOptions($account->getTestAccount());
  12. }
  13. public function testDecrypt(){
  14. $result = Factory::util()->aes()->decrypt("ILpoMowjIQjfYMR847rnFQ==");
  15. $this->assertEquals(true, $result == 'test1234567');
  16. }
  17. public function testEncrypt(){
  18. $result = Factory::util()->aes()->encrypt("test1234567");
  19. $this->assertEquals(true, $result == 'ILpoMowjIQjfYMR847rnFQ==');
  20. }
  21. }