6
6
7
7
class PfopTest extends \PHPUnit_Framework_TestCase
8
8
{
9
- public function testExecute1 ()
9
+ public function testPfop ()
10
10
{
11
11
global $ testAuth ;
12
12
$ bucket = 'testres ' ;
@@ -22,7 +22,7 @@ public function testExecute1()
22
22
}
23
23
24
24
25
- public function testExecute2 ()
25
+ public function testPfops ()
26
26
{
27
27
global $ testAuth ;
28
28
$ bucket = 'testres ' ;
@@ -35,6 +35,30 @@ public function testExecute2()
35
35
36
36
list ($ id , $ error ) = $ pfop ->execute ($ key , $ fops );
37
37
$ 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
+
38
62
list ($ status , $ error ) = PersistentFop::status ($ id );
39
63
$ this ->assertNotNull ($ status );
40
64
$ this ->assertNull ($ error );
0 commit comments