diff options
Diffstat (limited to 'Twilio/Tests/Integration')
19 files changed, 990 insertions, 439 deletions
diff --git a/Twilio/Tests/Integration/Api/V2010/Account/KeyTest.php b/Twilio/Tests/Integration/Api/V2010/Account/KeyTest.php new file mode 100644 index 0000000..3267b19 --- /dev/null +++ b/Twilio/Tests/Integration/Api/V2010/Account/KeyTest.php @@ -0,0 +1,183 @@ +<?php + +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ + +namespace Twilio\Tests\Integration\Api\V2010\Account; + +use Twilio\Exceptions\DeserializeException; +use Twilio\Exceptions\TwilioException; +use Twilio\Http\Response; +use Twilio\Tests\HolodeckTestCase; +use Twilio\Tests\Request; + +class KeyTest extends HolodeckTestCase { + public function testFetchRequest() { + $this->holodeck->mock(new Response(500, '')); + + try { + $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") + ->keys("SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); + } catch (DeserializeException $e) {} + catch (TwilioException $e) {} + + $this->assertTrue($this->holodeck->hasRequest(new Request( + 'get', + 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Keys/SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' + ))); + } + + public function testFetchResponse() { + $this->holodeck->mock(new Response( + 200, + ' + { + "sid": "SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "friendly_name": "foo", + "date_created": "Mon, 13 Jun 2016 22:50:08 +0000", + "date_updated": "Mon, 13 Jun 2016 22:50:08 +0000" + } + ' + )); + + $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") + ->keys("SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); + + $this->assertNotNull($actual); + } + + public function testUpdateRequest() { + $this->holodeck->mock(new Response(500, '')); + + try { + $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") + ->keys("SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); + } catch (DeserializeException $e) {} + catch (TwilioException $e) {} + + $this->assertTrue($this->holodeck->hasRequest(new Request( + 'post', + 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Keys/SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' + ))); + } + + public function testUpdateResponse() { + $this->holodeck->mock(new Response( + 200, + ' + { + "sid": "SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "friendly_name": "foo", + "date_created": "Mon, 13 Jun 2016 22:50:08 +0000", + "date_updated": "Mon, 13 Jun 2016 22:50:08 +0000" + } + ' + )); + + $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") + ->keys("SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); + + $this->assertNotNull($actual); + } + + public function testDeleteRequest() { + $this->holodeck->mock(new Response(500, '')); + + try { + $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") + ->keys("SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); + } catch (DeserializeException $e) {} + catch (TwilioException $e) {} + + $this->assertTrue($this->holodeck->hasRequest(new Request( + 'delete', + 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Keys/SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' + ))); + } + + public function testDeleteResponse() { + $this->holodeck->mock(new Response( + 204, + null + )); + + $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") + ->keys("SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); + + $this->assertTrue($actual); + } + + public function testReadRequest() { + $this->holodeck->mock(new Response(500, '')); + + try { + $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") + ->keys->read(); + } catch (DeserializeException $e) {} + catch (TwilioException $e) {} + + $this->assertTrue($this->holodeck->hasRequest(new Request( + 'get', + 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Keys.json' + ))); + } + + public function testReadFullResponse() { + $this->holodeck->mock(new Response( + 200, + ' + { + "keys": [ + { + "sid": "SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "friendly_name": "foo", + "date_created": "Mon, 13 Jun 2016 22:50:08 +0000", + "date_updated": "Mon, 13 Jun 2016 22:50:08 +0000" + } + ], + "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Keys.json?PageSize=50&Page=0", + "end": 3, + "previous_page_uri": null, + "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Keys.json?PageSize=50&Page=0", + "page_size": 50, + "start": 0, + "next_page_uri": null, + "page": 0 + } + ' + )); + + $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") + ->keys->read(); + + $this->assertTrue(count($actual) > 0); + } + + public function testReadEmptyResponse() { + $this->holodeck->mock(new Response( + 200, + ' + { + "keys": [], + "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Keys.json?PageSize=50&Page=0", + "end": 3, + "previous_page_uri": null, + "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Keys.json?PageSize=50&Page=0", + "page_size": 50, + "start": 0, + "next_page_uri": null, + "page": 0 + } + ' + )); + + $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") + ->keys->read(); + + $this->assertNotNull($actual); + } +}
\ No newline at end of file diff --git a/Twilio/Tests/Integration/Api/V2010/Account/Message/FeedbackTest.php b/Twilio/Tests/Integration/Api/V2010/Account/Message/FeedbackTest.php new file mode 100644 index 0000000..42d5f7a --- /dev/null +++ b/Twilio/Tests/Integration/Api/V2010/Account/Message/FeedbackTest.php @@ -0,0 +1,34 @@ +<?php + +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ + +namespace Twilio\Tests\Integration\Api\V2010\Account\Message; + +use Twilio\Exceptions\DeserializeException; +use Twilio\Exceptions\TwilioException; +use Twilio\Http\Response; +use Twilio\Tests\HolodeckTestCase; +use Twilio\Tests\Request; + +class FeedbackTest extends HolodeckTestCase { + public function testCreateRequest() { + $this->holodeck->mock(new Response(500, '')); + + try { + $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") + ->messages("MMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") + ->feedback->create(); + } catch (DeserializeException $e) {} + catch (TwilioException $e) {} + + $this->assertTrue($this->holodeck->hasRequest(new Request( + 'post', + 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/MMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Feedback.json' + ))); + } +}
\ No newline at end of file diff --git a/Twilio/Tests/Integration/Api/V2010/Account/MessageTest.php b/Twilio/Tests/Integration/Api/V2010/Account/MessageTest.php index 0f59d96..50957b6 100644 --- a/Twilio/Tests/Integration/Api/V2010/Account/MessageTest.php +++ b/Twilio/Tests/Integration/Api/V2010/Account/MessageTest.php @@ -21,13 +21,12 @@ class MessageTest extends HolodeckTestCase { try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") - ->messages->create("+123456789", "+987654321"); + ->messages->create("+123456789"); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array( 'To' => "+123456789", - 'From' => "+987654321", ); $this->assertTrue($this->holodeck->hasRequest(new Request( @@ -69,7 +68,7 @@ class MessageTest extends HolodeckTestCase { )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") - ->messages->create("+123456789", "+987654321"); + ->messages->create("+123456789"); $this->assertNotNull($actual); } diff --git a/Twilio/Tests/Integration/Api/V2010/Account/NewKeyTest.php b/Twilio/Tests/Integration/Api/V2010/Account/NewKeyTest.php new file mode 100644 index 0000000..308efad --- /dev/null +++ b/Twilio/Tests/Integration/Api/V2010/Account/NewKeyTest.php @@ -0,0 +1,53 @@ +<?php + +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ + +namespace Twilio\Tests\Integration\Api\V2010\Account; + +use Twilio\Exceptions\DeserializeException; +use Twilio\Exceptions\TwilioException; +use Twilio\Http\Response; +use Twilio\Tests\HolodeckTestCase; +use Twilio\Tests\Request; + +class NewKeyTest extends HolodeckTestCase { + public function testCreateRequest() { + $this->holodeck->mock(new Response(500, '')); + + try { + $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") + ->newKeys->create(); + } catch (DeserializeException $e) {} + catch (TwilioException $e) {} + + $this->assertTrue($this->holodeck->hasRequest(new Request( + 'post', + 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Keys.json' + ))); + } + + public function testCreateResponse() { + $this->holodeck->mock(new Response( + 201, + ' + { + "sid": "SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "friendly_name": "foo", + "date_created": "Mon, 13 Jun 2016 22:50:08 +0000", + "date_updated": "Mon, 13 Jun 2016 22:50:08 +0000", + "secret": "foobar" + } + ' + )); + + $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") + ->newKeys->create(); + + $this->assertNotNull($actual); + } +}
\ No newline at end of file diff --git a/Twilio/Tests/Integration/Api/V2010/Account/NewSigningKeyTest.php b/Twilio/Tests/Integration/Api/V2010/Account/NewSigningKeyTest.php new file mode 100644 index 0000000..071bf97 --- /dev/null +++ b/Twilio/Tests/Integration/Api/V2010/Account/NewSigningKeyTest.php @@ -0,0 +1,53 @@ +<?php + +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ + +namespace Twilio\Tests\Integration\Api\V2010\Account; + +use Twilio\Exceptions\DeserializeException; +use Twilio\Exceptions\TwilioException; +use Twilio\Http\Response; +use Twilio\Tests\HolodeckTestCase; +use Twilio\Tests\Request; + +class NewSigningKeyTest extends HolodeckTestCase { + public function testCreateRequest() { + $this->holodeck->mock(new Response(500, '')); + + try { + $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") + ->newSigningKeys->create(); + } catch (DeserializeException $e) {} + catch (TwilioException $e) {} + + $this->assertTrue($this->holodeck->hasRequest(new Request( + 'post', + 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SigningKeys.json' + ))); + } + + public function testCreateResponse() { + $this->holodeck->mock(new Response( + 201, + ' + { + "sid": "SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "friendly_name": "foo", + "date_created": "Mon, 13 Jun 2016 22:50:08 +0000", + "date_updated": "Mon, 13 Jun 2016 22:50:08 +0000", + "secret": "foobar" + } + ' + )); + + $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") + ->newSigningKeys->create(); + + $this->assertNotNull($actual); + } +}
\ No newline at end of file diff --git a/Twilio/Tests/Integration/Api/V2010/Account/SigningKeyTest.php b/Twilio/Tests/Integration/Api/V2010/Account/SigningKeyTest.php new file mode 100644 index 0000000..26cc979 --- /dev/null +++ b/Twilio/Tests/Integration/Api/V2010/Account/SigningKeyTest.php @@ -0,0 +1,183 @@ +<?php + +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ + +namespace Twilio\Tests\Integration\Api\V2010\Account; + +use Twilio\Exceptions\DeserializeException; +use Twilio\Exceptions\TwilioException; +use Twilio\Http\Response; +use Twilio\Tests\HolodeckTestCase; +use Twilio\Tests\Request; + +class SigningKeyTest extends HolodeckTestCase { + public function testFetchRequest() { + $this->holodeck->mock(new Response(500, '')); + + try { + $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") + ->signingKeys("SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); + } catch (DeserializeException $e) {} + catch (TwilioException $e) {} + + $this->assertTrue($this->holodeck->hasRequest(new Request( + 'get', + 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SigningKeys/SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' + ))); + } + + public function testFetchResponse() { + $this->holodeck->mock(new Response( + 200, + ' + { + "sid": "SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "friendly_name": "foo", + "date_created": "Mon, 13 Jun 2016 22:50:08 +0000", + "date_updated": "Mon, 13 Jun 2016 22:50:08 +0000" + } + ' + )); + + $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") + ->signingKeys("SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); + + $this->assertNotNull($actual); + } + + public function testUpdateRequest() { + $this->holodeck->mock(new Response(500, '')); + + try { + $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") + ->signingKeys("SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); + } catch (DeserializeException $e) {} + catch (TwilioException $e) {} + + $this->assertTrue($this->holodeck->hasRequest(new Request( + 'post', + 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SigningKeys/SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' + ))); + } + + public function testUpdateResponse() { + $this->holodeck->mock(new Response( + 200, + ' + { + "sid": "SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "friendly_name": "foo", + "date_created": "Mon, 13 Jun 2016 22:50:08 +0000", + "date_updated": "Mon, 13 Jun 2016 22:50:08 +0000" + } + ' + )); + + $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") + ->signingKeys("SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); + + $this->assertNotNull($actual); + } + + public function testDeleteRequest() { + $this->holodeck->mock(new Response(500, '')); + + try { + $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") + ->signingKeys("SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); + } catch (DeserializeException $e) {} + catch (TwilioException $e) {} + + $this->assertTrue($this->holodeck->hasRequest(new Request( + 'delete', + 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SigningKeys/SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' + ))); + } + + public function testDeleteResponse() { + $this->holodeck->mock(new Response( + 204, + null + )); + + $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") + ->signingKeys("SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); + + $this->assertTrue($actual); + } + + public function testReadRequest() { + $this->holodeck->mock(new Response(500, '')); + + try { + $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") + ->signingKeys->read(); + } catch (DeserializeException $e) {} + catch (TwilioException $e) {} + + $this->assertTrue($this->holodeck->hasRequest(new Request( + 'get', + 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SigningKeys.json' + ))); + } + + public function testReadFullResponse() { + $this->holodeck->mock(new Response( + 200, + ' + { + "signing_keys": [ + { + "sid": "SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "friendly_name": "foo", + "date_created": "Mon, 13 Jun 2016 22:50:08 +0000", + "date_updated": "Mon, 13 Jun 2016 22:50:08 +0000" + } + ], + "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Keys.json?PageSize=50&Page=0", + "end": 3, + "previous_page_uri": null, + "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Keys.json?PageSize=50&Page=0", + "page_size": 50, + "start": 0, + "next_page_uri": null, + "page": 0 + } + ' + )); + + $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") + ->signingKeys->read(); + + $this->assertTrue(count($actual) > 0); + } + + public function testReadEmptyResponse() { + $this->holodeck->mock(new Response( + 200, + ' + { + "signing_keys": [], + "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Keys.json?PageSize=50&Page=0", + "end": 3, + "previous_page_uri": null, + "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Keys.json?PageSize=50&Page=0", + "page_size": 50, + "start": 0, + "next_page_uri": null, + "page": 0 + } + ' + )); + + $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") + ->signingKeys->read(); + + $this->assertNotNull($actual); + } +}
\ No newline at end of file diff --git a/Twilio/Tests/Integration/Conversations/V1/Conversation/CompletedTest.php b/Twilio/Tests/Integration/Conversations/V1/Conversation/CompletedTest.php deleted file mode 100644 index 03291dd..0000000 --- a/Twilio/Tests/Integration/Conversations/V1/Conversation/CompletedTest.php +++ /dev/null @@ -1,97 +0,0 @@ -<?php - -/** - * This code was generated by - * \ / _ _ _| _ _ - * | (_)\/(_)(_|\/| |(/_ v1.0.0 - * / / - */ - -namespace Twilio\Tests\Integration\Conversations\V1\Conversation; - -use Twilio\Exceptions\DeserializeException; -use Twilio\Exceptions\TwilioException; -use Twilio\Http\Response; -use Twilio\Tests\HolodeckTestCase; -use Twilio\Tests\Request; - -class CompletedTest extends HolodeckTestCase { - public function testReadRequest() { - $this->holodeck->mock(new Response(500, '')); - - try { - $this->twilio->conversations->v1->conversations - ->completed->read(); - } catch (DeserializeException $e) {} - catch (TwilioException $e) {} - - $this->assertTrue($this->holodeck->hasRequest(new Request( - 'get', - 'https://conversations.twilio.com/v1/Conversations/Completed' - ))); - } - - public function testReadFullResponse() { - $this->holodeck->mock(new Response( - 200, - ' - { - "conversations": [ - { - "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", - "date_created": "2015-05-12T21:08:50Z", - "duration": 60, - "end_time": "2015-05-12T21:09:50Z", - "links": { - "participants": "https://conversations.twilio.com/v1/Conversations/CVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants" - }, - "sid": "CVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", - "start_time": "2015-05-12T21:08:50Z", - "status": "completed", - "url": "https://conversations.twilio.com/v1/Conversations/CVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" - } - ], - "meta": { - "first_page_url": "https://conversations.twilio.com/v1/Conversations/Completed?PageSize=50&Page=0", - "key": "conversations", - "next_page_url": null, - "page": 0, - "page_size": 50, - "previous_page_url": null, - "url": "https://conversations.twilio.com/v1/Conversations/Completed?PageSize=50&Page=0" - } - } - ' - )); - - $actual = $this->twilio->conversations->v1->conversations - ->completed->read(); - - $this->assertTrue(count($actual) > 0); - } - - public function testReadEmptyResponse() { - $this->holodeck->mock(new Response( - 200, - ' - { - "conversations": [], - "meta": { - "first_page_url": "https://conversations.twilio.com/v1/Conversations/Completed?PageSize=50&Page=0", - "key": "conversations", - "next_page_url": null, - "page": 0, - "page_size": 50, - "previous_page_url": null, - "url": "https://conversations.twilio.com/v1/Conversations/Completed?PageSize=50&Page=0" - } - } - ' - )); - - $actual = $this->twilio->conversations->v1->conversations - ->completed->read(); - - $this->assertNotNull($actual); - } -}
\ No newline at end of file diff --git a/Twilio/Tests/Integration/Conversations/V1/Conversation/InProgressTest.php b/Twilio/Tests/Integration/Conversations/V1/Conversation/InProgressTest.php deleted file mode 100644 index 9ab0046..0000000 --- a/Twilio/Tests/Integration/Conversations/V1/Conversation/InProgressTest.php +++ /dev/null @@ -1,97 +0,0 @@ -<?php - -/** - * This code was generated by - * \ / _ _ _| _ _ - * | (_)\/(_)(_|\/| |(/_ v1.0.0 - * / / - */ - -namespace Twilio\Tests\Integration\Conversations\V1\Conversation; - -use Twilio\Exceptions\DeserializeException; -use Twilio\Exceptions\TwilioException; -use Twilio\Http\Response; -use Twilio\Tests\HolodeckTestCase; -use Twilio\Tests\Request; - -class InProgressTest extends HolodeckTestCase { - public function testReadRequest() { - $this->holodeck->mock(new Response(500, '')); - - try { - $this->twilio->conversations->v1->conversations - ->inProgress->read(); - } catch (DeserializeException $e) {} - catch (TwilioException $e) {} - - $this->assertTrue($this->holodeck->hasRequest(new Request( - 'get', - 'https://conversations.twilio.com/v1/Conversations/InProgress' - ))); - } - - public function testReadFullResponse() { - $this->holodeck->mock(new Response( - 200, - ' - { - "conversations": [ - { - "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", - "date_created": "2015-05-12T21:08:50Z", - "duration": 60, - "end_time": "2015-05-12T21:09:50Z", - "links": { - "participants": "https://conversations.twilio.com/v1/Conversations/CVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants" - }, - "sid": "CVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", - "start_time": "2015-05-12T21:08:50Z", - "status": "completed", - "url": "https://conversations.twilio.com/v1/Conversations/CVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" - } - ], - "meta": { - "first_page_url": "https://conversations.twilio.com/v1/Conversations/InProgress?PageSize=50&Page=0", - "key": "conversations", - "next_page_url": null, - "page": 0, - "page_size": 50, - "previous_page_url": null, - "url": "https://conversations.twilio.com/v1/Conversations/InProgress?PageSize=50&Page=0" - } - } - ' - )); - - $actual = $this->twilio->conversations->v1->conversations - ->inProgress->read(); - - $this->assertTrue(count($actual) > 0); - } - - public function testReadEmptyResponse() { - $this->holodeck->mock(new Response( - 200, - ' - { - "conversations": [], - "meta": { - "first_page_url": "https://conversations.twilio.com/v1/Conversations/InProgress?PageSize=50&Page=0", - "key": "conversations", - "next_page_url": null, - "page": 0, - "page_size": 50, - "previous_page_url": null, - "url": "https://conversations.twilio.com/v1/Conversations/InProgress?PageSize=50&Page=0" - } - } - ' - )); - - $actual = $this->twilio->conversations->v1->conversations - ->inProgress->read(); - - $this->assertNotNull($actual); - } -}
\ No newline at end of file diff --git a/Twilio/Tests/Integration/Conversations/V1/Conversation/ParticipantTest.php b/Twilio/Tests/Integration/Conversations/V1/Conversation/ParticipantTest.php deleted file mode 100644 index 05438a8..0000000 --- a/Twilio/Tests/Integration/Conversations/V1/Conversation/ParticipantTest.php +++ /dev/null @@ -1,183 +0,0 @@ -<?php - -/** - * This code was generated by - * \ / _ _ _| _ _ - * | (_)\/(_)(_|\/| |(/_ v1.0.0 - * / / - */ - -namespace Twilio\Tests\Integration\Conversations\V1\Conversation; - -use Twilio\Exceptions\DeserializeException; -use Twilio\Exceptions\TwilioException; -use Twilio\Http\Response; -use Twilio\Tests\HolodeckTestCase; -use Twilio\Tests\Request; - -class ParticipantTest extends HolodeckTestCase { - public function testReadRequest() { - $this->holodeck->mock(new Response(500, '')); - - try { - $this->twilio->conversations->v1->conversations("CVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") - ->participants->read(); - } catch (DeserializeException $e) {} - catch (TwilioException $e) {} - - $this->assertTrue($this->holodeck->hasRequest(new Request( - 'get', - 'https://conversations.twilio.com/v1/Conversations/CVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants' - ))); - } - - public function testReadFullResponse() { - $this->holodeck->mock(new Response( - 200, - ' - { - "meta": { - "first_page_url": "https://conversations.twilio.com/v1/Conversations/CVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants?PageSize=50&Page=0", - "key": "participants", - "next_page_url": null, - "page": 0, - "page_size": 50, - "previous_page_url": null, - "url": "https://conversations.twilio.com/v1/Conversations/CVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants?PageSize=50&Page=0" - }, - "participants": [ - { - "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", - "address": "torkel2@ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.endpoint.twilio.com", - "conversation_sid": "CVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", - "date_created": "2015-05-13T23:03:12Z", - "duration": 685, - "end_time": "2015-05-13T23:14:40Z", - "sid": "PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", - "start_time": "2015-05-13T23:03:15Z", - "status": "disconnected", - "url": "https://conversations.twilio.com/v1/Conversations/CVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" - } - ] - } - ' - )); - - $actual = $this->twilio->conversations->v1->conversations("CVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") - ->participants->read(); - - $this->assertTrue(count($actual) > 0); - } - - public function testReadEmptyResponse() { - $this->holodeck->mock(new Response( - 200, - ' - { - "meta": { - "first_page_url": "https://conversations.twilio.com/v1/Conversations/CVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants?PageSize=50&Page=0", - "key": "participants", - "next_page_url": null, - "page": 0, - "page_size": 50, - "previous_page_url": null, - "url": "https://conversations.twilio.com/v1/Conversations/CVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants?PageSize=50&Page=0" - }, - "participants": [] - } - ' - )); - - $actual = $this->twilio->conversations->v1->conversations("CVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") - ->participants->read(); - - $this->assertNotNull($actual); - } - - public function testCreateRequest() { - $this->holodeck->mock(new Response(500, '')); - - try { - $this->twilio->conversations->v1->conversations("CVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") - ->participants->create("+123456789", "+987654321"); - } catch (DeserializeException $e) {} - catch (TwilioException $e) {} - - $values = array( - 'To' => "+123456789", - 'From' => "+987654321", - ); - - $this->assertTrue($this->holodeck->hasRequest(new Request( - 'post', - 'https://conversations.twilio.com/v1/Conversations/CVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants', - null, - $values - ))); - } - - public function testCreateResponse() { - $this->holodeck->mock(new Response( - 200, - ' - { - "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", - "address": "torkel2@ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.endpoint.twilio.com", - "conversation_sid": "CVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", - "date_created": "2015-05-13T23:03:12Z", - "duration": 685, - "end_time": "2015-05-13T23:14:40Z", - "sid": "PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", - "start_time": "2015-05-13T23:03:15Z", - "status": "disconnected", - "url": "https://conversations.twilio.com/v1/Conversations/CVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" - } - ' - )); - - $actual = $this->twilio->conversations->v1->conversations("CVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") - ->participants->create("+123456789", "+987654321"); - - $this->assertNotNull($actual); - } - - public function testFetchRequest() { - $this->holodeck->mock(new Response(500, '')); - - try { - $this->twilio->conversations->v1->conversations("CVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") - ->participants("PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); - } catch (DeserializeException $e) {} - catch (TwilioException $e) {} - - $this->assertTrue($this->holodeck->hasRequest(new Request( - 'get', - 'https://conversations.twilio.com/v1/Conversations/CVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - ))); - } - - public function testFetchResponse() { - $this->holodeck->mock(new Response( - 200, - ' - { - "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", - "address": "torkel2@ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.endpoint.twilio.com", - "conversation_sid": "CVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", - "date_created": "2015-05-13T23:03:12Z", - "duration": 685, - "end_time": "2015-05-13T23:14:40Z", - "sid": "PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", - "start_time": "2015-05-13T23:03:15Z", - "status": "disconnected", - "url": "https://conversations.twilio.com/v1/Conversations/CVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" - } - ' - )); - - $actual = $this->twilio->conversations->v1->conversations("CVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") - ->participants("PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); - - $this->assertNotNull($actual); - } -}
\ No newline at end of file diff --git a/Twilio/Tests/Integration/Conversations/V1/ConversationTest.php b/Twilio/Tests/Integration/Conversations/V1/ConversationTest.php deleted file mode 100644 index 9d6dd53..0000000 --- a/Twilio/Tests/Integration/Conversations/V1/ConversationTest.php +++ /dev/null @@ -1,57 +0,0 @@ -<?php - -/** - * This code was generated by - * \ / _ _ _| _ _ - * | (_)\/(_)(_|\/| |(/_ v1.0.0 - * / / - */ - -namespace Twilio\Tests\Integration\Conversations\V1; - -use Twilio\Exceptions\DeserializeException; -use Twilio\Exceptions\TwilioException; -use Twilio\Http\Response; -use Twilio\Tests\HolodeckTestCase; -use Twilio\Tests\Request; - -class ConversationTest extends HolodeckTestCase { - public function testFetchRequest() { - $this->holodeck->mock(new Response(500, '')); - - try { - $this->twilio->conversations->v1->conversations("CVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); - } catch (DeserializeException $e) {} - catch (TwilioException $e) {} - - $this->assertTrue($this->holodeck->hasRequest(new Request( - 'get', - 'https://conversations.twilio.com/v1/Conversations/CVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - ))); - } - - public function testFetchResponse() { - $this->holodeck->mock(new Response( - 200, - ' - { - "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", - "date_created": "2015-05-12T21:13:15Z", - "duration": 60, - "end_time": "2015-05-12T21:14:15Z", - "links": { - "participants": "https://conversations.twilio.com/v1/Conversations/CVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants" - }, - "sid": "CVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", - "start_time": "2015-05-12T21:13:15Z", - "status": "created", - "url": "https://conversations.twilio.com/v1/Conversations/CVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" - } - ' - )); - - $actual = $this->twilio->conversations->v1->conversations("CVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); - - $this->assertNotNull($actual); - } -}
\ No newline at end of file diff --git a/Twilio/Tests/Integration/Lookups/V1/PhoneNumberTest.php b/Twilio/Tests/Integration/Lookups/V1/PhoneNumberTest.php index 2391b68..73b4fd2 100644 --- a/Twilio/Tests/Integration/Lookups/V1/PhoneNumberTest.php +++ b/Twilio/Tests/Integration/Lookups/V1/PhoneNumberTest.php @@ -45,6 +45,12 @@ class PhoneNumberTest extends HolodeckTestCase { "country_code": "US", "national_format": "(510) 867-5309", "phone_number": "+15108675309", + "add_ons": { + "status": "successful", + "message": null, + "code": null, + "results": {} + }, "url": "https://lookups.twilio.com/v1/PhoneNumbers/phone_number" } ' diff --git a/Twilio/Tests/Integration/Notifications/V1/CredentialTest.php b/Twilio/Tests/Integration/Notifications/V1/CredentialTest.php new file mode 100644 index 0000000..e003f2e --- /dev/null +++ b/Twilio/Tests/Integration/Notifications/V1/CredentialTest.php @@ -0,0 +1,238 @@ +<?php + +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ + +namespace Twilio\Tests\Integration\Notifications\V1; + +use Twilio\Exceptions\DeserializeException; +use Twilio\Exceptions\TwilioException; +use Twilio\Http\Response; +use Twilio\Tests\HolodeckTestCase; +use Twilio\Tests\Request; + +class CredentialTest extends HolodeckTestCase { + public function testReadRequest() { + $this->holodeck->mock(new Response(500, '')); + + try { + $this->twilio->notifications->v1->credentials->read(); + } catch (DeserializeException $e) {} + catch (TwilioException $e) {} + + $this->assertTrue($this->holodeck->hasRequest(new Request( + 'get', + 'https://notifications.twilio.com/v1/Credentials' + ))); + } + + public function testReadFullResponse() { + $this->holodeck->mock(new Response( + 200, + ' + { + "credentials": [ + { + "sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "friendly_name": "Test slow create", + "type": "apn", + "sandbox": "False", + "date_created": "2015-10-07T17:50:01Z", + "date_updated": "2015-10-07T17:50:01Z", + "url": "https://notifications.twilio.com/v1/Credentials/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + } + ], + "meta": { + "page": 0, + "page_size": 1, + "first_page_url": "https://notifications.twilio.com/v1/Credentials?PageSize=1&Page=0", + "previous_page_url": null, + "url": "https://notifications.twilio.com/v1/Credentials?PageSize=1&Page=0", + "next_page_url": null, + "key": "credentials" + } + } + ' + )); + + $actual = $this->twilio->notifications->v1->credentials->read(); + + $this->assertTrue(count($actual) > 0); + } + + public function testReadEmptyResponse() { + $this->holodeck->mock(new Response( + 200, + ' + { + "credentials": [], + "meta": { + "page": 0, + "page_size": 1, + "first_page_url": "https://notifications.twilio.com/v1/Credentials?PageSize=1&Page=0", + "previous_page_url": null, + "url": "https://notifications.twilio.com/v1/Credentials?PageSize=1&Page=0", + "next_page_url": null, + "key": "credentials" + } + } + ' + )); + + $actual = $this->twilio->notifications->v1->credentials->read(); + + $this->assertNotNull($actual); + } + + public function testCreateRequest() { + $this->holodeck->mock(new Response(500, '')); + + try { + $this->twilio->notifications->v1->credentials->create("friendlyName", "gcm"); + } catch (DeserializeException $e) {} + catch (TwilioException $e) {} + + $values = array( + 'FriendlyName' => "friendlyName", + 'Type' => "gcm", + ); + + $this->assertTrue($this->holodeck->hasRequest(new Request( + 'post', + 'https://notifications.twilio.com/v1/Credentials', + null, + $values + ))); + } + + public function testCreateResponse() { + $this->holodeck->mock(new Response( + 201, + ' + { + "sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "friendly_name": "Test slow create", + "type": "apn", + "sandbox": "False", + "date_created": "2015-10-07T17:50:01Z", + "date_updated": "2015-10-07T17:50:01Z", + "url": "https://notifications.twilio.com/v1/Credentials/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + } + ' + )); + + $actual = $this->twilio->notifications->v1->credentials->create("friendlyName", "gcm"); + + $this->assertNotNull($actual); + } + + public function testFetchRequest() { + $this->holodeck->mock(new Response(500, '')); + + try { + $this->twilio->notifications->v1->credentials("CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); + } catch (DeserializeException $e) {} + catch (TwilioException $e) {} + + $this->assertTrue($this->holodeck->hasRequest(new Request( + 'get', + 'https://notifications.twilio.com/v1/Credentials/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + ))); + } + + public function testFetchResponse() { + $this->holodeck->mock(new Response( + 200, + ' + { + "sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "friendly_name": "Test slow create", + "type": "apn", + "sandbox": "False", + "date_created": "2015-10-07T17:50:01Z", + "date_updated": "2015-10-07T17:50:01Z", + "url": "https://notifications.twilio.com/v1/Credentials/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + } + ' + )); + + $actual = $this->twilio->notifications->v1->credentials("CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); + + $this->assertNotNull($actual); + } + + public function testUpdateRequest() { + $this->holodeck->mock(new Response(500, '')); + + try { + $this->twilio->notifications->v1->credentials("CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update("friendlyName", "gcm"); + } catch (DeserializeException $e) {} + catch (TwilioException $e) {} + + $values = array( + 'FriendlyName' => "friendlyName", + 'Type' => "gcm", + ); + + $this->assertTrue($this->holodeck->hasRequest(new Request( + 'post', + 'https://notifications.twilio.com/v1/Credentials/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + null, + $values + ))); + } + + public function testUpdateResponse() { + $this->holodeck->mock(new Response( + 200, + ' + { + "sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "friendly_name": "Test slow create", + "type": "apn", + "sandbox": "False", + "date_created": "2015-10-07T17:50:01Z", + "date_updated": "2015-10-07T17:50:01Z", + "url": "https://notifications.twilio.com/v1/Credentials/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + } + ' + )); + + $actual = $this->twilio->notifications->v1->credentials("CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update("friendlyName", "gcm"); + + $this->assertNotNull($actual); + } + + public function testDeleteRequest() { + $this->holodeck->mock(new Response(500, '')); + + try { + $this->twilio->notifications->v1->credentials("CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); + } catch (DeserializeException $e) {} + catch (TwilioException $e) {} + + $this->assertTrue($this->holodeck->hasRequest(new Request( + 'delete', + 'https://notifications.twilio.com/v1/Credentials/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + ))); + } + + public function testDeleteResponse() { + $this->holodeck->mock(new Response( + 204, + null + )); + + $actual = $this->twilio->notifications->v1->credentials("CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); + + $this->assertTrue($actual); + } +}
\ No newline at end of file diff --git a/Twilio/Tests/Integration/Notifications/V1/Service/BindingTest.php b/Twilio/Tests/Integration/Notifications/V1/Service/BindingTest.php index 9b2a4d7..99c797c 100644 --- a/Twilio/Tests/Integration/Notifications/V1/Service/BindingTest.php +++ b/Twilio/Tests/Integration/Notifications/V1/Service/BindingTest.php @@ -202,7 +202,7 @@ class BindingTest extends HolodeckTestCase { "first_page_url": "https://notifications.stage.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings?PageSize=1&Page=0", "previous_page_url": null, "url": "https://notifications.stage.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings?PageSize=1&Page=0", - "next_page_url": "https://notifications.stage.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings?PageSize=1&Page=1&PageToken=PABSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "next_page_url": null, "key": "bindings" }, "bindings": [] diff --git a/Twilio/Tests/Integration/Notifications/V1/Service/NotificationTest.php b/Twilio/Tests/Integration/Notifications/V1/Service/NotificationTest.php index 64666ab..0b1e7cd 100644 --- a/Twilio/Tests/Integration/Notifications/V1/Service/NotificationTest.php +++ b/Twilio/Tests/Integration/Notifications/V1/Service/NotificationTest.php @@ -52,7 +52,9 @@ class NotificationTest extends HolodeckTestCase { "action": null, "data": null, "apn": null, - "gcm": null + "gcm": null, + "sms": null, + "facebook_messenger": null } ' )); diff --git a/Twilio/Tests/Integration/Notifications/V1/ServiceTest.php b/Twilio/Tests/Integration/Notifications/V1/ServiceTest.php index 93958d3..ae9205f 100644 --- a/Twilio/Tests/Integration/Notifications/V1/ServiceTest.php +++ b/Twilio/Tests/Integration/Notifications/V1/ServiceTest.php @@ -42,6 +42,8 @@ class ServiceTest extends HolodeckTestCase { "date_updated": "2016-03-09T20:22:31Z", "apn_credential_sid": null, "gcm_credential_sid": null, + "messaging_service_sid": null, + "facebook_messenger_page_id": "4", "default_apn_notification_protocol_version": "3", "default_gcm_notification_protocol_version": "3", "url": "https://notifications.stage.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", @@ -109,6 +111,8 @@ class ServiceTest extends HolodeckTestCase { "date_updated": "2016-03-09T20:22:31Z", "apn_credential_sid": null, "gcm_credential_sid": null, + "messaging_service_sid": null, + "facebook_messenger_page_id": "4", "default_apn_notification_protocol_version": "3", "default_gcm_notification_protocol_version": "3", "url": "https://notifications.stage.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", @@ -162,6 +166,8 @@ class ServiceTest extends HolodeckTestCase { "date_updated": "2016-03-09T20:22:31Z", "apn_credential_sid": null, "gcm_credential_sid": null, + "messaging_service_sid": null, + "facebook_messenger_page_id": "4", "default_apn_notification_protocol_version": "3", "default_gcm_notification_protocol_version": "3", "url": "https://notifications.stage.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", @@ -232,6 +238,8 @@ class ServiceTest extends HolodeckTestCase { "gcm_credential_sid": null, "default_apn_notification_protocol_version": "3", "default_gcm_notification_protocol_version": "3", + "messaging_service_sid": null, + "facebook_messenger_page_id": "4", "url": "https://notifications.stage.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "links": { "bindings": "https://notifications.stage.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings", diff --git a/Twilio/Tests/Integration/Preview/Wireless/CommandTest.php b/Twilio/Tests/Integration/Preview/Wireless/CommandTest.php new file mode 100644 index 0000000..260c95d --- /dev/null +++ b/Twilio/Tests/Integration/Preview/Wireless/CommandTest.php @@ -0,0 +1,67 @@ +<?php + +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ + +namespace Twilio\Tests\Integration\Preview\Wireless; + +use Twilio\Exceptions\DeserializeException; +use Twilio\Exceptions\TwilioException; +use Twilio\Http\Response; +use Twilio\Tests\HolodeckTestCase; +use Twilio\Tests\Request; + +class CommandTest extends HolodeckTestCase { + public function testFetchRequest() { + $this->holodeck->mock(new Response(500, '')); + + try { + $this->twilio->preview->wireless->commands("DCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); + } catch (DeserializeException $e) {} + catch (TwilioException $e) {} + + $this->assertTrue($this->holodeck->hasRequest(new Request( + 'get', + 'https://preview.twilio.com/wireless/Commands/DCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' + ))); + } + + public function testReadRequest() { + $this->holodeck->mock(new Response(500, '')); + + try { + $this->twilio->preview->wireless->commands->read(); + } catch (DeserializeException $e) {} + catch (TwilioException $e) {} + + $this->assertTrue($this->holodeck->hasRequest(new Request( + 'get', + 'https://preview.twilio.com/wireless/Commands' + ))); + } + + public function testCreateRequest() { + $this->holodeck->mock(new Response(500, '')); + + try { + $this->twilio->preview->wireless->commands->create("device", "command"); + } catch (DeserializeException $e) {} + catch (TwilioException $e) {} + + $values = array( + 'Device' => "device", + 'Command' => "command", + ); + + $this->assertTrue($this->holodeck->hasRequest(new Request( + 'post', + 'https://preview.twilio.com/wireless/Commands', + null, + $values + ))); + } +}
\ No newline at end of file diff --git a/Twilio/Tests/Integration/Preview/Wireless/Device/UsageTest.php b/Twilio/Tests/Integration/Preview/Wireless/Device/UsageTest.php new file mode 100644 index 0000000..b9a2b9e --- /dev/null +++ b/Twilio/Tests/Integration/Preview/Wireless/Device/UsageTest.php @@ -0,0 +1,33 @@ +<?php + +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ + +namespace Twilio\Tests\Integration\Preview\Wireless\Device; + +use Twilio\Exceptions\DeserializeException; +use Twilio\Exceptions\TwilioException; +use Twilio\Http\Response; +use Twilio\Tests\HolodeckTestCase; +use Twilio\Tests\Request; + +class UsageTest extends HolodeckTestCase { + public function testFetchRequest() { + $this->holodeck->mock(new Response(500, '')); + + try { + $this->twilio->preview->wireless->devices("sid") + ->usage()->fetch(); + } catch (DeserializeException $e) {} + catch (TwilioException $e) {} + + $this->assertTrue($this->holodeck->hasRequest(new Request( + 'get', + 'https://preview.twilio.com/wireless/Devices/sid/Usage' + ))); + } +}
\ No newline at end of file diff --git a/Twilio/Tests/Integration/Preview/Wireless/DeviceTest.php b/Twilio/Tests/Integration/Preview/Wireless/DeviceTest.php new file mode 100644 index 0000000..e2ad327 --- /dev/null +++ b/Twilio/Tests/Integration/Preview/Wireless/DeviceTest.php @@ -0,0 +1,80 @@ +<?php + +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ + +namespace Twilio\Tests\Integration\Preview\Wireless; + +use Twilio\Exceptions\DeserializeException; +use Twilio\Exceptions\TwilioException; +use Twilio\Http\Response; +use Twilio\Tests\HolodeckTestCase; +use Twilio\Tests\Request; + +class DeviceTest extends HolodeckTestCase { + public function testFetchRequest() { + $this->holodeck->mock(new Response(500, '')); + + try { + $this->twilio->preview->wireless->devices("sid")->fetch(); + } catch (DeserializeException $e) {} + catch (TwilioException $e) {} + + $this->assertTrue($this->holodeck->hasRequest(new Request( + 'get', + 'https://preview.twilio.com/wireless/Devices/sid' + ))); + } + + public function testReadRequest() { + $this->holodeck->mock(new Response(500, '')); + + try { + $this->twilio->preview->wireless->devices->read(); + } catch (DeserializeException $e) {} + catch (TwilioException $e) {} + + $this->assertTrue($this->holodeck->hasRequest(new Request( + 'get', + 'https://preview.twilio.com/wireless/Devices' + ))); + } + + public function testCreateRequest() { + $this->holodeck->mock(new Response(500, '')); + + try { + $this->twilio->preview->wireless->devices->create("ratePlan"); + } catch (DeserializeException $e) {} + catch (TwilioException $e) {} + + $values = array( + 'RatePlan' => "ratePlan", + ); + + $this->assertTrue($this->holodeck->hasRequest(new Request( + 'post', + 'https://preview.twilio.com/wireless/Devices', + null, + $values + ))); + } + + public function testUpdateRequest() { + $this->holodeck->mock(new Response(500, '')); + + try { + $this->twilio->preview->wireless->devices("sid")->update(); + } catch (DeserializeException $e) {} + catch (TwilioException $e) {} + + $this->assertTrue($this->holodeck->hasRequest(new Request( + 'post', + 'https://preview.twilio.com/wireless/Devices/sid' + ))); + } +}
\ No newline at end of file diff --git a/Twilio/Tests/Integration/Preview/Wireless/RatePlanTest.php b/Twilio/Tests/Integration/Preview/Wireless/RatePlanTest.php new file mode 100644 index 0000000..4d9fc5d --- /dev/null +++ b/Twilio/Tests/Integration/Preview/Wireless/RatePlanTest.php @@ -0,0 +1,46 @@ +<?php + +/** + * This code was generated by + * \ / _ _ _| _ _ + * | (_)\/(_)(_|\/| |(/_ v1.0.0 + * / / + */ + +namespace Twilio\Tests\Integration\Preview\Wireless; + +use Twilio\Exceptions\DeserializeException; +use Twilio\Exceptions\TwilioException; +use Twilio\Http\Response; +use Twilio\Tests\HolodeckTestCase; +use Twilio\Tests\Request; + +class RatePlanTest extends HolodeckTestCase { + public function testReadRequest() { + $this->holodeck->mock(new Response(500, '')); + + try { + $this->twilio->preview->wireless->ratePlans->read(); + } catch (DeserializeException $e) {} + catch (TwilioException $e) {} + + $this->assertTrue($this->holodeck->hasRequest(new Request( + 'get', + 'https://preview.twilio.com/wireless/RatePlans' + ))); + } + + public function testFetchRequest() { + $this->holodeck->mock(new Response(500, '')); + + try { + $this->twilio->preview->wireless->ratePlans("sid")->fetch(); + } catch (DeserializeException $e) {} + catch (TwilioException $e) {} + + $this->assertTrue($this->holodeck->hasRequest(new Request( + 'get', + 'https://preview.twilio.com/wireless/RatePlans/sid' + ))); + } +}
\ No newline at end of file |