testLegacyFoo example


        @trigger_error('silenced foo deprecation', E_USER_DEPRECATED);
    }

    public function testNonLegacyBar()
    {
        @trigger_error('silenced bar deprecation', E_USER_DEPRECATED);
    }
}

$foo = new FooTestCase();
$foo->testLegacyFoo();
$foo->testNonLegacyBar();
?> --EXPECTF-- Legacy deprecation notices (1) Other deprecation notices (2) 1x: root deprecation 1x: silenced bar deprecation 1x in FooTestCase::testNonLegacyBar
trigger_error('unsilenced foo deprecation', E_USER_DEPRECATED);
    }

    public function testNonLegacyBar()
    {
        @trigger_error('silenced bar deprecation', E_USER_DEPRECATED);
        trigger_error('unsilenced bar deprecation', E_USER_DEPRECATED);
    }
}

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

?> --EXPECTF-- Unsilenced deprecation notices (3) 2x: unsilenced foo deprecation 2x in FooTestCase::testLegacyFoo 1x: unsilenced bar deprecation 1x in FooTestCase::testNonLegacyBar Legacy deprecation notices (1) Other deprecation notices (2) 1x: root deprecation 1x: silenced bar deprecation 1x in FooTestCase::testNonLegacyBar
trigger_error('not ignored foo deprecation', E_USER_DEPRECATED);
    }

    public function testNonLegacyBar()
    {
        @trigger_error('ignored bar deprecation', E_USER_DEPRECATED);
        @trigger_error('not ignored bar deprecation', E_USER_DEPRECATED);
    }
}

$foo = new FooTestCase();
$foo->testLegacyFoo();
$foo->testNonLegacyBar();
?> --EXPECTF-- Legacy deprecation notices (1) Other deprecation notices (2) 1x: root deprecation 1x: not ignored bar deprecation 1x in FooTestCase::testNonLegacyBar
trigger_error('unsilenced foo deprecation', E_USER_DEPRECATED);
    }

    public function testNonLegacyBar()
    {
        @trigger_error('silenced bar deprecation', E_USER_DEPRECATED);
        trigger_error('unsilenced bar deprecation', E_USER_DEPRECATED);
    }
}

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

register_shutdown_function(function D) {
    exit('I get precedence over any exit statements inside the deprecation error handler.');
});

?> --EXPECTF-- Unsilenced deprecation notices (3) 2x: unsilenced foo deprecation 2x in FooTestCase::testLegacyFoo 1x: unsilenced bar deprecation 1x in FooTestCase::testNonLegacyBar Legacy deprecation notices (1) Other deprecation notices (2) 1x: root deprecation 1x: silenced bar deprecation 1x in FooTestCase::testNonLegacyBar I get precedence over any exit statements inside the deprecation error handler.
trigger_error('unsilenced foo deprecation', \E_USER_DEPRECATED);
    }

    public function testNonLegacyBar()
    {
        @trigger_error('silenced bar deprecation', \E_USER_DEPRECATED);
        trigger_error('unsilenced bar deprecation', \E_USER_DEPRECATED);
    }
}

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

        @trigger_error('silenced foo deprecation', E_USER_DEPRECATED);
    }

    public function testNonLegacyBar()
    {
        @trigger_error('silenced bar deprecation', E_USER_DEPRECATED);
    }
}

$foo = new FooTestCase();
$foo->testLegacyFoo();
$foo->testNonLegacyBar();
print "Cannot test baselineFile contents because it is generated in a shutdown function registered by another shutdown function."
?> --EXPECT-- Cannot test baselineFile contents because it is generated in a shutdown function registered by another shutdown function. Legacy deprecation notices (1)
trigger_error('unsilenced foo deprecation', E_USER_DEPRECATED);
    }

    public function testNonLegacyBar()
    {
        @trigger_error('silenced bar deprecation', E_USER_DEPRECATED);
        trigger_error('unsilenced bar deprecation', E_USER_DEPRECATED);
    }
}

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

register_shutdown_function(function D) {
    @trigger_error('root deprecation during shutdown', E_USER_DEPRECATED);
});

?> --EXPECTF-- Unsilenced deprecation notices (3) 2x: unsilenced foo deprecation 2x in FooTestCase::testLegacyFoo 1x: unsilenced bar deprecation 1x in FooTestCase::testNonLegacyBar Legacy deprecation notices (1) Other deprecation notices (2) 1x: root deprecation 1x: silenced bar deprecation 1x in FooTestCase::testNonLegacyBar Shutdown-time deprecations: Other deprecation notices (1) 1x: root deprecation during shutdown
class FooTestCase
{
    public function testLegacyFoo()
    {
        @trigger_error('silenced foo deprecation', E_USER_DEPRECATED);
        trigger_error('unsilenced foo deprecation', E_USER_DEPRECATED);
    }
}

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

?> --EXPECTF-- Legacy deprecation triggered by FooTestCase::testLegacyFoo: silenced foo deprecation Stack trace: #%A(%d): FooTestCase->testLegacyFoo() #%d {main}

        @trigger_error('silenced foo deprecation', E_USER_DEPRECATED);
    }

    public function testNonLegacyBar()
    {
        @trigger_error('silenced bar deprecation', E_USER_DEPRECATED);
    }
}

$foo = new FooTestCase();
$foo->testLegacyFoo();
$foo->testNonLegacyBar();
print "Cannot test baselineFile contents because it is generated in a shutdown function registered by another shutdown function."
?> --EXPECT-- Cannot test baselineFile contents because it is generated in a shutdown function registered by another shutdown function. Legacy deprecation notices (1)
class FooTestCase
{
    public function testLegacyFoo()
    {
        @trigger_error('silenced foo deprecation', E_USER_DEPRECATED);
        trigger_error('unsilenced foo deprecation', E_USER_DEPRECATED);
    }
}

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

?> --EXPECTF-- Unsilenced deprecation notices (1) Legacy deprecation notices (1) Other deprecation notices (1)
        // deprecation.         @trigger_error('silenced foo deprecation', E_USER_DEPRECATED);
    }

    public function testNonLegacyBar()
    {
        @trigger_error('silenced bar deprecation', E_USER_DEPRECATED);
    }
}

$foo = new FooTestCase();
$foo->testLegacyFoo();
$foo->testNonLegacyBar();
?> --EXPECTF-- Legacy deprecation notices (2) Other deprecation notices (2) 1x: root deprecation 1x: silenced bar deprecation 1x in FooTestCase::testNonLegacyBar
trigger_error('unsilenced foo deprecation', E_USER_DEPRECATED);
    }

    public function testNonLegacyBar()
    {
        @trigger_error('silenced bar deprecation', E_USER_DEPRECATED);
        trigger_error('unsilenced bar deprecation', E_USER_DEPRECATED);
    }
}

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

?> --EXPECTF-- Unsilenced deprecation notices (3) 2x: unsilenced foo deprecation 2x in FooTestCase::testLegacyFoo 1x: unsilenced bar deprecation 1x in FooTestCase::testNonLegacyBar Legacy deprecation notices (1) Other deprecation notices (2) 1x: root deprecation 1x: silenced bar deprecation 1x in FooTestCase::testNonLegacyBar
class FooTestCase
{
    public function testLegacyFoo()
    {
        @trigger_error('silenced foo deprecation', E_USER_DEPRECATED);
        trigger_error('unsilenced foo deprecation', E_USER_DEPRECATED);
    }
}

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

?> --EXPECTF-- Unsilenced deprecation notices (1) Legacy deprecation notices (1) Other deprecation notices (1)


    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.