public final static function get_behat_command($custombyterm = false, $parallerun = false, $absolutepath = false) {

        $separator = DIRECTORY_SEPARATOR;
        $exec = 'behat';

        // Cygwin uses linux-style directory separators.
        if ($custombyterm && testing_is_cygwin()) {
            $separator = '/';

            // MinGW can not execute .bat scripts.
            if (!testing_is_mingw()) {
                $exec = 'behat.bat';
            }
        }

        // If relative path then prefix relative path.
        if ($absolutepath) {
            $pathprefix = testing_cli_argument_path('/');
            if (!empty($pathprefix)) {
                $pathprefix .= $separator;
            }
        } else {
            $pathprefix = '';
        }

        if (!$parallerun) {
            $command = $pathprefix . 'vendor' . $separator . 'bin' . $separator . $exec;
        } else {
            $command = 'php ' . $pathprefix . 'admin' . $separator . 'tool' . $separator . 'behat' . $separator . 'cli'
                . $separator . 'run.php';
        }
        return $command;
    }