FUnit::set_silence PHP Method

set_silence() public static method

This will override the $DEBUG state
public static set_silence ( boolean $state )
$state boolean
    public static function set_silence($state)
    {
        static::debug_out("Setting \$SILENCE to " . (bool) $state);
        static::$SILENCE = (bool) $state;
    }

Usage Example

<?php

/**
 * you should run this standalone (not with the test runner)
 */
use FUnit as fu;
use FUnit\TestSuite;
require_once __DIR__ . '/../../src/FUnit.php';
fu::test('FUnit::set_disable_reporting(true)', function () {
    fu::set_disable_reporting(true);
    fu::equal(true, fu::$disable_reporting, "\$disable_reporting is true");
});
fu::set_silence(true);
fu::set_disable_reporting(false);
fu::run();