Skip to content

Commit afe7d87

Browse files
authored
Merge pull request #308 from qiniu/develop
delete checkCrc
2 parents 464f3eb + a6f70d6 commit afe7d87

20 files changed

+52
-92
lines changed

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ php:
66
- 5.5
77
- 5.6
88
- 7.0
9-
- 7.2
109

1110
before_script:
1211
- export QINIU_TEST_ENV="travis"

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"php": ">=5.3.3"
1717
},
1818
"require-dev": {
19-
"phpunit/phpunit": "~8.0",
19+
"phpunit/phpunit": "~4.0",
2020
"squizlabs/php_codesniffer": "~2.3"
2121
},
2222
"autoload": {

src/Qiniu/Config.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
final class Config
55
{
6-
const SDK_VER = '7.3.0';
6+
const SDK_VER = '7.2.9';
77

88
const BLOCK_SIZE = 4194304; //4*1024*1024 分块上传块大小,该参数为接口规格,不能修改
99

src/Qiniu/Storage/FormUploader.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ public static function put(
3131
$config,
3232
$params,
3333
$mime,
34-
$fname,
35-
$checkCrc
34+
$fname
3635
) {
3736
$fields = array('token' => $upToken);
3837
if ($key === null) {

src/Qiniu/Storage/UploadManager.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@ public function put(
4646
$data,
4747
$params = null,
4848
$mime = 'application/octet-stream',
49-
$fname = null,
50-
$checkCrc = false
49+
$fname = null
5150
) {
5251

5352
$params = self::trimParams($params);
@@ -58,8 +57,7 @@ public function put(
5857
$this->config,
5958
$params,
6059
$mime,
61-
$fname,
62-
$checkCrc
60+
$fname
6361
);
6462
}
6563

@@ -110,8 +108,7 @@ public function putFile(
110108
$this->config,
111109
$params,
112110
$mime,
113-
basename($filePath),
114-
$checkCrc
111+
basename($filePath)
115112
);
116113
}
117114

tests/Qiniu/Tests/AuthTest.php

100644100755
Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,17 @@
55
function time()
66
{
77
return isset($_SERVER['override_qiniu_auth_time'])
8-
? 2234567890
8+
? 1234567890
99
: \time();
1010
}
1111
}
1212

1313
namespace Qiniu\Tests {
1414
use Qiniu\Auth;
15-
use PHPUnit\Framework\TestCase;
1615

1716
// @codingStandardsIgnoreEnd
1817

19-
class AuthTest extends TestCase
18+
class AuthTest extends \PHPUnit_Framework_TestCase
2019
{
2120

2221
public function testSign()
@@ -30,10 +29,7 @@ public function testSignWithData()
3029
{
3130
global $dummyAuth;
3231
$token = $dummyAuth->signWithData('test');
33-
$this->assertEquals(
34-
'abcdefghklmnopq:-jP8eEV9v48MkYiBGs81aDxl60E=:dGVzdA==',
35-
$token
36-
);
32+
$this->assertEquals('abcdefghklmnopq:-jP8eEV9v48MkYiBGs81aDxl60E=:dGVzdA==', $token);
3733
}
3834

3935
public function testSignRequest()
@@ -43,18 +39,15 @@ public function testSignRequest()
4339
$this->assertEquals('abcdefghklmnopq:cFyRVoWrE3IugPIMP5YJFTO-O-Y=', $token);
4440
$ctype = 'application/x-www-form-urlencoded';
4541
$token = $dummyAuth->signRequest('http://www.qiniu.com?go=1', 'test', $ctype);
46-
$this->assertEquals(
47-
$token,
48-
'abcdefghklmnopq:svWRNcacOE-YMsc70nuIYdaa1e4='
49-
);
42+
$this->assertEquals($token, 'abcdefghklmnopq:svWRNcacOE-YMsc70nuIYdaa1e4=');
5043
}
5144

5245
public function testPrivateDownloadUrl()
5346
{
5447
global $dummyAuth;
5548
$_SERVER['override_qiniu_auth_time'] = true;
5649
$url = $dummyAuth->privateDownloadUrl('http://www.qiniu.com?go=1');
57-
$expect = 'http://www.qiniu.com?go=1&e=2234571490&token=abcdefghklmnopq:Hvi3R79Sl6wZy1c331nv0iIFoJk=';
50+
$expect = 'http://www.qiniu.com?go=1&e=1234571490&token=abcdefghklmnopq:8vzBeLZ9W3E4kbBLFLW0Xe0u7v4=';
5851
$this->assertEquals($expect, $url);
5952
unset($_SERVER['override_qiniu_auth_time']);
6053
}
@@ -65,10 +58,14 @@ public function testUploadToken()
6558
$_SERVER['override_qiniu_auth_time'] = true;
6659
$token = $dummyAuth->uploadToken('1', '2', 3600, array('endUser' => 'y'));
6760
// @codingStandardsIgnoreStart
68-
$exp = 'abcdefghklmnopq:GracWhW1iGwVL6haVH5dr4gjqeo=:eyJlbmRVc2VyIjoieSIsInNjb3BlIjoiMToyIiwiZGVhZGxpbmUiOjIyMzQ1NzE0OTB9';
61+
$exp = 'abcdefghklmnopq:yyeexeUkPOROoTGvwBjJ0F0VLEo=:eyJlbmRVc2VyIjoieSIsInNjb3BlIjoiMToyIiwiZGVhZGxpbmUiOjEyMzQ1NzE0OTB9';
6962
// @codingStandardsIgnoreEnd
7063
$this->assertEquals($exp, $token);
7164
unset($_SERVER['override_qiniu_auth_time']);
7265
}
66+
67+
public function testVerifyCallback()
68+
{
69+
}
7370
}
7471
}

tests/Qiniu/Tests/Base64Test.php

100644100755
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22
namespace Qiniu\Tests;
33

44
use Qiniu;
5-
use PHPUnit\Framework\TestCase;
65

7-
class Base64Test extends TestCase
6+
class Base64Test extends \PHPUnit_Framework_TestCase
87
{
98
public function testUrlSafe()
109
{

tests/Qiniu/Tests/BucketTest.php

100644100755
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,16 @@
22
namespace Qiniu\Tests;
33

44
use Qiniu\Storage\BucketManager;
5-
use PHPUnit\Framework\TestCase;
65

7-
class BucketTest extends TestCase
6+
class BucketTest extends \PHPUnit_Framework_TestCase
87
{
98
protected $bucketManager;
109
protected $dummyBucketManager;
1110
protected $bucketName;
1211
protected $key;
1312
protected $key2;
1413

15-
protected function setUp(): void
14+
protected function setUp()
1615
{
1716
global $bucketName;
1817
global $key;

tests/Qiniu/Tests/CdnManagerTest.php

100644100755
Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,14 @@
1010

1111
use Qiniu\Cdn\CdnManager;
1212
use Qiniu\Http\Client;
13-
use PHPUnit\Framework\TestCase;
1413

15-
class CdnManagerTest extends TestCase
14+
class CdnManagerTest extends \PHPUnit_Framework_TestCase
1615
{
1716
protected $cdnManager;
1817
protected $encryptKey;
1918
protected $imgUrl;
2019

21-
protected function setUp(): void
20+
protected function setUp()
2221
{
2322
global $timestampAntiLeechEncryptKey;
2423
global $customDomain;
@@ -35,17 +34,8 @@ public function testCreateTimestampAntiLeechUrl()
3534
$signUrl = $this->cdnManager->createTimestampAntiLeechUrl($this->imgUrl, $this->encryptKey, 3600);
3635

3736
$response = Client::get($signUrl);
37+
3838
$this->assertEquals($response->statusCode, 200);
3939
$this->assertNull($response->error);
40-
41-
$url2 = $this->imgUrl . '?imageInfo';
42-
$signUrl2 = $this->cdnManager->createTimestampAntiLeechUrl($url2, $this->encryptKey, 3600);
43-
44-
$response = Client::get($signUrl2);
45-
$imgInfo = $response->json();
46-
47-
$this->assertEquals($response->statusCode, 200);
48-
$this->assertEquals($imgInfo['size'], 2196145);
49-
$this->assertNull($response->error);
5040
}
5141
}

tests/Qiniu/Tests/Crc32Test.php

100644100755
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22
namespace Qiniu\Tests;
33

44
use Qiniu;
5-
use PHPUnit\Framework\TestCase;
65

7-
class Crc32Test extends TestCase
6+
class Crc32Test extends \PHPUnit_Framework_TestCase
87
{
98
public function testData()
109
{

0 commit comments

Comments
 (0)