@@ -9,61 +9,32 @@ class PfopTest extends \PHPUnit_Framework_TestCase
9
9
public function testExecute1 ()
10
10
{
11
11
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 );
17
18
$ this ->assertNull ($ error );
18
19
list ($ status , $ error ) = PersistentFop::status ($ id );
19
20
$ this ->assertNotNull ($ status );
20
21
$ this ->assertNull ($ error );
21
22
}
22
23
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
- }
38
24
39
25
public function testExecute2 ()
40
26
{
41
27
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 );
57
35
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 );
67
38
$ this ->assertNull ($ error );
68
39
list ($ status , $ error ) = PersistentFop::status ($ id );
69
40
$ this ->assertNotNull ($ status );
0 commit comments