Skip to content

Commit 947eb72

Browse files
authored
Merge pull request #813 from sylfabre/patch-1
better doc for traceable message producer
2 parents 0bd4136 + 21e8926 commit 947eb72

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

docs/bundle/functional_testing.md

+6-5
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ enqueue:
3434
3535
## Traceable message producer
3636
37-
Imagine you have a service that internally sends a message and you have to find out was the message sent or not.
37+
Imagine you have a service `my_service` with a method `someMethod()` that internally sends a message and you have to find out was the message sent or not.
3838
There is a solution for that. You have to enable traceable message producer in test environment.
3939

4040
```yaml
@@ -65,10 +65,11 @@ class FooTest extends WebTestCase
6565
6666
public function testMessageSentToFooTopic()
6767
{
68-
$service = $this->client->getContainer()->get('a_service');
68+
// Use your own business logic here:
69+
$service = $this->client->getContainer()->get('my_service');
6970
70-
// the method calls inside $producer->send('fooTopic', 'messageBody');
71-
$service->do();
71+
// someMethod() is part of your business logic and is calling somewhere $producer->send('fooTopic', 'messageBody');
72+
$service->someMethod();
7273
7374
$traces = $this->getProducer()->getTopicTraces('fooTopic');
7475
@@ -86,4 +87,4 @@ class FooTest extends WebTestCase
8687
}
8788
```
8889

89-
[back to index](../index.md)
90+
[back to index](../index.md)

0 commit comments

Comments
 (0)