コード例 #1
0
 /**
  * testStringToSignPutPngAdditionalHeaders
  *
  * @return void
  * @author Rob Mcvey
  **/
 public function testStringToSignPutPngAdditionalHeaders()
 {
     $file_path = APP . 'Plugin' . DS . 'AmazonS3' . DS . 'Test' . DS . 'test_app' . DS . 'webroot' . DS . 'files' . DS . 'avatars' . DS . 'copify.png';
     $this->AmazonS3->localPath = $file_path;
     $this->AmazonS3->file = basename($file_path);
     $this->AmazonS3->setDate('Sun, 22 Sep 2013 14:43:04 GMT');
     $this->AmazonS3->amazonHeaders = array('x-amz-acl' => 'public-read', 'X-Amz-Meta-ReviewedBy' => '*****@*****.**');
     $expected = "PUT" . "\n";
     $expected .= "aUIOL+kLNYqj1ZPXnf8+yw==" . "\n";
     $expected .= "image/png" . "\n";
     $expected .= "Sun, 22 Sep 2013 14:43:04 GMT";
     $expected .= "\n";
     $expected .= "x-amz-acl:public-read" . "\n";
     $expected .= "x-amz-meta-reviewedby:john.doe@yahoo.biz" . "\n";
     $expected .= "/bucket/copify.png";
     $result = $this->AmazonS3->stringToSign('put');
     $this->assertEqual($expected, $result);
 }