use MediaWikiTestCase;
use Monolog\Logger;
+use Wikimedia\TestingAccessWrapper;
+/**
+ * @covers \MediaWiki\Logger\Monolog\KafkaHandler
+ */
class KafkaHandlerTest extends MediaWikiTestCase {
protected function setUp() {
->method( 'send' )
->will( $this->returnValue( true ) );
// evil hax
- \TestingAccessWrapper::newFromObject( $mockMethod )->matcher->parametersMatcher =
+ TestingAccessWrapper::newFromObject( $mockMethod )->matcher->parametersMatcher =
new \PHPUnit_Framework_MockObject_Matcher_ConsecutiveParameters( [
[ $this->anything(), $this->anything(), [ 'words' ] ],
[ $this->anything(), $this->anything(), [ 'lines' ] ]
] );
- $formatter = $this->createMock( 'Monolog\Formatter\FormatterInterface' );
+ $formatter = $this->createMock( \Monolog\Formatter\FormatterInterface::class );
$formatter->expects( $this->any() )
->method( 'format' )
->will( $this->onConsecutiveCalls( 'words', null, 'lines' ) );
->method( 'send' )
->will( $this->returnValue( true ) );
- $formatter = $this->createMock( 'Monolog\Formatter\FormatterInterface' );
+ $formatter = $this->createMock( \Monolog\Formatter\FormatterInterface::class );
$formatter->expects( $this->any() )
->method( 'format' )
->will( $this->onConsecutiveCalls( 'words', null, 'lines' ) );