-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update ApiRequestor.php Fixed params for isset() * Added OutboundVoiceProfile Added OutboundVoiceProfile * Create OutboundVoiceProfileTest.php Create OutboundVoiceProfileTest.php
- Loading branch information
Showing
4 changed files
with
85 additions
and
0 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
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
namespace Telnyx; | ||
|
||
/** | ||
* Class OutboundVoiceProfile | ||
* | ||
* @package Telnyx | ||
*/ | ||
class OutboundVoiceProfile extends ApiResource | ||
{ | ||
const OBJECT_NAME = "outbound_voice_profile"; | ||
|
||
use ApiOperations\All; | ||
use ApiOperations\Create; | ||
use ApiOperations\Delete; | ||
use ApiOperations\Retrieve; | ||
use ApiOperations\Update; | ||
|
||
} |
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
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 |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<?php | ||
|
||
namespace Telnyx; | ||
|
||
class OutboundVoiceProfileTest extends TestCase | ||
{ | ||
const TEST_RESOURCE_ID = '123'; | ||
|
||
public function testIsListable() | ||
{ | ||
$this->expectsRequest( | ||
'get', | ||
'/v2/outbound_voice_profiles' | ||
); | ||
$resources = OutboundVoiceProfile::all(); | ||
$this->assertInstanceOf(\Telnyx\Collection::class, $resources); | ||
$this->assertInstanceOf(\Telnyx\OutboundVoiceProfile::class, $resources[0]); | ||
} | ||
|
||
public function testIsCreatable() | ||
{ | ||
$this->expectsRequest( | ||
'post', | ||
'/v2/outbound_voice_profiles' | ||
); | ||
$resource = OutboundVoiceProfile::create(["daily_spend_limit" => "1"]); | ||
$this->assertInstanceOf(\Telnyx\OutboundVoiceProfile::class, $resource); | ||
} | ||
|
||
public function testIsDeletable() | ||
{ | ||
$resource = OutboundVoiceProfile::retrieve(self::TEST_RESOURCE_ID); | ||
$this->expectsRequest( | ||
'delete', | ||
'/v2/outbound_voice_profiles/' . urlencode(self::TEST_RESOURCE_ID) | ||
); | ||
$resource->delete(); | ||
$this->assertInstanceOf(\Telnyx\OutboundVoiceProfile::class, $resource); | ||
} | ||
|
||
public function testIsRetrievable() | ||
{ | ||
$this->expectsRequest( | ||
'get', | ||
'/v2/outbound_voice_profiles/' . urlencode(self::TEST_RESOURCE_ID) | ||
); | ||
$resource = OutboundVoiceProfile::retrieve(self::TEST_RESOURCE_ID); | ||
$this->assertInstanceOf(\Telnyx\OutboundVoiceProfile::class, $resource); | ||
} | ||
|
||
public function testIsUpdatable() | ||
{ | ||
$this->expectsRequest( | ||
'patch', | ||
'/v2/outbound_voice_profiles/' . urlencode(self::TEST_RESOURCE_ID) | ||
); | ||
$resource = OutboundVoiceProfile::update(self::TEST_RESOURCE_ID, [ | ||
"daily_spend_limit" => "1" | ||
]); | ||
$this->assertInstanceOf(\Telnyx\OutboundVoiceProfile::class, $resource); | ||
} | ||
|
||
} |