Skip to content

Commit

Permalink
restore dev
Browse files Browse the repository at this point in the history
  • Loading branch information
ljbreak2008 committed Jan 4, 2018
1 parent 8b1760d commit a36eaec
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/OSS/Tests/OssClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,20 @@ public function testGetBucketCors()
}
}

public function testGetBucketCname()
{
try {
$accessKeyId = ' ' . getenv('OSS_ACCESS_KEY_ID') . ' ';
$accessKeySecret = ' ' . getenv('OSS_ACCESS_KEY_SECRET') . ' ';
$endpoint = ' ' . getenv('OSS_ENDPOINT') . '/ ';
$bucket = getenv('OSS_BUCKET');
$ossClient = new OssClient($accessKeyId, $accessKeySecret, $endpoint, false);
$ossClient->getBucketCname($bucket);
} catch (OssException $e) {
$this->assertFalse(true);
}
}

public function testProxySupport()
{
$accessKeyId = ' ' . getenv('OSS_ACCESS_KEY_ID') . ' ';
Expand Down
11 changes: 11 additions & 0 deletions tests/OSS/Tests/OssUtilTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

use OSS\Core\OssException;
use OSS\Core\OssUtil;
use OSS\OssClient;

class OssUtilTest extends \PHPUnit_Framework_TestCase
{
Expand Down Expand Up @@ -106,6 +107,15 @@ public function testCreateCompleteMultipartUploadXmlBody()
$this->assertEquals($this->cleanXml(OssUtil::createCompleteMultipartUploadXmlBody($a)), $xml);
}

public function testCreateBucketXmlBody()
{
$xml = <<<BBBB
<?xml version="1.0" encoding="UTF-8"?><CreateBucketConfiguration><StorageClass>Standard</StorageClass></CreateBucketConfiguration>
BBBB;
$storageClass ="Standard";
$this->assertEquals($this->cleanXml(OssUtil::createBucketXmlBody($storageClass)), $xml);
}

public function testValidateBucket()
{
$this->assertTrue(OssUtil::validateBucket("xxx"));
Expand Down Expand Up @@ -211,4 +221,5 @@ private function cleanXml($xml)
{
return str_replace("\n", "", str_replace("\r", "", $xml));
}

}

0 comments on commit a36eaec

Please sign in to comment.