Skip to content

Commit

Permalink
Test messages created from data arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
Thibaud Fabre committed Mar 27, 2016
1 parent a4a23ec commit f01a8c9
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/MessageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,14 @@ public function testMessageCorrelationIdCanBeOverridden()

$this->assertEquals('mock-correlation-id', $message->getCorrelationId());
}

public function testMessageCreatedFromArrayHasJsonEncodedBody()
{
$data = ['mock-key'=>'mock-value'];

$message = Message::fromArray($data, 'mock-id');

$this->assertEquals('mock-id', $message->getCorrelationId());
$this->assertEquals($data, json_decode($message->getBody(), true));
}
}

0 comments on commit f01a8c9

Please sign in to comment.