/** * Safety net around register_shutdown_function of Maintenance.php */ public function __destruct() { if (!$this->shutdownSimulated) { // 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 behavior. Hence, we can only report to the // error output :( Hopefully people read the PHPUnit output. $name = $this->testCase->getName(); fwrite(STDERR, "ERROR! Instance of " . __CLASS__ . " for test {$name} " . "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(); } }