Codeception\Module\WPCLI::cli PHP Method

cli() public method

The method is a wrapper around isolated calls to the wp-cli tool. The library will use its own wp-cli version to run the commands.
public cli ( string $userCommand = 'core version', &$output = [] ) : integer
$userCommand string The string of command and parameters as it would be passed to wp-cli e.g. a terminal call like `wp core version` becomes `core version` omitting the call to wp-cli script.
return integer wp-cli exit value for the command
    public function cli($userCommand = 'core version', &$output = [])
    {
        $this->initPaths();
        $command = $this->buildCommand($userCommand);
        $output = [];
        $this->debugSection('command', $command);
        $status = $this->executor->exec($command, $output);
        $this->debugSection('output', $output);
        $this->evaluateStatus($output, $status);
        return $status == 0 ? true : $status;
    }