| 1 | 1 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,33 @@ |
| 1 |
+<?php |
|
| 2 |
+ |
|
| 3 |
+namespace Telnyx; |
|
| 4 |
+ |
|
| 5 |
+/** |
|
| 6 |
+ * @internal |
|
| 7 |
+ * @covers \Telnyx\ShortCode |
|
| 8 |
+ */ |
|
| 9 |
+final class ShortCodeTest extends \Telnyx\TestCase |
|
| 10 |
+{
|
|
| 11 |
+ const TEST_RESOURCE_ID = '123'; |
|
| 12 |
+ |
|
| 13 |
+ public function testIsListable() |
|
| 14 |
+ {
|
|
| 15 |
+ $this->expectsRequest( |
|
| 16 |
+ 'get', |
|
| 17 |
+ '/v2/short_codes' |
|
| 18 |
+ ); |
|
| 19 |
+ $resources = ShortCode::all(); |
|
| 20 |
+ $this->assertInstanceOf(\Telnyx\Collection::class, $resources); |
|
| 21 |
+ $this->assertInstanceOf(\Telnyx\ShortCode::class, $resources['data'][0]); |
|
| 22 |
+ } |
|
| 23 |
+ |
|
| 24 |
+ public function testIsRetrievable() |
|
| 25 |
+ {
|
|
| 26 |
+ $this->expectsRequest( |
|
| 27 |
+ 'get', |
|
| 28 |
+ '/v2/short_codes/' . urlencode(self::TEST_RESOURCE_ID) |
|
| 29 |
+ ); |
|
| 30 |
+ $resource = ShortCode::retrieve(self::TEST_RESOURCE_ID); |
|
| 31 |
+ $this->assertInstanceOf(\Telnyx\ShortCode::class, $resource); |
|
| 32 |
+ } |
|
| 33 |
+} |