@@ -9,61 +9,32 @@ class PfopTest extends \PHPUnit_Framework_TestCase
99 public function testExecute1 ()
1010 {
1111 global $ testAuth ;
12- $ pfop = new PersistentFop ($ testAuth , 'testres ' , 'sdktest ' , true );
13- $ op = Operation::saveas ('avthumb/m3u8/segtime/10/vcodec/libx264/s/320x240 ' , 'phpsdk ' , 'pfoptest ' );
14- $ ops = array ();
15- array_push ($ ops , $ op );
16- list ($ id , $ error ) = $ pfop ->execute ('sintel_trailer.mp4 ' , $ ops );
12+ $ bucket = 'testres ' ;
13+ $ key = 'sintel_trailer.mp4 ' ;
14+ $ pfop = new PersistentFop ($ testAuth , $ bucket );
15+
16+ $ fops = 'avthumb/m3u8/segtime/10/vcodec/libx264/s/320x240 ' ;
17+ list ($ id , $ error ) = $ pfop ->execute ($ key , $ fops );
1718 $ this ->assertNull ($ error );
1819 list ($ status , $ error ) = PersistentFop::status ($ id );
1920 $ this ->assertNotNull ($ status );
2021 $ this ->assertNull ($ error );
2122 }
2223
23- public function testAvthumb ()
24- {
25- global $ testAuth ;
26- $ pfop = new PersistentFop ($ testAuth , 'testres ' , 'sdktest ' , true );
27- $ options = array (
28- 'segtime ' => 10 ,
29- 'vcodec ' => 'libx264 ' ,
30- 's ' => '320x240 '
31- );
32- list ($ id , $ error ) = $ pfop ->avthumb ('sintel_trailer.mp4 ' , 'm3u8 ' , $ options , 'phpsdk ' , 'avthumtest ' );
33- $ this ->assertNull ($ error );
34- list ($ status , $ error ) = PersistentFop::status ($ id );
35- $ this ->assertNotNull ($ status );
36- $ this ->assertNull ($ error );
37- }
3824
3925 public function testExecute2 ()
4026 {
4127 global $ testAuth ;
42- $ pfop = new PersistentFop ($ testAuth , 'testres ' , 'sdktest ' , true );
43- $ url_src1 = 'http://testres.qiniudn.com/gogopher.jpg ' ;
44- $ url_en1 = \Qiniu \base64_urlSafeEncode ($ url_src1 );
45- $ url_alias_en1 = \Qiniu \base64_urlSafeEncode ('g.jpg ' );
46- $ url_en2 = $ url_en1 ;
47- $ fop = "mkzip/2/url/ $ url_en1/alias/ $ url_alias_en1/url/ $ url_en2 " ;
48- $ op = Operation::saveas ($ fop , 'phpsdk ' , 'mkziptest ' );
49- $ ops = array ();
50- array_push ($ ops , $ op );
51- list ($ id , $ error ) = $ pfop ->execute ('sintel_trailer.mp4 ' , $ ops );
52- $ this ->assertNull ($ error );
53- list ($ status , $ error ) = PersistentFop::status ($ id );
54- $ this ->assertNotNull ($ status );
55- $ this ->assertNull ($ error );
56- }
28+ $ bucket = 'testres ' ;
29+ $ key = 'sintel_trailer.mp4 ' ;
30+ $ fops = array (
31+ 'avthumb/m3u8/segtime/10/vcodec/libx264/s/320x240 ' ,
32+ 'vframe/jpg/offset/7/w/480/h/360 ' ,
33+ );
34+ $ pfop = new PersistentFop ($ testAuth , $ bucket );
5735
58- public function testMkzip ()
59- {
60- global $ testAuth ;
61- $ pfop = new PersistentFop ($ testAuth , 'testres ' , 'sdktest ' , true );
62- $ urls = array (
63- 'http://testres.qiniudn.com/gogopher.jpg ' => 'g.jpg ' ,
64- 'http://testres.qiniudn.com/gogopher.jpg '
65- );
66- list ($ id , $ error ) = $ pfop ->mkzip ('sintel_trailer.mp4 ' , $ urls , 'phpsdk ' , 'mkziptest2.zip ' );
36+ list ($ id , $ error ) = $ pfop ->execute ($ key , $ fops );
37+ var_dump ($ id );
6738 $ this ->assertNull ($ error );
6839 list ($ status , $ error ) = PersistentFop::status ($ id );
6940 $ this ->assertNotNull ($ status );
0 commit comments