Skip to content

Commit f461e1a

Browse files
committed
Added userdata property to CreateMeetingParameters
1 parent ab8eaac commit f461e1a

File tree

6 files changed

+76
-26
lines changed

6 files changed

+76
-26
lines changed

phpunit.xml.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<!-- Specify the value of your BigBlueButton secret -->
1717
<env name="BBB_SECRET" value="8cd8ef52e8e101574e400365b55e11a6"/>
1818
<!-- Specify the Server Base URL of your BigBlueButton -->
19-
<env name="BBB_SERVER_BASE_URL" value="http://test-install.blindsidenetworks.com/bigbluebutton/"/>
19+
<env name="BBB_SERVER_BASE_URL" value="https://test-install.blindsidenetworks.com/bigbluebutton/"/>
2020
</php>
2121

2222
<log type="coverage-html" target="./coverage"

src/Parameters/CreateMeetingParameters.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
/**
2222
* Class CreateMeetingParameters.
2323
*/
24-
class CreateMeetingParameters extends MetaParameters
24+
class CreateMeetingParameters extends UserDataParameters
2525
{
2626
/**
2727
* @var string
@@ -713,6 +713,7 @@ public function getHTTPQuery()
713713
}
714714

715715
$this->buildMeta($queries);
716+
$this->buildUserData($queries);
716717

717718
return $this->buildHTTPQuery($queries);
718719
}
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
<?php
2+
/**
3+
* BigBlueButton open source conferencing system - https://www.bigbluebutton.org/.
4+
*
5+
* Copyright (c) 2016-2018 BigBlueButton Inc. and by respective authors (see below).
6+
*
7+
* This program is free software; you can redistribute it and/or modify it under the
8+
* terms of the GNU Lesser General Public License as published by the Free Software
9+
* Foundation; either version 3.0 of the License, or (at your option) any later
10+
* version.
11+
*
12+
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
13+
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
14+
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
15+
*
16+
* You should have received a copy of the GNU Lesser General Public License along
17+
* with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
18+
*/
19+
namespace BigBlueButton\Parameters;
20+
21+
/**
22+
* Class UserDataParameters
23+
* @package BigBlueButton\Parameters
24+
*/
25+
abstract class UserDataParameters extends MetaParameters
26+
{
27+
/**
28+
* @var array
29+
*/
30+
private $userData = [];
31+
32+
/**
33+
* @param $key
34+
* @return mixed
35+
*/
36+
public function getUserData($key)
37+
{
38+
return $this->userData[$key];
39+
}
40+
41+
/**
42+
* @param string $key
43+
* @param string $value
44+
*
45+
* @return $this
46+
*/
47+
public function addUserData($key, $value)
48+
{
49+
$this->userData[$key] = $value;
50+
51+
return $this;
52+
}
53+
54+
protected function buildUserData(&$queries)
55+
{
56+
if (count($this->userData) !== 0) {
57+
foreach ($this->userData as $k => $v) {
58+
$queries['userdata-' . $k] = $v;
59+
}
60+
}
61+
}
62+
}

src/Responses/CreateMeetingResponse.php

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -123,20 +123,4 @@ public function hasBeenForciblyEnded()
123123
{
124124
return $this->rawXml->hasBeenForciblyEnded->__toString() === 'true';
125125
}
126-
127-
/**
128-
* @return string
129-
*/
130-
public function getMessageKey()
131-
{
132-
return $this->rawXml->messageKey->__toString();
133-
}
134-
135-
/**
136-
* @return string
137-
*/
138-
public function getMessage()
139-
{
140-
return $this->rawXml->message->__toString();
141-
}
142126
}

tests/Parameters/CreateMeetingParametersTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ public function testCreateMeetingParameters()
5252
$this->assertEquals($params['muteOnStart'], $createMeetingParams->isMuteOnStart());
5353
$this->assertEquals($params['meta_presenter'], $createMeetingParams->getMeta('presenter'));
5454
$this->assertEquals($params['meta_endCallbackUrl'], $createMeetingParams->getMeta('endCallbackUrl'));
55+
$this->assertEquals($params['userdata_countrycode'], $createMeetingParams->getUserData('countrycode'));
5556

5657
// Check values are empty of this is not a breakout room
5758
$this->assertNull($createMeetingParams->isBreakout());

tests/TestCase.php

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ protected function generateCreateParams()
8787
'copyright' => $this->faker->text,
8888
'muteOnStart' => $this->faker->boolean(50),
8989
'meta_presenter' => $this->faker->name,
90-
'meta_endCallbackUrl' => $this->faker->url
90+
'meta_endCallbackUrl' => $this->faker->url,
91+
'userdata_countrycode' => $this->faker->countryCode
9192
];
9293
}
9394

@@ -114,13 +115,14 @@ protected function getCreateMock($params)
114115
{
115116
$createMeetingParams = new CreateMeetingParameters($params['meetingId'], $params['meetingName']);
116117

117-
return $createMeetingParams->setAttendeePassword($params['attendeePassword'])->setModeratorPassword($params['moderatorPassword'])->
118-
setDialNumber($params['dialNumber'])->setVoiceBridge($params['voiceBridge'])->setWebVoice($params['webVoice'])->
119-
setLogoutUrl($params['logoutUrl'])->setMaxParticipants($params['maxParticipants'])->setRecord($params['record'])->
120-
setDuration($params['duration'])->setWelcomeMessage($params['welcomeMessage'])->setAutoStartRecording($params['autoStartRecording'])->
121-
setAllowStartStopRecording($params['allowStartStopRecording'])->setModeratorOnlyMessage($params['moderatorOnlyMessage'])->
122-
setWebcamsOnlyForModerator($params['webcamsOnlyForModerator'])->setLogo($params['logo'])->setCopyright($params['copyright'])->
123-
setEndCallbackUrl($params['meta_endCallbackUrl'])->setMuteOnStart($params['muteOnStart'])->addMeta('presenter', $params['meta_presenter']);
118+
return $createMeetingParams->setAttendeePassword($params['attendeePassword'])->setModeratorPassword($params['moderatorPassword'])
119+
->setDialNumber($params['dialNumber'])->setVoiceBridge($params['voiceBridge'])->setWebVoice($params['webVoice'])
120+
->setLogoutUrl($params['logoutUrl'])->setMaxParticipants($params['maxParticipants'])->setRecord($params['record'])
121+
->setDuration($params['duration'])->setWelcomeMessage($params['welcomeMessage'])->setAutoStartRecording($params['autoStartRecording'])
122+
->setAllowStartStopRecording($params['allowStartStopRecording'])->setModeratorOnlyMessage($params['moderatorOnlyMessage'])
123+
->setWebcamsOnlyForModerator($params['webcamsOnlyForModerator'])->setLogo($params['logo'])->setCopyright($params['copyright'])
124+
->setEndCallbackUrl($params['meta_endCallbackUrl'])->setMuteOnStart($params['muteOnStart'])->addMeta('presenter', $params['meta_presenter'])
125+
->addUserData('countrycode', $params['userdata_countrycode']);
124126
}
125127

126128
/**

0 commit comments

Comments
 (0)