Skip to content

Commit

Permalink
测试上传空文件
Browse files Browse the repository at this point in the history
  • Loading branch information
unknown committed Nov 28, 2017
1 parent 05a7f1e commit 3ce3c35
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions tests/OSS/Tests/OssClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,16 +108,19 @@ public function testConstrunct9()
}
}

public function testPutObjectNull()
{
public function testPutNullObject()
{

// $accessKeyId = getenv('OSS_ACCESS_KEY_ID');
// $accessKeySecret = getenv('OSS_ACCESS_KEY_SECRET');
// $endpoint = getenv('OSS_ENDPOINT');
// $bucket ='php-sdk-test';
$accessKeyId = getenv('OSS_ACCESS_KEY_ID');
$accessKeySecret = getenv('OSS_ACCESS_KEY_SECRET');
$endpoint = getenv('OSS_ENDPOINT');
$bucket =getenv('OSS_BUCKET');

$ossClient = new OssClient('LTAIuylVfQ4vKZrL', 'xQPtkWeLSFL5iAk0eVsvFRTzJHVbLF', 'oss-cn-hangzhou.aliyuncs.com', false);
$this->assertEquals('', $ossClient->putObject('abc12586', 'testNullObject', '')['body']);
$ossClient = new OssClient($accessKeyId,$accessKeySecret, $endpoint, false);
if(!$ossClient->doesBucketExist($bucket)){
$ossClient->createBucket($bucket, OssClient::OSS_ACL_TYPE_PRIVATE);
}
$this->assertEquals('', $ossClient->putObject($bucket, 'testNullObject', '')['body']);

}

Expand Down

0 comments on commit 3ce3c35

Please sign in to comment.