You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
yanzong/vendor/aliyuncs/oss-sdk-php/tests/OSS/Tests/OssClientBucketRequestPayme...

52 lines
1.5 KiB

11 months ago
<?php
namespace OSS\Tests;
use OSS\Core\OssException;
use OSS\Model\RequestPaymentConfig;
require_once __DIR__ . DIRECTORY_SEPARATOR . 'TestOssClientBase.php';
class OssClientBucketRequestPaymentTest extends TestOssClientBase
{
public function testBucket()
{
try {
Common::waitMetaSync();
$payer = $this->ossClient->getBucketRequestPayment($this->bucket);
$this->assertEquals("BucketOwner", $payer);
} catch (OssException $e) {
$this->assertTrue(false);
}
try {
$this->ossClient->putBucketRequestPayment($this->bucket, "Requester");
} catch (OssException $e) {
var_dump($e->getMessage());
$this->assertTrue(false);
}
try {
Common::waitMetaSync();
$payer = $this->ossClient->getBucketRequestPayment($this->bucket);
$this->assertEquals("Requester", $payer);
} catch (OssException $e) {
$this->assertTrue(false);
}
try {
$this->ossClient->putBucketRequestPayment($this->bucket, "BucketOwner");
} catch (OssException $e) {
var_dump($e->getMessage());
$this->assertTrue(false);
}
try {
Common::waitMetaSync();
$payer = $this->ossClient->getBucketRequestPayment($this->bucket);
$this->assertEquals("BucketOwner", $payer);
} catch (OssException $e) {
$this->assertTrue(false);
}
}
}