24 use PHPUnit_Framework_Error_Notice;
32 if ( !class_exists(
'AvroStringIO' ) ) {
33 $this->markTestSkipped(
'Avro is required for the AvroFormatterTest' );
40 $this->setExpectedException(
41 'PHPUnit_Framework_Error_Notice',
42 "The schema for channel 'marty' is not available"
44 $formatter->format( [
'channel' =>
'marty' ] );
49 $noticeEnabled = PHPUnit_Framework_Error_Notice::$enabled;
51 PHPUnit_Framework_Error_Notice::$enabled =
false;
53 \Wikimedia\suppressWarnings();
54 $res = $formatter->format( [
'channel' =>
'marty' ] );
55 \Wikimedia\restoreWarnings();
56 PHPUnit_Framework_Error_Notice::$enabled = $noticeEnabled;
57 $this->assertNull(
$res );
63 'schema' => [
'type' =>
'string' ],
64 'revision' => 1010101,
67 $res = $formatter->format( [
68 'channel' =>
'string',
69 'context' =>
'better to be',
71 $this->assertNotNull(
$res );
74 $this->assertEquals(
'AAAAAAAAD2m1GGJldHRlciB0byBiZQ==', base64_encode(
$res ) );