public static function drop_site($displayprogress = false) {
        global $DB, $CFG;

        if (!self::is_test_site()) {
            phpunit_bootstrap_error(PHPUNIT_EXITCODE_CONFIGERROR, 'Can not drop non-test site!!');
        }

        // Purge dataroot
        if ($displayprogress) {
            echo "Purging dataroot:\n";
        }

        self::reset_dataroot();
        testing_initdataroot($CFG->dataroot, 'phpunit');

        // Drop all tables.
        self::drop_database($displayprogress);

        // Drop dataroot.
        self::drop_dataroot();
    }
public static function drop_site($displayprogress = false) {
        global $DB, $CFG;

        if (!self::is_test_site()) {
            phpunit_bootstrap_error(PHPUNIT_EXITCODE_CONFIGERROR, 'Can not drop non-test site!!');
        }

        // Purge dataroot
        if ($displayprogress) {
            echo "Purging dataroot:\n";
        }

        self::reset_dataroot();
        testing_initdataroot($CFG->dataroot, 'phpunit');

        // Drop all tables.
        self::drop_database($displayprogress);

        // Drop dataroot.
        self::drop_dataroot();
    }
public static function drop_site ( $ displayprogress = false ) { global $ DB , $ CFG ; if ( ! self :: is_test_site ( ) ) { phpunit_bootstrap_error ( PHPUNIT_EXITCODE_CONFIGERROR , 'Can not drop non-test site!!' ) ; } // Purge dataroot if ( $ displayprogress ) { echo "Purging dataroot:\n" ; } self :: reset_dataroot ( ) ; testing_initdataroot ( $ CFG -> dataroot , 'phpunit' ) ; // Drop all tables. self :: drop_database ( $ displayprogress ) ; // Drop dataroot. self :: drop_dataroot ( ) ; }
Drop all test site data.

Note: To be used from CLI scripts only.

@static
@param bool $displayprogress if true, this method will echo progress information.
@return void may terminate execution with exit code
Drop all test site data .