/** * Run a set of handlers. * * @depends testRegister * @depends testShutdown */ public function testRunHandlers() { self::$testVariable = 0; $handlers = array(); $count = 9; do { $handlers[] = new ShutdownHandler(array(get_class($this), 'shutdown'), array()); } while (--$count); ShutdownHandler::runHandlers(array($handlers[0], $handlers[1], $handlers[2], $handlers[3])); $this->assertSame(4, self::$testVariable); ShutdownHandler::shutdown(); $this->assertSame(9, self::$testVariable); }