SignatureTest.php 516 B

1234567891011121314151617181920212223242526
  1. <?php
  2. namespace Upyun\Tests;
  3. use Upyun\Signature;
  4. use Upyun\Config;
  5. class SignatureTest extends \PHPUnit_Framework_TestCase
  6. {
  7. /**
  8. * @var Config;
  9. */
  10. public $config;
  11. public function setUp()
  12. {
  13. $this->config = new Config('bucket', 'operator', 'password');
  14. }
  15. public function testGetBodySignature()
  16. {
  17. $sign = Signature::getBodySignature($this->config, 'POST', '/bucket');
  18. $this->assertEquals($sign, 'UPYUN operator:Xx3G6+DAvUyCL2Y2npSW/giTFI8=');
  19. }
  20. }