Skip to content

Commit

Permalink
Updated tests & bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
sethsandaru committed Mar 13, 2024
1 parent 1c70795 commit 8dd16b2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "shipsaas/laravel-inbox-process",
"type": "library",
"version": "1.0.0",
"version": "1.1.0",
"description": "Inbox pattern process implementation for your Laravel Applications",
"keywords": [
"laravel library",
Expand Down
6 changes: 6 additions & 0 deletions tests/Unit/Entities/InboxMessageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,33 @@ public function testMakeReturnsInboxMessageWithPayload()
{
$inboxMsg = InboxMessage::make((object) [
'id' => 1000,
'external_id' => 'fake-id',
'payload' => '{"hello": "world"}',
]);

$this->assertSame(1000, $inboxMsg->id);
$this->assertSame('fake-id', $inboxMsg->externalId);
$this->assertSame('{"hello": "world"}', $inboxMsg->rawPayload);
}

public function testMakeReturnsInboxMessageWithNoPayload()
{
$inboxMsg = InboxMessage::make((object) [
'id' => 1000,
'external_id' => 'fake-id',
'payload' => null,
]);

$this->assertSame(1000, $inboxMsg->id);
$this->assertSame('fake-id', $inboxMsg->externalId);
$this->assertSame('{}', $inboxMsg->rawPayload);
}

public function testGetParsedPayloadReturnsAnArray()
{
$inboxMsg = InboxMessage::make((object) [
'id' => 1000,
'external_id' => 'fake-id',
'payload' => '{"hello": "world"}',
]);

Expand All @@ -46,6 +51,7 @@ public function testGetParsedPayloadReturnsAnEmptyArray()
$inboxMsg = InboxMessage::make((object) [
'id' => 1000,
'payload' => null,
'external_id' => 'fake-id',
]);

$this->assertSame([], $inboxMsg->getParsedPayload());
Expand Down

0 comments on commit 8dd16b2

Please sign in to comment.