Skip to content

Commit

Permalink
Merge branch 'fix-mute-participants'
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Burke committed Jul 23, 2012
2 parents ab14675 + 6720b2f commit f02e033
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
6 changes: 3 additions & 3 deletions Services/Twilio/ListResource.php
Expand Up @@ -49,10 +49,10 @@ public function get($sid)
* @return Services_Twilio_InstanceResource An instance with properties * @return Services_Twilio_InstanceResource An instance with properties
* initialized to the values in the params array. * initialized to the values in the params array.
*/ */
public function getObjectFromJson($params) public function getObjectFromJson($params, $idParam = "sid")
{ {
if (isset($params->sid)) { if (isset($params->{$idParam})) {
$uri = $this->uri . "/" . $params->sid; $uri = $this->uri . "/" . $params->{$idParam};
} else { } else {
$uri = $this->uri; $uri = $this->uri;
} }
Expand Down
4 changes: 4 additions & 0 deletions Services/Twilio/Rest/Participants.php
Expand Up @@ -3,4 +3,8 @@
class Services_Twilio_Rest_Participants class Services_Twilio_Rest_Participants
extends Services_Twilio_ListResource extends Services_Twilio_ListResource
{ {
/* Participants are identified by CallSid, not like PI123 */
public function getObjectFromJson($params, $idParam = "sid") {
return parent::getObjectFromJson($params, "call_sid");
}
} }
2 changes: 1 addition & 1 deletion tests/TwilioTest.php
Expand Up @@ -268,7 +268,7 @@ function testUnmute() {
'/2010-04-01/Accounts/AC123/Conferences/CF123/Participants.json?Page=0&PageSize=10') '/2010-04-01/Accounts/AC123/Conferences/CF123/Participants.json?Page=0&PageSize=10')
->andReturn(array(200, array('Content-Type' => 'application/json'), ->andReturn(array(200, array('Content-Type' => 'application/json'),
json_encode(array( json_encode(array(
'participants' => array(array('sid' => 'CA123')) 'participants' => array(array('call_sid' => 'CA123'))
)) ))
)); ));
$http->shouldReceive('post')->once() $http->shouldReceive('post')->once()
Expand Down

0 comments on commit f02e033

Please sign in to comment.