Skip to content

Commit a83532e

Browse files
committed
export bucket name key name to env
1 parent f7c6206 commit a83532e

File tree

5 files changed

+10
-7
lines changed

5 files changed

+10
-7
lines changed

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ php:
66
before_script:
77
- export QINIU_ACCESS_KEY="Vhiv6a22kVN_zhtetbPNeG9sY3JUL1HG597EmBwQ"
88
- export QINIU_SECRET_KEY="b5b5vNg5nnkwkPfW5ayicPE_pj6hqgKMQEaWQ6JD"
9+
- export QINIU_BUCKET_NAME="php_sdk_test_bucket"
10+
- export QINIU_KEY_NAME="file_name"
911
script:
1012
- cd tests; phpunit .
1113

tests/IoTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@
44

55
class IoTest extends PHPUnit_Framework_TestCase
66
{
7-
public $bucket = BUCKET_NAME;
7+
public $bucket;
88
public $key = "iotest";
99
public $client;
1010

1111
public function setUp()
1212
{
1313
$this->client = new Qiniu_Client(null);
14+
$this->bucket = getenv("QINIU_BUCKET_NAME");
1415
}
1516

1617
public function testPutFile()

tests/RsTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,17 @@
55
class RsApiTest extends PHPUnit_Framework_TestCase
66
{
77
public $client;
8-
public $bucket = BUCKET_NAME;
8+
public $bucket;
99
public $notExistKey = "not_exist";
10-
public $key1 = KEY_NAME;
10+
public $key1;
1111
public $key2 = "file_name_2";
1212
public $key3 = "file_name_3";
1313
public $key4 = "file_name_4";
1414
public function setUp()
1515
{
1616
$this->client = new Qiniu_Client(null);
17+
$this->bucket = getenv("QINIU_BUCKET_NAME");
18+
$this->key1 = getenv("QINIU_KEY_NAME");
1719
}
1820

1921
public function testStat()

tests/RsfTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@
55
class RsfTest extends PHPUnit_Framework_TestCase
66
{
77
public $rsf;
8-
public $bucket = BUCKET_NAME;
8+
public $bucket;
99

1010
public function setUp()
1111
{
1212
$this->rsf = new Qiniu_RSF_Client(null);
13+
$this->bucket = getenv("QINIU_BUCKET_NAME");
1314
}
1415

1516
public function testRsf()

tests/bootstrap.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
77
$accessKey = getenv("QINIU_ACCESS_KEY");
88
$secretKey = getenv("QINIU_SECRET_KEY");
99

10-
define("BUCKET_NAME", "php_sdk_test_bucket");
11-
define("KEY_NAME", "file_name");
12-
1310
if (!empty($accessKey) && !empty($secretKey)) {
1411
Qiniu_SetKeys($accessKey, $secretKey);
1512
}

0 commit comments

Comments
 (0)