forked from mheadd/tropo-webapi-php-original
-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug TROPO-12571 tropo-webapi-php startRecording url
- Loading branch information
Showing
2 changed files
with
61 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,36 @@ public function testStartRecordingWithMinOptions() { | |
$say = new Say("I am now recording!", null, null, null, null, "say"); | ||
$tropo->say($say); | ||
$tropo->stopRecording(); | ||
$this->assertEquals(sprintf($tropo), '{"tropo":[{"startRecording":{"url":"http://192.168.26.203/tropo-webapi-php/upload_file.php"}},{"say":[{"value":"I am now recording!","name":"say"}]},{"stopRecording":"null"}]}'); | ||
$this->assertEquals(sprintf($tropo), '{"tropo":[{"startRecording":{"url":{"url":"http://192.168.26.203/tropo-webapi-php/upload_file.php"}}},{"say":[{"value":"I am now recording!","name":"say"}]},{"stopRecording":"null"}]}'); | ||
} | ||
|
||
public function testStartRecordingWithMinOptions1() { | ||
$tropo = new Tropo(); | ||
$url = new Url('http://192.168.26.203/tropo-webapi-php/upload_file.php'); | ||
$startRecording = array( | ||
'url' => $url | ||
); | ||
$tropo->startRecording($startRecording); | ||
$say = new Say("I am now recording!", null, null, null, null, "say"); | ||
$tropo->say($say); | ||
$tropo->stopRecording(); | ||
$this->assertEquals(sprintf($tropo), '{"tropo":[{"startRecording":{"url":{"url":"http://192.168.26.203/tropo-webapi-php/upload_file.php"}}},{"say":[{"value":"I am now recording!","name":"say"}]},{"stopRecording":"null"}]}'); | ||
} | ||
|
||
public function testStartRecordingWithMinOptions2() { | ||
$tropo = new Tropo(); | ||
$url = array( | ||
new Url('http://192.168.26.203/tropo-webapi-php/upload_file.php', 'root', '111111', 'POST'), | ||
new Url('http://192.168.26.204/tropo-webapi-php/upload_file.php') | ||
); | ||
$startRecording = array( | ||
'url' => $url | ||
); | ||
$tropo->startRecording($startRecording); | ||
$say = new Say("I am now recording!", null, null, null, null, "say"); | ||
$tropo->say($say); | ||
$tropo->stopRecording(); | ||
$this->assertEquals(sprintf($tropo), '{"tropo":[{"startRecording":{"url":[{"url":"http://192.168.26.203/tropo-webapi-php/upload_file.php","username":"root","password":"111111","method":"POST"},{"url":"http://192.168.26.204/tropo-webapi-php/upload_file.php"}]}},{"say":[{"value":"I am now recording!","name":"say"}]},{"stopRecording":"null"}]}'); | ||
} | ||
|
||
public function testRecordWithAllOptions() { | ||
|
@@ -34,7 +63,7 @@ public function testRecordWithAllOptions() { | |
$say = new Say("I am now recording!", null, null, null, null, "say"); | ||
$tropo->say($say); | ||
$tropo->stopRecording(); | ||
$this->assertEquals(sprintf($tropo), '{"tropo":[{"startRecording":{"format":"audio/au","method":"POST","password":"111111","url":"http://192.168.26.203/tropo-webapi-php/upload_file.php","username":"root","transcriptionID":"1234","transcriptionEmailFormat":"plain","transcriptionOutURI":"mailto:[email protected]","transcriptionLanguage":"pt-br","asyncUpload":false}},{"say":[{"value":"I am now recording!","name":"say"}]},{"stopRecording":"null"}]}'); | ||
$this->assertEquals(sprintf($tropo), '{"tropo":[{"startRecording":{"format":"audio/au","url":{"url":"http://192.168.26.203/tropo-webapi-php/upload_file.php","username":"root","password":"111111","method":"POST"},"transcriptionID":"1234","transcriptionEmailFormat":"plain","transcriptionOutURI":"mailto:[email protected]","transcriptionLanguage":"pt-br","asyncUpload":false}},{"say":[{"value":"I am now recording!","name":"say"}]},{"stopRecording":"null"}]}'); | ||
} | ||
|
||
public function testCreateMinObject() { | ||
|
@@ -44,7 +73,7 @@ public function testCreateMinObject() { | |
$say = new Say("I am now recording!", null, null, null, null, "say"); | ||
$tropo->say($say); | ||
$tropo->stopRecording(); | ||
$this->assertEquals(sprintf($tropo), '{"tropo":[{"startRecording":{"url":"http://192.168.26.203/tropo-webapi-php/upload_file.php"}},{"say":[{"value":"I am now recording!","name":"say"}]},{"stopRecording":"null"}]}'); | ||
$this->assertEquals(sprintf($tropo), '{"tropo":[{"startRecording":{"url":{"url":"http://192.168.26.203/tropo-webapi-php/upload_file.php"}}},{"say":[{"value":"I am now recording!","name":"say"}]},{"stopRecording":"null"}]}'); | ||
} | ||
|
||
public function testCreateObject() { | ||
|
@@ -54,7 +83,7 @@ public function testCreateObject() { | |
$say = new Say("I am now recording!", null, null, null, null, "say"); | ||
$tropo->say($say); | ||
$tropo->stopRecording(); | ||
$this->assertEquals(sprintf($tropo), '{"tropo":[{"startRecording":{"format":"audio/mp3","method":"POST","password":"111111","url":"http://192.168.26.203/tropo-webapi-php/upload_file.php","username":"root","transcriptionID":"1234","transcriptionEmailFormat":"plain","transcriptionOutURI":"mailto:[email protected]","transcriptionLanguage":"pt-br","asyncUpload":false}},{"say":[{"value":"I am now recording!","name":"say"}]},{"stopRecording":"null"}]}'); | ||
$this->assertEquals(sprintf($tropo), '{"tropo":[{"startRecording":{"format":"audio/mp3","url":{"url":"http://192.168.26.203/tropo-webapi-php/upload_file.php","username":"root","password":"111111","method":"POST"},"transcriptionID":"1234","transcriptionEmailFormat":"plain","transcriptionOutURI":"mailto:[email protected]","transcriptionLanguage":"pt-br","asyncUpload":false}},{"say":[{"value":"I am now recording!","name":"say"}]},{"stopRecording":"null"}]}'); | ||
} | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters