24 use PHPUnit_Framework_Error_Notice;
29 if ( !class_exists(
'AvroStringIO' ) ) {
30 $this->markTestSkipped(
'Avro is required for the AvroFormatterTest' );
37 $this->setExpectedException(
38 'PHPUnit_Framework_Error_Notice',
39 "The schema for channel 'marty' is not available"
41 $formatter->format( [
'channel' =>
'marty' ] );
46 $noticeEnabled = PHPUnit_Framework_Error_Notice::$enabled;
48 PHPUnit_Framework_Error_Notice::$enabled =
false;
50 \MediaWiki\suppressWarnings();
51 $res = $formatter->format( [
'channel' =>
'marty' ] );
52 \MediaWiki\restoreWarnings();
53 PHPUnit_Framework_Error_Notice::$enabled = $noticeEnabled;
54 $this->assertNull(
$res );
60 'schema' => [
'type' =>
'string' ],
61 'revision' => 1010101,
64 $res = $formatter->format( [
65 'channel' =>
'string',
66 'context' =>
'better to be',
68 $this->assertNotNull(
$res );
71 $this->assertEquals(
'AAAAAAAAD2m1GGJldHRlciB0byBiZQ==', base64_encode(
$res ) );