public function testGetTokenByPolicy() { $policy = new Policy(); $policy->callbackUrl = 'http://www.baidu.com'; $policy->callbackBody = $policy->persistentOps = Pfop::instance()->avthumb('mp4')->saveas('testbucket', 'test.mp4'); $token = Yii::$app->qiniu->getUploadToken('testBucket', null, 3600, $policy); $this->assertTrue(is_string($token)); }
/** * @depends testWriteStreamAndPersistentFop */ public function testPfopAfterUpload() { $qiniu = Yii::$app->qiniu; $disk = $qiniu->getDisk('testBucket'); $pfop = $disk->getPersistentFop(); $fops = Pfop::instance()->avthumb('flv')->s('640x360')->vb('1.25m')->saveas($disk->getBucket(), 'testflv' . date('Y-m-d H:i:s') . '.flv')->__toString(); list(, $err) = $pfop->execute(static::$path, $fops); $this->assertTrue($err === null); }
/** * @expectedException \InvalidArgumentException */ public function testInvalidRotate() { Pfop::instance()->rotate(30); }