summaryrefslogtreecommitdiffstats
path: root/Twilio/Tests/Integration/Notifications/V1/CredentialTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'Twilio/Tests/Integration/Notifications/V1/CredentialTest.php')
-rw-r--r--Twilio/Tests/Integration/Notifications/V1/CredentialTest.php230
1 files changed, 0 insertions, 230 deletions
diff --git a/Twilio/Tests/Integration/Notifications/V1/CredentialTest.php b/Twilio/Tests/Integration/Notifications/V1/CredentialTest.php
deleted file mode 100644
index 4ec955d..0000000
--- a/Twilio/Tests/Integration/Notifications/V1/CredentialTest.php
+++ /dev/null
@@ -1,230 +0,0 @@
-<?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("gcm");
- } catch (DeserializeException $e) {}
- catch (TwilioException $e) {}
-
- $values = array(
- '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("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();
- } catch (DeserializeException $e) {}
- catch (TwilioException $e) {}
-
- $this->assertTrue($this->holodeck->hasRequest(new Request(
- 'post',
- 'https://notifications.twilio.com/v1/Credentials/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
- )));
- }
-
- 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();
-
- $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