File tree Expand file tree Collapse file tree 5 files changed +10
-7
lines changed Expand file tree Collapse file tree 5 files changed +10
-7
lines changed Original file line number Diff line number Diff line change 66before_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"
911script :
1012 - cd tests; phpunit .
1113
Original file line number Diff line number Diff line change 44
55class 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 ()
Original file line number Diff line number Diff line change 55class 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 ()
Original file line number Diff line number Diff line change 55class 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 ()
Original file line number Diff line number Diff line change 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-
1310if (!empty ($ accessKey ) && !empty ($ secretKey )) {
1411 Qiniu_SetKeys ($ accessKey , $ secretKey );
1512}
You can’t perform that action at this time.
0 commit comments