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/OssClientBucketVersioningTe...

40 lines
1.2 KiB

<?php
namespace OSS\Tests;
use OSS\Core\OssException;
require_once __DIR__ . DIRECTORY_SEPARATOR . 'TestOssClientBase.php';
class OssClientBucketVersioningTest extends TestOssClientBase
{
public function testBucket()
{
try {
Common::waitMetaSync();
$status = $this->ossClient->getBucketVersioning($this->bucket);
$this->assertEquals(null, $status);
} catch (OssException $e) {
$this->assertTrue(false);
}
try {
$this->ossClient->putBucketVersioning($this->bucket, "Enabled");
Common::waitMetaSync();
$status = $this->ossClient->getBucketVersioning($this->bucket);
$this->assertEquals("Enabled", $status);
} catch (OssException $e) {
$this->assertTrue(false);
}
try {
$this->ossClient->putBucketVersioning($this->bucket, "Suspended");
Common::waitMetaSync();
$status = $this->ossClient->getBucketVersioning($this->bucket);
$this->assertEquals("Suspended", $status);
} catch (OssException $e) {
$this->assertTrue(false);
}
}
}