Skip to content

Commit

Permalink
Add test for custom ID
Browse files Browse the repository at this point in the history
  • Loading branch information
kainxspirits committed Oct 15, 2018
1 parent 6efb47e commit 45bc208
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tests/Unit/Jobs/PubSubJobTests.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function teardown()
public function setUp()
{
$this->messageId = '1234';
$this->messageData = json_encode(['foo' => 'bar']);
$this->messageData = json_encode(['id' => $this->messageId, 'foo' => 'bar']);
$this->messageEncodedData = base64_encode($this->messageData);

$this->container = $this->createMock(Container::class);
Expand Down
6 changes: 4 additions & 2 deletions tests/Unit/PubSubQueueTests.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function teardown()

public function setUp()
{
$this->result = ['message-id'];
$this->result = 'message-id';

$this->topic = $this->createMock(Topic::class);
$this->client = $this->createMock(PubSubClient::class);
Expand Down Expand Up @@ -81,7 +81,9 @@ public function testPushRaw()
$queue->method('subscribeToTopic')
->willReturn($this->subscription);

$this->assertEquals($this->result, $queue->pushRaw('test'));
$payload = base64_encode(json_encode(['id' => $this->result]));

$this->assertEquals($this->result, $queue->pushRaw($payload));
}

public function testLater()
Expand Down

0 comments on commit 45bc208

Please sign in to comment.