ossClient->deleteBucketPolicy($this->bucket); $policy = $this->ossClient->getBucketPolicy($this->bucket); $this->assertTrue(false); } catch (OssException $e) { $this->assertTrue(true); $this->assertEquals("NoSuchBucketPolicy", $e->getErrorCode()); } try { $this->ossClient->putBucketPolicy($this->bucket, $policy_str); $policy = $this->ossClient->getBucketPolicy($this->bucket); $data1 = json_decode($policy_str, true); $data2 = json_decode($policy, true); $this->assertEquals($data1, $data2); $this->ossClient->deleteBucketPolicy($this->bucket); } catch (OssException $e) { $this->assertTrue(false); } } }