File tree Expand file tree Collapse file tree 3 files changed +18
-3
lines changed Expand file tree Collapse file tree 3 files changed +18
-3
lines changed Original file line number Diff line number Diff line change 3
3
- 5.2
4
4
- 5.3
5
5
- 5.4
6
+ before_script :
7
+ - export QINIU_ACCESS_KEY="iN7NgwM31j4-BZacMjPrOQBs34UG1maYCAQmhdCV"
8
+ - export QINIU_SECRET_KEY="6QTOr2Jg1gcZEWDQXKOGZh5PziC2MCV5KsntT70j"
6
9
script :
7
10
- cd tests; phpunit .
8
11
Original file line number Diff line number Diff line change @@ -18,10 +18,15 @@ public function testEncode()
18
18
19
19
public function testSetKeys ()
20
20
{
21
- Qiniu_SetKeys ("abc " , "def " );
22
21
$ mac = Qiniu_RequireMac (null );
23
- $ this ->assertEquals ($ mac ->AccessKey , "abc " );
24
- $ this ->assertEquals ($ mac ->SecretKey , "def " );
22
+ $ this ->assertTrue (!empty ($ mac ->AccessKey ) && !empty ($ mac ->SecretKey ), 'please provide keys ' );
23
+
24
+ Qiniu_SetKeys ('abc ' , 'def ' );
25
+ $ mac = Qiniu_RequireMac (null );
26
+ $ this ->assertEquals ($ mac ->AccessKey , 'abc ' );
27
+ $ this ->assertEquals ($ mac ->SecretKey , 'def ' );
28
+
29
+ Qiniu_SetKeys ($ mac ->AccessKey , $ mac ->SecretKey );
25
30
}
26
31
}
27
32
Original file line number Diff line number Diff line change 2
2
3
3
require_once ("../qiniu/rs.php " );
4
4
5
+ $ accessKey = getenv ("QINIU_ACCESS_KEY " );
6
+ $ secretKey = getenv ("QINIU_SECRET_KEY " );
7
+
8
+ if (!empty ($ accessKey ) && !empty ($ secretKey )) {
9
+ Qiniu_SetKeys ($ accessKey , $ secretKey );
10
+ }
11
+
You can’t perform that action at this time.
0 commit comments