/** * Run all shutdown handlers. * * @depends testRegister * @depends testShutdown */ public function testRunAll() { self::$testVariable = 0; $handlers = array(); $count = 9; do { $handlers[] = new ShutdownHandler(array(get_class($this), 'shutdown'), array()); } while (--$count); ShutdownHandler::runAll(); $this->assertSame(9, self::$testVariable); ShutdownHandler::shutdown(); $this->assertSame(9, self::$testVariable); }