Skip to content

Commit 45bc208

Browse files
committed
Add test for custom ID
1 parent 6efb47e commit 45bc208

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

tests/Unit/Jobs/PubSubJobTests.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public function teardown()
2121
public function setUp()
2222
{
2323
$this->messageId = '1234';
24-
$this->messageData = json_encode(['foo' => 'bar']);
24+
$this->messageData = json_encode(['id' => $this->messageId, 'foo' => 'bar']);
2525
$this->messageEncodedData = base64_encode($this->messageData);
2626

2727
$this->container = $this->createMock(Container::class);

tests/Unit/PubSubQueueTests.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public function teardown()
2323

2424
public function setUp()
2525
{
26-
$this->result = ['message-id'];
26+
$this->result = 'message-id';
2727

2828
$this->topic = $this->createMock(Topic::class);
2929
$this->client = $this->createMock(PubSubClient::class);
@@ -81,7 +81,9 @@ public function testPushRaw()
8181
$queue->method('subscribeToTopic')
8282
->willReturn($this->subscription);
8383

84-
$this->assertEquals($this->result, $queue->pushRaw('test'));
84+
$payload = base64_encode(json_encode(['id' => $this->result]));
85+
86+
$this->assertEquals($this->result, $queue->pushRaw($payload));
8587
}
8688

8789
public function testLater()

0 commit comments

Comments
 (0)