testLegacyBar example

public function testLegacyBar()
    {
        trigger_error('unsilenced bar deprecation', E_USER_DEPRECATED);
    }
}

@trigger_error('root deprecation', E_USER_DEPRECATED);

$foo = new FooTestCase();
$foo->testLegacyFoo();
$foo->testLegacyBar();

register_shutdown_function(function D) use ($filename) {
    var_dump(file_get_contents($filename));
});
?> --EXPECTF-- string(234) " Unsilenced deprecation notices (3) 2x: unsilenced foo deprecation 2x in FooTestCase::testLegacyFoo 1x: unsilenced bar deprecation 1x in FooTestCase::testLegacyBar Other deprecation notices (1) 1x: root deprecation "
Home | Imprint | This part of the site doesn't use cookies.