66
77class PfopTest extends \PHPUnit_Framework_TestCase
88{
9- public function testExecute1 ()
9+ public function testPfop ()
1010 {
1111 global $ testAuth ;
1212 $ bucket = 'testres ' ;
@@ -22,7 +22,7 @@ public function testExecute1()
2222 }
2323
2424
25- public function testExecute2 ()
25+ public function testPfops ()
2626 {
2727 global $ testAuth ;
2828 $ bucket = 'testres ' ;
@@ -35,6 +35,32 @@ public function testExecute2()
3535
3636 list ($ id , $ error ) = $ pfop ->execute ($ key , $ fops );
3737 $ this ->assertNull ($ error );
38+
39+ list ($ status , $ error ) = PersistentFop::status ($ id );
40+ $ this ->assertNotNull ($ status );
41+ $ this ->assertNull ($ error );
42+ }
43+
44+ public function testMkzip ()
45+ {
46+ global $ testAuth ;
47+ $ testAuth = new Auth ($ accessKey , $ secretKey );
48+
49+ $ bucket = 'phpsdk ' ;
50+ $ key = 'php-logo.png ' ;
51+ $ pfop = new PersistentFop ($ testAuth , $ bucket );
52+
53+ $ url1 = 'http://phpsdk.qiniudn.com/php-logo.png ' ;
54+ $ url2 = 'http://phpsdk.qiniudn.com/php-sdk.html ' ;
55+ $ zipKey = 'test.zip ' ;
56+
57+ $ fops = 'mkzip/2/url/ ' . \Qiniu \base64_urlSafeEncode ($ url1 );
58+ $ fops .= '/url/ ' . \Qiniu \base64_urlSafeEncode ($ url2 );
59+ $ fops .= '|saveas/ ' . \Qiniu \base64_urlSafeEncode ("$ bucket: $ zipKey " );
60+
61+ list ($ id , $ error ) = $ pfop ->execute ($ key , $ fops );
62+ $ this ->assertNull ($ error );
63+
3864 list ($ status , $ error ) = PersistentFop::status ($ id );
3965 $ this ->assertNotNull ($ status );
4066 $ this ->assertNull ($ error );
0 commit comments