@@ -47,6 +47,7 @@ class transcoderTest extends TestCase
4747 private static $ inputConcatVideo2Uri ;
4848 private static $ inputOverlayUri ;
4949 private static $ outputUriForPreset ;
50+ private static $ outputUriForPresetBatchMode ;
5051 private static $ outputUriForAdHoc ;
5152 private static $ outputUriForTemplate ;
5253 private static $ outputUriForAnimatedOverlay ;
@@ -96,6 +97,7 @@ public static function setUpBeforeClass(): void
9697 self ::$ inputConcatVideo2Uri = sprintf ('gs://%s/%s ' , $ bucketName , self ::$ testConcatVideo2FileName );
9798 self ::$ inputOverlayUri = sprintf ('gs://%s/%s ' , $ bucketName , self ::$ testOverlayImageFileName );
9899 self ::$ outputUriForPreset = sprintf ('gs://%s/test-output-preset/ ' , $ bucketName );
100+ self ::$ outputUriForPresetBatchMode = sprintf ('gs://%s/test-output-preset-batch-mode/ ' , $ bucketName );
99101 self ::$ outputUriForAdHoc = sprintf ('gs://%s/test-output-adhoc/ ' , $ bucketName );
100102 self ::$ outputUriForTemplate = sprintf ('gs://%s/test-output-template/ ' , $ bucketName );
101103 self ::$ outputUriForAnimatedOverlay = sprintf ('gs://%s/test-output-animated-overlay/ ' , $ bucketName );
@@ -172,7 +174,7 @@ public function testJobFromAdHoc()
172174 $ jobId = explode ('/ ' , $ createOutput );
173175 $ jobId = trim ($ jobId [(count ($ jobId ) - 1 )]);
174176
175- sleep (30 );
177+ sleep (10 );
176178 $ this ->assertJobStateSucceeded ($ jobId );
177179
178180 // Test Get method
@@ -214,7 +216,7 @@ public function testJobFromPreset()
214216 $ jobId = explode ('/ ' , $ output );
215217 $ jobId = trim ($ jobId [(count ($ jobId ) - 1 )]);
216218
217- sleep (30 );
219+ sleep (10 );
218220 $ this ->assertJobStateSucceeded ($ jobId );
219221
220222 $ this ->runFunctionSnippet ('delete_job ' , [
@@ -224,6 +226,31 @@ public function testJobFromPreset()
224226 ]);
225227 }
226228
229+ public function testJobFromPresetBatchMode ()
230+ {
231+ $ output = $ this ->runFunctionSnippet ('create_job_from_preset_batch_mode ' , [
232+ self ::$ projectId ,
233+ self ::$ location ,
234+ self ::$ inputVideoUri ,
235+ self ::$ outputUriForPresetBatchMode ,
236+ self ::$ preset
237+ ]);
238+
239+ $ this ->assertMatchesRegularExpression (sprintf ('%s ' , self ::$ jobIdRegex ), $ output );
240+
241+ $ jobId = explode ('/ ' , $ output );
242+ $ jobId = trim ($ jobId [(count ($ jobId ) - 1 )]);
243+
244+ sleep (10 );
245+ $ this ->assertJobStateSucceeded ($ jobId );
246+
247+ $ this ->runFunctionSnippet ('delete_job ' , [
248+ self ::$ projectId ,
249+ self ::$ location ,
250+ $ jobId
251+ ]);
252+ }
253+
227254 public function testJobFromTemplate ()
228255 {
229256 $ jobTemplateId = sprintf ('php-test-template-%s ' , time ());
@@ -246,7 +273,7 @@ public function testJobFromTemplate()
246273 $ jobId = explode ('/ ' , $ output );
247274 $ jobId = trim ($ jobId [(count ($ jobId ) - 1 )]);
248275
249- sleep (30 );
276+ sleep (10 );
250277 $ this ->assertJobStateSucceeded ($ jobId );
251278
252279 $ this ->runFunctionSnippet ('delete_job ' , [
@@ -277,7 +304,7 @@ public function testJobAnimatedOverlay()
277304 $ jobId = explode ('/ ' , $ output );
278305 $ jobId = trim ($ jobId [(count ($ jobId ) - 1 )]);
279306
280- sleep (30 );
307+ sleep (10 );
281308 $ this ->assertJobStateSucceeded ($ jobId );
282309
283310 $ this ->runFunctionSnippet ('delete_job ' , [
@@ -302,7 +329,7 @@ public function testJobStaticOverlay()
302329 $ jobId = explode ('/ ' , $ output );
303330 $ jobId = trim ($ jobId [(count ($ jobId ) - 1 )]);
304331
305- sleep (30 );
332+ sleep (10 );
306333 $ this ->assertJobStateSucceeded ($ jobId );
307334
308335 $ this ->runFunctionSnippet ('delete_job ' , [
@@ -326,7 +353,7 @@ public function testJobPeriodicImagesSpritesheet()
326353 $ jobId = explode ('/ ' , $ output );
327354 $ jobId = trim ($ jobId [(count ($ jobId ) - 1 )]);
328355
329- sleep (30 );
356+ sleep (10 );
330357 $ this ->assertJobStateSucceeded ($ jobId );
331358
332359 $ this ->runFunctionSnippet ('delete_job ' , [
@@ -350,7 +377,7 @@ public function testJobSetNumberImagesSpritesheet()
350377 $ jobId = explode ('/ ' , $ output );
351378 $ jobId = trim ($ jobId [(count ($ jobId ) - 1 )]);
352379
353- sleep (30 );
380+ sleep (10 );
354381 $ this ->assertJobStateSucceeded ($ jobId );
355382
356383 $ this ->runFunctionSnippet ('delete_job ' , [
@@ -379,7 +406,7 @@ public function testJobConcat()
379406 $ jobId = explode ('/ ' , $ output );
380407 $ jobId = trim ($ jobId [(count ($ jobId ) - 1 )]);
381408
382- sleep (30 );
409+ sleep (10 );
383410 $ this ->assertJobStateSucceeded ($ jobId );
384411
385412 $ this ->runFunctionSnippet ('delete_job ' , [
0 commit comments