protected function addMetaStep($step, $stack)
    {
        if (($this->isTestFile($this->file)) || ($step['class'] == 'Codeception\Scenario')) {
            return;
        }

        $i = count($stack) - self::STACK_POSITION - 1;

        // get into test file and retrieve its actual call
        while (isset($stack[$i])) {
            $step = $stack[$i];
            $i--;
            if (!isset($step['file']) or !isset($step['function']) or !isset($step['class'])) {
                continue;
            }

            if (!$this->isTestFile($step['file'])) {
                continue;
            }

            // in case arguments were passed by reference, copy args array to ensure dereference.  array_values() does not dereference values
            $this->metaStep = new Step\Meta($step['function'], array_map(function ($i) {
                return $i;
            }, array_values($step['args'])));
            $this->metaStep->setTraceInfo($step['file'], $step['line']);

            // pageobjects or other classes should not be included with "I"
            if (!in_array('Codeception\Actor', class_parents($step['class']))) {
                if (isset($step['object'])) {
                    $this->metaStep->setPrefix(get_class($step['object']) . ':');
                    return;
                }

                $this->metaStep->setPrefix($step['class'] . ':');
            }
            return;
        }
    }
protected function addMetaStep($step, $stack)
    {
        if (($this->isTestFile($this->file)) || ($step['class'] == 'Codeception\Scenario')) {
            return;
        }

        $i = count($stack) - self::STACK_POSITION - 1;

        // get into test file and retrieve its actual call
        while (isset($stack[$i])) {
            $step = $stack[$i];
            $i--;
            if (!isset($step['file']) or !isset($step['function']) or !isset($step['class'])) {
                continue;
            }

            if (!$this->isTestFile($step['file'])) {
                continue;
            }

            // in case arguments were passed by reference, copy args array to ensure dereference.  array_values() does not dereference values
            $this->metaStep = new Step\Meta($step['function'], array_map(function ($i) {
                return $i;
            }, array_values($step['args'])));
            $this->metaStep->setTraceInfo($step['file'], $step['line']);

            // pageobjects or other classes should not be included with "I"
            if (!in_array('Codeception\Actor', class_parents($step['class']))) {
                if (isset($step['object'])) {
                    $this->metaStep->setPrefix(get_class($step['object']) . ':');
                    return;
                }

                $this->metaStep->setPrefix($step['class'] . ':');
            }
            return;
        }
    }
protected function addMetaStep ( $ step , $ stack ) { if ( ( $ this -> isTestFile ( $ this -> file ) ) || ( $ step [ 'class' ] == 'Codeception\Scenario' ) ) { return ; } $ i = count ( $ stack ) - self :: STACK_POSITION - 1 ; // get into test file and retrieve its actual call while ( isset ( $ stack [ $ i ] ) ) { $ step = $ stack [ $ i ] ; $ i -- ; if ( ! isset ( $ step [ 'file' ] ) or ! isset ( $ step [ 'function' ] ) or ! isset ( $ step [ 'class' ] ) ) { continue ; } if ( ! $ this -> isTestFile ( $ step [ 'file' ] ) ) { continue ; } // in case arguments were passed by reference, copy args array to ensure dereference.  array_values() does not dereference values $ this -> metaStep = new Step \ Meta ( $ step [ 'function' ] , array_map ( function ( $ i ) { return $ i ; } , array_values ( $ step [ 'args' ] ) ) ) ; $ this -> metaStep -> setTraceInfo ( $ step [ 'file' ] , $ step [ 'line' ] ) ; // pageobjects or other classes should not be included with "I" if ( ! in_array ( 'Codeception\Actor' , class_parents ( $ step [ 'class' ] ) ) ) { if ( isset ( $ step [ 'object' ] ) ) { $ this -> metaStep -> setPrefix ( get_class ( $ step [ 'object' ] ) . ':' ) ; return ; } $ this -> metaStep -> setPrefix ( $ step [ 'class' ] . ':' ) ; } return ; } }
If steps are combined into one method they can be reproduced as meta-step.
We are using stack trace to analyze if steps were called from test, if not - they were called from meta-step.

@param $step
@param $stack
If steps are combined into one method they can be reproduced as meta - step . We are using stack trace to analyze if steps were called from test if not - they were called from meta - step .