-
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.
- Loading branch information
Showing
6 changed files
with
127 additions
and
1 deletion.
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,27 @@ | ||
<?php | ||
|
||
namespace Telnyx; | ||
|
||
/** | ||
* @internal | ||
* @covers \Telnyx\ApiResponse | ||
*/ | ||
final class ApiResponseTest extends \Telnyx\TestCase | ||
{ | ||
public function testConstruct() | ||
{ | ||
$obj = [ | ||
'body' => 'body', | ||
'code' => 'code', | ||
'headers' => 'header', | ||
'json' => 'json' | ||
]; | ||
|
||
$class = new \Telnyx\ApiResponse($obj['body'], $obj['code'], $obj['headers'], $obj['json']); | ||
|
||
static::assertSame($obj['body'], $class->body); | ||
static::assertSame($obj['code'], $class->code); | ||
static::assertSame($obj['headers'], $class->headers); | ||
static::assertSame($obj['json'], $class->json); | ||
} | ||
} |
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,24 @@ | ||
<?php | ||
|
||
namespace Telnyx; | ||
|
||
/** | ||
* @internal | ||
* @covers \Telnyx\ApiOperations\All | ||
*/ | ||
|
||
class DummyAll extends ApiResource | ||
{ | ||
const OBJECT_NAME = 'phone_number'; | ||
|
||
use \Telnyx\ApiOperations\All; | ||
} | ||
|
||
final class AllTest extends \Telnyx\TestCase | ||
{ | ||
public function testTrait() | ||
{ | ||
$result = DummyAll::all(); | ||
$this->assertInstanceOf(\Telnyx\Collection::class, $result); | ||
} | ||
} |
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,26 @@ | ||
<?php | ||
|
||
namespace Telnyx; | ||
|
||
/** | ||
* @internal | ||
* @covers \Telnyx\ApiOperations\Retrieve | ||
*/ | ||
|
||
class DummyRetrieve extends ApiResource | ||
{ | ||
const OBJECT_NAME = 'phone_number'; | ||
|
||
use \Telnyx\ApiOperations\Retrieve; | ||
} | ||
|
||
final class RetrieveTest extends \Telnyx\TestCase | ||
{ | ||
const TEST_RESOURCE_ID = '1293384261075731499'; | ||
|
||
public function testTrait() | ||
{ | ||
$result = DummyRetrieve::retrieve(self::TEST_RESOURCE_ID); | ||
$this->assertInstanceOf(\Telnyx\TelnyxObject::class, $result); | ||
} | ||
} |
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