use Monolog\Logger;
// not available in the version of phpunit mw uses, so copied into repo
-require_once __DIR__ . '/../../../ConsecutiveParametersMatcher.php';
+require_once __DIR__ . '/../../../phpunit/ConsecutiveParametersMatcher.php';
class KafkaHandlerTest extends MediaWikiTestCase {
- public function setUp() {
- if ( !class_exists( 'Monolog\Handler\AbstractProcessingHandler' ) ) {
- $this->markTestSkipped( 'Monolog is required for the KafkaHandlerTest' );
+ protected function setUp() {
+ if ( !class_exists( 'Monolog\Handler\AbstractProcessingHandler' )
+ || !class_exists( 'Kafka\Produce' )
+ ) {
+ $this->markTestSkipped( 'Monolog and Kafka are required for the KafkaHandlerTest' );
}
+
parent::setUp();
}
$produce = $this->getMockBuilder( 'Kafka\Produce' )
->disableOriginalConstructor()
->getMock();
- $produce->expects($this->any())
- ->method('getAvailablePartitions')
- ->will($this->returnValue( array( 'A' ) ) );
- $produce->expects($this->once())
+ $produce->expects( $this->any() )
+ ->method( 'getAvailablePartitions' )
+ ->will( $this->returnValue( array( 'A' ) ) );
+ $produce->expects( $this->once() )
->method( 'setMessages' )
->with( $expect, $this->anything(), $this->anything() );
}
}
-
public function testBatchHandlesNullFormatterResult() {
$produce = $this->getMockBuilder( 'Kafka\Produce' )
->disableOriginalConstructor()