Skip to content

Commit

Permalink
update description
Browse files Browse the repository at this point in the history
  • Loading branch information
tuunalai committed May 17, 2024
1 parent eb80d3d commit ab37936
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions tests/CosClientObjectTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,44 @@ public function testGetObject() {
}
}

/*
* get object,key访问getObject
* 404
*/
public function testGetObjectInvalidKey()
{
try {
$key = "//////";
$this->cosClient->getObject(array(
'Bucket' => $this->bucket,
'Key' => $key,));
$this->assertTrue(False);
} catch (ServiceResponseException $e) {

$this->assertEquals(
404,
$e->getExceptionCode()
);
}
}

public function testGetObjectInvalidOtherKey()
{
try {
$key = "/../";
$this->cosClient->getObject(array(
'Bucket' => $this->bucket,
'Key' => $key,));
$this->assertTrue(False);
} catch (ServiceResponseException $e) {

$this->assertEquals(
404,
$e->getExceptionCode()
);
}
}

/*
* range下载大文件
* 200
Expand Down

0 comments on commit ab37936

Please sign in to comment.