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,30 @@ 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+ $ bucket = 'phpsdk ' ;
48+ $ key = 'php-logo.png ' ;
49+ $ pfop = new PersistentFop ($ testAuth , $ bucket );
50+
51+ $ url1 = 'http://phpsdk.qiniudn.com/php-logo.png ' ;
52+ $ url2 = 'http://phpsdk.qiniudn.com/php-sdk.html ' ;
53+ $ zipKey = 'test.zip ' ;
54+
55+ $ fops = 'mkzip/2/url/ ' . \Qiniu \base64_urlSafeEncode ($ url1 );
56+ $ fops .= '/url/ ' . \Qiniu \base64_urlSafeEncode ($ url2 );
57+ $ fops .= '|saveas/ ' . \Qiniu \base64_urlSafeEncode ("$ bucket: $ zipKey " );
58+
59+ list ($ id , $ error ) = $ pfop ->execute ($ key , $ fops );
60+ $ this ->assertNull ($ error );
61+
3862 list ($ status , $ error ) = PersistentFop::status ($ id );
3963 $ this ->assertNotNull ($ status );
4064 $ this ->assertNull ($ error );
0 commit comments