forked from lanlin/nylas-php
-
Notifications
You must be signed in to change notification settings - Fork 0
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
13 changed files
with
169 additions
and
65 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
Binary file not shown.
Binary file not shown.
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 |
---|---|---|
|
@@ -20,11 +20,21 @@ class ResourceTest extends AbsCase | |
|
||
public function testReturnAllMessagesToBeSent(): void | ||
{ | ||
$this->mockResponse([]); | ||
$this->mockResponse([ | ||
[ | ||
'object' => 'room_resource', | ||
'email' => '[email protected]', | ||
'name' => 'Training Room 1A', | ||
'capacity' => '8', | ||
'building' => 'West Building', | ||
'floor_name' => '7', | ||
'floor_number' => '7', | ||
], | ||
]); | ||
|
||
$data = $this->client->Rooms->Resource->returnRoomResourceInformation(); | ||
|
||
$this->assertArrayHasKey('account_id', $data[0]); | ||
$this->assertArrayHasKey('email', $data[0]); | ||
} | ||
|
||
// ------------------------------------------------------------------------------ | ||
|
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
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,62 @@ | ||
<?php | ||
|
||
namespace Tests\Webhooks; | ||
|
||
use Exception; | ||
use Tests\AbsCase; | ||
|
||
/** | ||
* ---------------------------------------------------------------------------------- | ||
* Webhook Test | ||
* ---------------------------------------------------------------------------------- | ||
* | ||
* @author lanlin | ||
* @change 2021/09/30 | ||
* | ||
* @internal | ||
*/ | ||
class SignatureTest extends AbsCase | ||
{ | ||
// ------------------------------------------------------------------------------ | ||
|
||
public function testEchoChallenge(): void | ||
{ | ||
$this->client->Webhooks->Signature->echoChallenge(); | ||
|
||
$this->assertPassed(); | ||
} | ||
|
||
// ------------------------------------------------------------------------------ | ||
|
||
public function testGetNotification(): void | ||
{ | ||
$this->expectException(Exception::class); | ||
|
||
$this->client->Webhooks->Signature->getNotification(); | ||
} | ||
|
||
// ------------------------------------------------------------------------------ | ||
|
||
public function testParseNotification(): void | ||
{ | ||
$params = \json_encode(['deltas' => ['aaa' => 'bbb']]); | ||
|
||
$data = $this->client->Webhooks->Signature->parseNotification($params); | ||
|
||
$this->assertArrayHasKey('aaa', $data); | ||
} | ||
|
||
// ------------------------------------------------------------------------------ | ||
|
||
public function testXSignatureVerification(): void | ||
{ | ||
$para = $this->faker->name; | ||
$code = $this->faker->uuid; | ||
|
||
$data = $this->client->Webhooks->Signature->xSignatureVerification($code, $para); | ||
|
||
$this->assertFalse($data); | ||
} | ||
|
||
// ------------------------------------------------------------------------------ | ||
} |
Oops, something went wrong.