Skip to content

Commit

Permalink
add test for unicode url encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Burke committed Nov 24, 2012
1 parent a8fa315 commit 6f8aa57
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/TwilioTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -546,4 +546,19 @@ function testRetryIdempotentFunctionsOnly() {
'+14102221234', 'bar');
}

function testUnicode() {
$http = m::mock(new Services_Twilio_TinyHttp);
$http->shouldReceive('post')->once()
->with('/2010-04-01/Accounts/AC123/SMS/Messages.json', $this->formHeaders,
'From=123&To=123&Body=Hello+%E2%98%BA')
->andReturn(array(200, array('Content-Type' => 'application/json'),
json_encode(array('sid' => 'SM123'))
)
);
$client = new Services_Twilio('AC123', '123', '2010-04-01', $http);
$message = $client->account->sms_messages->create('123', '123',
'Hello ☺');
$this->assertSame($message->sid, 'SM123');
}

}

0 comments on commit 6f8aa57

Please sign in to comment.