public function test8M() { $file = qiniuTempFile(8 * 1024 * 1024); list($r, $error) = Etag::sum($file); unlink($file); $this->assertEquals('ljpekgMJ9VSYlE8hMX06GIWXxfDI', $r); $this->assertNull($error); }
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); }
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); }