Skip to content

Commit 060fbf9

Browse files
committed
use annotations instead overriding method
1 parent 9493670 commit 060fbf9

File tree

6 files changed

+34
-11
lines changed

6 files changed

+34
-11
lines changed

tests/Qiniu/Tests/BucketTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ class BucketTest extends TestCase
1616
protected $key2;
1717
protected $customCallbackURL;
1818

19-
protected function setUp()
19+
/**
20+
* @before
21+
*/
22+
protected function setUpBucketManager()
2023
{
2124
global $bucketName;
2225
global $key;

tests/Qiniu/Tests/CdnManagerTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ class CdnManagerTest extends TestCase
2626
protected $customDomain;
2727
protected $customDomain2;
2828

29-
protected function setUp()
29+
/**
30+
* @before
31+
*/
32+
protected function setUpCdnManager()
3033
{
3134
global $testAuth;
3235
$this->cdnManager = new CdnManager($testAuth);

tests/Qiniu/Tests/ConfigTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ class ConfigTest extends TestCase
1010
protected $accessKey;
1111
protected $bucketName;
1212

13-
protected function setUp()
13+
/**
14+
* @before
15+
*/
16+
protected function setUpAkAndBucket()
1417
{
1518
global $accessKey;
1619
$this->accessKey = $accessKey;

tests/Qiniu/Tests/FormUpTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ class FormUpTest extends TestCase
1313
protected $auth;
1414
protected $cfg;
1515

16-
protected function setUp()
16+
/**
17+
* @before
18+
*/
19+
protected function setUpConfigAndBucket()
1720
{
1821
global $bucketName;
1922
$this->bucketName = $bucketName;

tests/Qiniu/Tests/ResumeUpTest.php

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ class ResumeUpTest extends TestCase
1616
{
1717
private static $keyToDelete = array();
1818

19-
public static function tearDownAfterClass()
19+
/**
20+
* @afterClass
21+
*/
22+
public static function cleanupTestData()
2023
{
2124
global $bucketName;
2225
global $testAuth;
@@ -30,7 +33,10 @@ public static function tearDownAfterClass()
3033
protected $bucketName;
3134
protected $auth;
3235

33-
protected function setUp()
36+
/**
37+
* @before
38+
*/
39+
protected function setUpAuthAndBucket()
3440
{
3541
global $bucketName;
3642
$this->bucketName = $bucketName;
@@ -171,8 +177,9 @@ public function testResumeUploadWithParams()
171177
$response = Client::get("http://$domain/$key");
172178
$this->assertEquals(200, $response->statusCode);
173179
$this->assertEquals(md5_file($tempFile, true), md5($response->body(), true));
174-
$this->assertEquals("val_1", $response->headers()["X-Qn-Meta-M1"]);
175-
$this->assertEquals("val_2", $response->headers()["X-Qn-Meta-M2"]);
180+
$headers = $response->headers();
181+
$this->assertEquals("val_1", $headers["X-Qn-Meta-M1"]);
182+
$this->assertEquals("val_2", $headers["X-Qn-Meta-M2"]);
176183
unlink($tempFile);
177184
}
178185

@@ -245,8 +252,9 @@ public function testResumeUploadV2WithParams()
245252
$response = Client::get("http://$domain/$key");
246253
$this->assertEquals(200, $response->statusCode);
247254
$this->assertEquals(md5_file($tempFile, true), md5($response->body(), true));
248-
$this->assertEquals("val_1", $response->headers()["X-Qn-Meta-M1"]);
249-
$this->assertEquals("val_2", $response->headers()["X-Qn-Meta-M2"]);
255+
$headers = $response->headers();
256+
$this->assertEquals("val_1", $headers["X-Qn-Meta-M1"]);
257+
$this->assertEquals("val_2", $headers["X-Qn-Meta-M2"]);
250258
unlink($tempFile);
251259
}
252260

tests/Qiniu/Tests/ZoneTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@ class ZoneTest extends TestCase
1919
protected $bucketNameAS;
2020

2121

22-
protected function setUp()
22+
/**
23+
* @before
24+
*/
25+
protected function setUpZoneAndBucket()
2326
{
2427
global $bucketName;
2528
$this->bucketName = $bucketName;

0 commit comments

Comments
 (0)