@@ 35-42 (lines=8) @@ | ||
32 | assertThat($this->factory, is(anInstanceOf('Graze\Queue\Message\MessageFactoryInterface'))); |
|
33 | } |
|
34 | ||
35 | public function testCreateMessage() |
|
36 | { |
|
37 | $message = $this->factory->createMessage('foo'); |
|
38 | ||
39 | assertThat($message, is(anInstanceOf('Graze\Queue\Message\MessageInterface'))); |
|
40 | assertThat($message->getBody(), is(identicalTo('foo'))); |
|
41 | assertThat($message->isValid(), is(identicalTo(true))); |
|
42 | } |
|
43 | ||
44 | public function testCreateMessageWithMetadata() |
|
45 | { |
|
@@ 53-64 (lines=12) @@ | ||
50 | assertThat($message->getMetadata()->get('bar'), is(identicalTo('baz'))); |
|
51 | } |
|
52 | ||
53 | public function testCreateMessageWithValidator() |
|
54 | { |
|
55 | $message = $this->factory->createMessage('bar', [ |
|
56 | 'validator' => function ($msg) { |
|
57 | return false; |
|
58 | }, |
|
59 | ]); |
|
60 | ||
61 | assertThat($message, is(anInstanceOf('Graze\Queue\Message\MessageInterface'))); |
|
62 | assertThat($message->getBody(), is(identicalTo('bar'))); |
|
63 | assertThat($message->isValid(), is(identicalTo(false))); |
|
64 | } |
|
65 | } |
|
66 |