-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add `AccountSmsSendersEndpoint` and `AccountSmsSender` resource * Fix csf and tests
- Loading branch information
1 parent
cb73176
commit a22135b
Showing
7 changed files
with
80 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
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 | ||
|
||
declare(strict_types=1); | ||
|
||
namespace DigitalCz\DigiSign\Endpoint; | ||
|
||
use DigitalCz\DigiSign\Endpoint\Traits\GetEndpointTrait; | ||
use DigitalCz\DigiSign\Endpoint\Traits\ListEndpointTrait; | ||
use DigitalCz\DigiSign\Resource\AccountSmsSender; | ||
use DigitalCz\DigiSign\Resource\ListResource; | ||
|
||
/** | ||
* @extends ResourceEndpoint<AccountSmsSender> | ||
* @method ListResource<AccountSmsSender> list(array $query = []) | ||
* @method AccountSmsSender get(string $id) | ||
*/ | ||
class AccountSmsSendersEndpoint extends ResourceEndpoint | ||
{ | ||
/** @use ListEndpointTrait<AccountSmsSender> */ | ||
use ListEndpointTrait; | ||
use GetEndpointTrait; | ||
|
||
public function __construct(AccountEndpoint $parent) | ||
{ | ||
parent::__construct($parent, '/sms-senders', AccountSmsSender::class); | ||
} | ||
} |
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,16 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace DigitalCz\DigiSign\Resource; | ||
|
||
use DigitalCz\DigiSign\Resource\Traits\EntityResourceTrait; | ||
|
||
class AccountSmsSender extends BaseResource | ||
{ | ||
use EntityResourceTrait; | ||
|
||
public string $name; | ||
|
||
public ?string $createdBy; | ||
} |
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
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,28 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace DigitalCz\DigiSign\Endpoint; | ||
|
||
/** | ||
* @covers \DigitalCz\DigiSign\Endpoint\AccountSmsSendersEndpoint | ||
*/ | ||
class AccountSmsSenderEndpointTest extends EndpointTestCase | ||
{ | ||
public function testList(): void | ||
{ | ||
self::endpoint()->list(); | ||
self::assertLastRequest('GET', '/api/account/sms-senders'); | ||
} | ||
|
||
public function testGet(): void | ||
{ | ||
self::endpoint()->get('foo'); | ||
self::assertLastRequest('GET', '/api/account/sms-senders/foo'); | ||
} | ||
|
||
protected static function endpoint(): AccountSmsSendersEndpoint | ||
{ | ||
return self::dgs()->account()->smsSenders(); | ||
} | ||
} |