public function runShellCommand($command, $failNonZero = true)
    {
        $data = [];
        exec("$command", $data, $resultCode);
        $this->result = $resultCode;
        $this->output = implode("\n", $data);
        if ($this->output === null) {
            \PHPUnit\Framework\Assert::fail("$command can't be executed");
        }
        if ($resultCode !== 0 && $failNonZero) {
            \PHPUnit\Framework\Assert::fail("Result code was $resultCode.\n\n" . $this->output);
        }
        $this->debug(preg_replace('~s/\e\[\d+(?>(;\d+)*)m//g~', '', $this->output));
    }
public function runShellCommand($command, $failNonZero = true)
    {
        $data = [];
        exec("$command", $data, $resultCode);
        $this->result = $resultCode;
        $this->output = implode("\n", $data);
        if ($this->output === null) {
            \PHPUnit\Framework\Assert::fail("$command can't be executed");
        }
        if ($resultCode !== 0 && $failNonZero) {
            \PHPUnit\Framework\Assert::fail("Result code was $resultCode.\n\n" . $this->output);
        }
        $this->debug(preg_replace('~s/\e\[\d+(?>(;\d+)*)m//g~', '', $this->output));
    }
public function runShellCommand ( $ command , $ failNonZero = true ) { $ data = [ ] ; exec ( "$command" , $ data , $ resultCode ) ; $ this -> result = $ resultCode ; $ this -> output = implode ( "\n" , $ data ) ; if ( $ this -> output === null ) { \ PHPUnit \ Framework \ Assert :: fail ( "$command can't be executed" ) ; } if ( $ resultCode !== 0 && $ failNonZero ) { \ PHPUnit \ Framework \ Assert :: fail ( "Result code was $resultCode.\n\n" . $ this -> output ) ; } $ this -> debug ( preg_replace ( '~s/\e\[\d+(?>(;\d+)*)m//g~' , '' , $ this -> output ) ) ; }
Executes a shell command.
Fails If exit code is > 0. You can disable this by setting second parameter to false

```php
<?php
$I->runShellCommand('phpunit');

// do not fail test when command fails
$I->runShellCommand('phpunit', false);
```

@param $command
@param bool $failNonZero
Executes a shell command . Fails If exit code is > 0 . You can disable this by setting second parameter to false