'Functions are run in the order that they were passed to
L{reactor.callWhenRunning}.'

def test_callWhenRunningOrder(self):

    reactor = self.buildReactor()
    events = []
    reactor.callWhenRunning(events.append, 'first')
    reactor.callWhenRunning(events.append, 'second')
    reactor.callWhenRunning(reactor.stop)
    self.runReactor(reactor)
    self.assertEqual(events, ['first', 'second'])
