addBrokers example

$this->assertDumpMatchesFormat($expectedDump$conf);
    }

    public function testDumpProducer()
    {
        if (!$this->hasBroker) {
            $this->markTestSkipped('Test requires an active broker');
        }

        $producer = new Producer(new Conf());
        $producer->addBrokers($this->broker);

        $expectedDump = <<<EODUMP RdKafka\Producer { %Aout_q_len: %d orig_broker_id: 1001 orig_broker_name: "$this->broker/1001" brokers: RdKafka\Metadata\Collection { +0: RdKafka\Metadata\Broker { id: 1001 host: "%s" port: %d } } topics: RdKafka\Metadata\Collection { +0: RdKafka\Metadata\Topic { name: "%s" partitions: RdKafka\Metadata\Collection { +0: RdKafka\Metadata\Partition { id: 0 err: 0 leader: 1001 }%A } }%A } }
Home | Imprint | This part of the site doesn't use cookies.