Beispiel #1
0
 public function testGetBucket()
 {
     /* @var $component Component */
     $component = Yii::createObject(['class' => Component::className(), 'accessKey' => '111', 'secretKey' => '222', 'disks' => ['testBucket' => ['bucket' => 'bucketOnQiniu', 'baseUrl' => 'http://xxx.xx.xx']]]);
     $this->assertEquals('bucketOnQiniu', $component->getDisk('testBucket')->bucket);
     $this->assertEquals('bucketOnQiniu', $component->getDisk('testBucket')->getBucket());
 }
Beispiel #2
0
 public function testCreateComponentWithDisk()
 {
     /* @var $component Component */
     $component = Yii::createObject(['class' => Component::className(), 'accessKey' => '111', 'secretKey' => '222', 'disks' => ['testBucket' => ['bucket' => 'bucketOnQiniu', 'baseUrl' => 'http://xxx.xx.clouddn.com']]]);
     $this->assertInstanceOf(Component::className(), $component);
     $this->assertInstanceOf(Filesystem::className(), $component->getDisk('testBucket'));
 }
Beispiel #3
0
 /**
  * @dataProvider setVisibilityDataProvider
  */
 public function testSetVisibility($isPrivate)
 {
     $v = Yii::createObject(['class' => Component::className(), 'accessKey' => '111', 'secretKey' => '222', 'disks' => ['testBucket' => ['isPrivate' => $isPrivate, 'bucket' => 'testBucket', 'baseUrl' => 'http://xxx.xx.clouddn.com']]])->getDisk('testBucket')->setVisibility('/', AdapterInterface::VISIBILITY_PUBLIC);
     $this->assertTrue($v);
 }