setMaxTries() public method

设置最大尝试次数
public setMaxTries ( integer $maxRetries = 3 ) : void
$maxRetries integer
return void
 public function testConstrunct()
 {
     try {
         $ossClient = new OssClient(Config::OSS_ACCESS_ID, Config::OSS_ACCESS_KEY, Config::OSS_ENDPOINT);
         $this->assertFalse($ossClient->isUseSSL());
         $ossClient->setUseSSL(true);
         $this->assertTrue($ossClient->isUseSSL());
         $this->assertTrue(true);
         $this->assertEquals(3, $ossClient->getMaxRetries());
         $ossClient->setMaxTries(4);
         $this->assertEquals(4, $ossClient->getMaxRetries());
         $ossClient->setTimeout(10);
         $ossClient->setConnectTimeout(20);
     } catch (OssException $e) {
         assertFalse(true);
     }
 }
示例#2
0
 public function testConstrunct()
 {
     try {
         $ossClient = new OssClient('id', 'key', 'http://oss-cn-hangzhou.aliyuncs.com');
         $this->assertFalse($ossClient->isUseSSL());
         $ossClient->setUseSSL(true);
         $this->assertTrue($ossClient->isUseSSL());
         $this->assertTrue(true);
         $this->assertEquals(3, $ossClient->getMaxRetries());
         $ossClient->setMaxTries(4);
         $this->assertEquals(4, $ossClient->getMaxRetries());
         $ossClient->setTimeout(10);
         $ossClient->setConnectTimeout(20);
     } catch (OssException $e) {
         assertFalse(true);
     }
 }