public function getContextChain()
    {
        $block_chain = array();

        // This should return all of our before hooks in the order they *should*
        // have been invoked.
        $this->traversePost(function ($block) use (&$block_chain) {
            // Ensure ordering - even if the test defininition interleaves
            // before_all with before DSL invocations, we traverse the context
            // according to the 'before_alls before befores' convention.
            $befores = array_merge($block->beforeAlls(), $block->befores());
            $block_chain = array_merge($block_chain, $befores);
        });

        return array_filter(
            array_map(
                function ($block) {
                    return $block->getContext();
                },
                $block_chain
            )
        );
    }