23 use InvalidArgumentException;
27 use Wikimedia\TestingAccessWrapper;
32 if ( !class_exists(
'Monolog\Formatter\LineFormatter' ) ) {
33 $this->markTestSkipped(
'This test requires monolog to be installed' );
43 $fixture->includeStacktraces(
false );
44 $fixture = TestingAccessWrapper::newFromObject( $fixture );
45 $boom =
new InvalidArgumentException(
'boom', 0,
46 new LengthException(
'too long', 0,
47 new LogicException(
'Spock wuz here' )
50 $out = $fixture->normalizeException( $boom );
51 $this->assertContains(
"\n[Exception InvalidArgumentException]",
$out );
52 $this->assertContains(
"\nCaused by: [Exception LengthException]",
$out );
53 $this->assertContains(
"\nCaused by: [Exception LogicException]",
$out );
54 $this->assertNotContains(
"\n #0",
$out );
62 $fixture->includeStacktraces(
true );
63 $fixture = TestingAccessWrapper::newFromObject( $fixture );
64 $boom =
new InvalidArgumentException(
'boom', 0,
65 new LengthException(
'too long', 0,
66 new LogicException(
'Spock wuz here' )
69 $out = $fixture->normalizeException( $boom );
70 $this->assertContains(
"\n[Exception InvalidArgumentException]",
$out );
71 $this->assertContains(
"\nCaused by: [Exception LengthException]",
$out );
72 $this->assertContains(
"\nCaused by: [Exception LogicException]",
$out );
73 $this->assertContains(
"\n #0",
$out );