Skip to content

Commit

Permalink
feat: move tests around
Browse files Browse the repository at this point in the history
  • Loading branch information
cb-freddysart committed Jan 3, 2024
1 parent dee9372 commit a2aedb9
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 21 deletions.
20 changes: 0 additions & 20 deletions tests/conf_callback_oauthbearer.phpt

This file was deleted.

2 changes: 1 addition & 1 deletion tests/conf_callbacks.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
RdKafka\Conf
--SKIPIF--
<?php
RD_KAFKA_VERSION >= 0x090000 || die("skip librdkafka too old");
(RD_KAFKA_VERSION >= 0x090000 && RD_KAFKA_VERSION < 0x020300ff) || die("skip librdkafka too old");
--FILE--
<?php

Expand Down
39 changes: 39 additions & 0 deletions tests/conf_callbacks_rdkafka23.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
--TEST--
RdKafka\Conf
--SKIPIF--
<?php
RD_KAFKA_VERSION >= 0x020300ff || die("skip librdkafka too old");
--FILE--
<?php

$conf = new RdKafka\Conf();

echo "Setting consume callback\n";
$conf->setConsumeCb(function () { });
$dump = $conf->dump();
var_dump(isset($dump["consume_cb"]));

echo "Setting offset_commit callback\n";
$conf->setOffsetCommitCb(function () { });
$dump = $conf->dump();
var_dump(isset($dump["offset_commit_cb"]));

echo "Setting rebalance callback\n";
$conf->setRebalanceCb(function () { });
$dump = $conf->dump();
var_dump(isset($dump["rebalance_cb"]));

echo "Setting oauth token bearer callback\n";
$conf->setOauthbearerTokenRefreshCb(function () {});
$dump = $conf->dump();
var_dump(isset($dump["oauthbearer_token_refresh_cb"]));

--EXPECT--
Setting consume callback
bool(true)
Setting offset_commit callback
bool(true)
Setting rebalance callback
bool(true)
Setting oauth token bearer callback
bool(true)

0 comments on commit a2aedb9

Please sign in to comment.