Exemplo n.º 1
0
 public function test8M()
 {
     $file = qiniuTempFile(8 * 1024 * 1024);
     list($r, $error) = Etag::sum($file);
     unlink($file);
     $this->assertEquals('ljpekgMJ9VSYlE8hMX06GIWXxfDI', $r);
     $this->assertNull($error);
 }
Exemplo n.º 2
0
 public function test4ML()
 {
     $key = 'resumePutFile4ML';
     $upManager = new UploadManager();
     $token = $this->auth->uploadToken($this->bucketName, $key);
     $tempFile = qiniuTempFile(4 * 1024 * 1024 + 10);
     list($ret, $error) = $upManager->putFile($token, $key, $tempFile);
     $this->assertNull($error);
     $this->assertNotNull($ret['hash']);
     unlink($tempFile);
 }
Exemplo n.º 3
0
 public function test4ML2()
 {
     $key = 'resumePutFile4ML';
     $zone = new Zone('http://up.fake.com', 'http://up.qiniu.com');
     $cfg = new Config($zone);
     $upManager = new UploadManager($cfg);
     $token = $this->auth->uploadToken($this->bucketName, $key);
     $tempFile = qiniuTempFile(4 * 1024 * 1024 + 10);
     list($ret, $error) = $upManager->putFile($token, $key, $tempFile);
     $this->assertNull($error);
     $this->assertNotNull($ret['hash']);
     unlink($tempFile);
 }