@@ -227,6 +227,90 @@ public function testCreateMeetingUrl(): void
227227 $ this ->assertUrlContainsAllRequestParameters ($ url , $ params );
228228 }
229229
230+ /**
231+ * Test create meeting without modules.
232+ */
233+ public function testCreate (): void
234+ {
235+ $ createMeetingParams = $ this ->generateCreateParams ();
236+ $ params = $ this ->getCreateMock ($ createMeetingParams );
237+
238+ $ xml = '<response>
239+ <returncode>SUCCESS</returncode>
240+ <meetingID> ' .$ params ->getMeetingID ().'</meetingID>
241+ <internalMeetingID>1a6938c707cdf5d052958672d66c219c30690c47-1524212045514</internalMeetingID>
242+ <createTime>1453283819419</createTime>
243+ <voiceBridge> ' .$ params ->getVoiceBridge ().'</voiceBridge>
244+ <dialNumber>613-555-1234</dialNumber>
245+ <createDate>Wed Jan 20 04:56:59 EST 2016</createDate>
246+ <hasUserJoined>false</hasUserJoined>
247+ <duration>20</duration>
248+ <hasBeenForciblyEnded>false</hasBeenForciblyEnded>
249+ </response> ' ;
250+
251+ $ this ->transport ->method ('request ' )
252+ ->with (self ::callback (function ($ request ) {
253+ $ payload = $ request ->getPayload ();
254+
255+ return $ payload === '' ;
256+ }))
257+ ->willReturn (new TransportResponse ($ xml , null ));
258+
259+ $ response = $ this ->bbb ->createMeeting ($ params );
260+
261+ $ this ->assertTrue ($ response ->success ());
262+ $ this ->assertFalse ($ response ->isDuplicate ());
263+ $ this ->assertFalse ($ response ->isIdNotUnique ());
264+ }
265+
266+ /**
267+ * Test create meeting with modules (presentations and clientSettingsOverride).
268+ */
269+ public function testCreateWithPresentation (): void
270+ {
271+ $ createMeetingParams = $ this ->generateCreateParams ();
272+ $ params = $ this ->getCreateMock ($ createMeetingParams );
273+ $ params ->addPresentation ('http://test-install.blindsidenetworks.com/default.pdf ' , null , 'presentation.pdf ' );
274+ $ params ->addPresentation ('http://test-install.blindsidenetworks.com/file.pdf ' );
275+ $ params ->setClientSettingsOverride ('{ "public": { "app": { "appName": "Test" } } } ' );
276+
277+ $ xml = '<response>
278+ <returncode>SUCCESS</returncode>
279+ <meetingID> ' .$ params ->getMeetingID ().'</meetingID>
280+ <internalMeetingID>1a6938c707cdf5d052958672d66c219c30690c47-1524212045514</internalMeetingID>
281+ <createTime>1453283819419</createTime>
282+ <voiceBridge> ' .$ params ->getVoiceBridge ().'</voiceBridge>
283+ <dialNumber>613-555-1234</dialNumber>
284+ <createDate>Wed Jan 20 04:56:59 EST 2016</createDate>
285+ <hasUserJoined>false</hasUserJoined>
286+ <duration>20</duration>
287+ <hasBeenForciblyEnded>false</hasBeenForciblyEnded>
288+ </response> ' ;
289+
290+ $ this ->transport ->method ('request ' )
291+ ->with (self ::callback (function ($ request ) {
292+ $ payload = $ request ->getPayload ();
293+ $ xml = simplexml_load_string ($ payload );
294+
295+ $ presentations = $ xml ->module [0 ];
296+ $ clientSettingsOverride = $ xml ->module [1 ];
297+
298+ return \count ($ xml ->module ) == 2
299+ && $ presentations ->attributes ()['name ' ]->__toString () == 'presentation '
300+ && $ clientSettingsOverride ->attributes ()['name ' ]->__toString () == 'clientSettingsOverride '
301+ && $ presentations ->children ()[0 ]->attributes ()['url ' ]->__toString () == 'http://test-install.blindsidenetworks.com/default.pdf '
302+ && $ presentations ->children ()[0 ]->attributes ()['filename ' ]->__toString () == 'presentation.pdf '
303+ && $ presentations ->children ()[1 ]->attributes ()['url ' ]->__toString () == 'http://test-install.blindsidenetworks.com/file.pdf ' ;
304+ }))
305+ ->willReturn (new TransportResponse ($ xml , null ));
306+
307+ $ response = $ this ->bbb ->createMeeting ($ params );
308+
309+ $ this ->assertTrue ($ response ->success ());
310+ $ this ->assertFalse ($ response ->isDuplicate ());
311+ $ this ->assertFalse ($ response ->isIdNotUnique ());
312+ }
313+
230314 /* Join Meeting */
231315
232316 /**
0 commit comments