/** * Safety net around register_shutdown_function of Maintenance.php */ public function __destruct() { if (!$this->shutdownSimulated && !$this->testCase->hasFailed()) { // Someone generated a MaintenanceFixup instance without calling // simulateShutdown. We'd have to raise a PHPUnit exception to correctly // flag this illegal usage. However, we are already in a destruktor, which // would trigger undefined behaviour. Hence, we can only report to the // error output :( Hopefully people read the PHPUnit output. fwrite(STDERR, "ERROR! Instance of " . __CLASS__ . " destructed without " . "calling simulateShutdown method. Call simulateShutdown on the " . "instance before it gets destructed."); } // The following guard is required, as PHP does not offer default destructors :( if (is_callable("parent::__destruct")) { parent::__destruct(); } }