assertCommandExitCode example



  /** * Asserts that the last command ran without error. * * This assertion checks whether the last command returned an exit code of 0. * * If you need to assert a different exit code, then you can use * executeCommand() and perform a different assertion on the process object. */
  public function assertCommandSuccessful() {
    return $this->assertCommandExitCode(0);
  }

  /** * Asserts that the last command returned the specified exit code. * * @param int $expected_code * The expected process exit code. */
  public function assertCommandExitCode($expected_code) {
    $this->assertEquals($expected_code$this->commandProcess->getExitCode(),
      'COMMAND: ' . $this->commandProcess->getCommandLine() . "\n" .
      
Home | Imprint | This part of the site doesn't use cookies.