Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<?php namespace RdKafka; use PHPUnit\Framework\TestCase; class QueueTest extends TestCa..
Decoded Output download
<?php
namespace RdKafka;
use PHPUnit\Framework\TestCase;
class QueueTest extends TestCase
{
const PARTITION = 0;
/**
* @var ConsumerTopic
*/
private $consumerTopic;
/**
* @var Queue
*/
private $queue;
public function setUp(): void
{
$conf = new Conf();
$conf->set('metadata.broker.list', 'localhost:9092');
$consumer = new Consumer($conf);
$this->consumerTopic = $consumer->newTopic('test');
$this->queue = $consumer->newQueue();
}
public function testConsumeViaQueue()
{
$this->markTestSkipped('Consuming via queue does not work');
$this->consumerTopic->consumeQueueStart(self::PARTITION, RD_KAFKA_OFFSET_BEGINNING, $this->queue);
$this->consumerTopic->consume(self::PARTITION, 100);
$this->consumerTopic->consumeStop(self::PARTITION);
$message = $this->queue->consume(200);
$this->assertInstanceOf(Message::class, $message);
}
}
?>
Did this file decode correctly?
Original Code
<?php
namespace RdKafka;
use PHPUnit\Framework\TestCase;
class QueueTest extends TestCase
{
const PARTITION = 0;
/**
* @var ConsumerTopic
*/
private $consumerTopic;
/**
* @var Queue
*/
private $queue;
public function setUp(): void
{
$conf = new Conf();
$conf->set('metadata.broker.list', 'localhost:9092');
$consumer = new Consumer($conf);
$this->consumerTopic = $consumer->newTopic('test');
$this->queue = $consumer->newQueue();
}
public function testConsumeViaQueue()
{
$this->markTestSkipped('Consuming via queue does not work');
$this->consumerTopic->consumeQueueStart(self::PARTITION, RD_KAFKA_OFFSET_BEGINNING, $this->queue);
$this->consumerTopic->consume(self::PARTITION, 100);
$this->consumerTopic->consumeStop(self::PARTITION);
$message = $this->queue->consume(200);
$this->assertInstanceOf(Message::class, $message);
}
}
Function Calls
None |
Stats
MD5 | bc356cc75feec6712bc960d52cff2b2c |
Eval Count | 0 |
Decode Time | 107 ms |