Skip to content

Commit 65134d7

Browse files
committed
Fix tests
1 parent 879e6fb commit 65134d7

1 file changed

Lines changed: 10 additions & 7 deletions

File tree

pkg/rdkafka/Tests/RdKafkaProducerTest.php

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,18 +45,20 @@ public function testThrowIfMessageInvalid()
4545

4646
public function testShouldUseSerializerToEncodeMessageAndPutToExpectedTube()
4747
{
48-
$message = new RdKafkaMessage('theBody', ['foo' => 'fooVal'], ['bar' => 'barVal']);
48+
$messageHeaders = ['bar' => 'barVal'];
49+
$message = new RdKafkaMessage('theBody', ['foo' => 'fooVal'], $messageHeaders);
4950
$message->setKey('key');
5051

5152
$kafkaTopic = $this->createKafkaTopicMock();
5253
$kafkaTopic
5354
->expects($this->once())
54-
->method('produce')
55+
->method('producev')
5556
->with(
5657
RD_KAFKA_PARTITION_UA,
5758
0,
5859
'theSerializedMessage',
59-
'key'
60+
'key',
61+
$messageHeaders
6062
)
6163
;
6264

@@ -87,7 +89,7 @@ public function testShouldPassNullAsTopicConfigIfNotSetOnTopic()
8789
$kafkaTopic = $this->createKafkaTopicMock();
8890
$kafkaTopic
8991
->expects($this->once())
90-
->method('produce')
92+
->method('producev')
9193
;
9294

9395
$kafkaProducer = $this->createKafkaProducerMock();
@@ -123,7 +125,7 @@ public function testShouldPassCustomConfAsTopicConfigIfSetOnTopic()
123125
$kafkaTopic = $this->createKafkaTopicMock();
124126
$kafkaTopic
125127
->expects($this->once())
126-
->method('produce')
128+
->method('producev')
127129
;
128130

129131
$kafkaProducer = $this->createKafkaProducerMock();
@@ -165,13 +167,14 @@ public function testShouldAllowGetPreviouslySetSerializer()
165167

166168
public function testShouldAllowSerializersToSerializeKeys()
167169
{
168-
$message = new RdKafkaMessage('theBody', ['foo' => 'fooVal'], ['bar' => 'barVal']);
170+
$messageHeaders = ['bar' => 'barVal'];
171+
$message = new RdKafkaMessage('theBody', ['foo' => 'fooVal'], $messageHeaders);
169172
$message->setKey('key');
170173

171174
$kafkaTopic = $this->createKafkaTopicMock();
172175
$kafkaTopic
173176
->expects($this->once())
174-
->method('produce')
177+
->method('producev')
175178
->with(
176179
RD_KAFKA_PARTITION_UA,
177180
0,

0 commit comments

Comments
 (0)