Skip to content

Commit beaf332

Browse files
committed
test pass
1 parent 1247201 commit beaf332

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

src/Qiniu/Storage/BucketManager.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ public function rename($bucket, $oldname, $newname)
135135
* @return mixed 成功返回NULL,失败返回对象Qiniu\Http\Error
136136
* @link http://developer.qiniu.com/docs/v6/api/reference/rs/copy.html
137137
*/
138-
public function copy($from_bucket, $from_key, $to_bucket, $to_key, $force = flase)
138+
public function copy($from_bucket, $from_key, $to_bucket, $to_key, $force = false)
139139
{
140140
$from = \Qiniu\entry($from_bucket, $from_key);
141141
$to = \Qiniu\entry($to_bucket, $to_key);
@@ -158,7 +158,7 @@ public function copy($from_bucket, $from_key, $to_bucket, $to_key, $force = flas
158158
* @return mixed 成功返回NULL,失败返回对象Qiniu\Http\Error
159159
* @link http://developer.qiniu.com/docs/v6/api/reference/rs/move.html
160160
*/
161-
public function move($from_bucket, $from_key, $to_bucket, $to_key, $force = flase)
161+
public function move($from_bucket, $from_key, $to_bucket, $to_key, $force = false)
162162
{
163163
$from = \Qiniu\entry($from_bucket, $from_key);
164164
$to = \Qiniu\entry($to_bucket, $to_key);

tests/Qiniu/Tests/BucketTest.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,15 @@ class BucketTest extends \PHPUnit_Framework_TestCase
99
protected $dummyBucketManager;
1010
protected $bucketName;
1111
protected $key;
12+
protected $key2;
1213
protected function setUp()
1314
{
1415
global $bucketName;
1516
global $key;
17+
global $key2;
1618
$this->bucketName = $bucketName;
1719
$this->key = $key;
20+
$this->key2 = $key2;
1821

1922
global $testAuth;
2023
$this->bucketManager = new BucketManager($testAuth);
@@ -103,8 +106,10 @@ public function testCopy()
103106
);
104107
$this->assertNull($error);
105108

106-
$key2Stat = $this->bucketManager->stat($this->bucketName, $this->key2);
107-
$key2CopiedStat = $this->bucketManager->stat($this->bucketName, $key);
109+
list($key2Stat,) = $this->bucketManager->stat($this->bucketName, $this->key2);
110+
list($key2CopiedStat,) = $this->bucketManager->stat($this->bucketName, $key);
111+
112+
var_dump($key2Stat);
108113
$this->assertEquals($key2Stat['hash'], $key2CopiedStat['hash']);
109114

110115
$error = $this->bucketManager->delete($this->bucketName, $key);

tests/bootstrap.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
$testAuth = new Auth($accessKey, $secretKey);
1010
$bucketName = 'phpsdk';
1111
$key = 'php-logo.png';
12-
$key2 = 'niu.png';
12+
$key2 = 'niu.jpg';
1313
$bucketNameBC = 'phpsdk-bc';
1414

1515
$dummyAccessKey = 'abcdefghklmnopq';

0 commit comments

Comments
 (0)