function BuildTestBase::assertCommandExitCode

Same name in other branches
  1. 9 core/tests/Drupal/BuildTests/Framework/BuildTestBase.php \Drupal\BuildTests\Framework\BuildTestBase::assertCommandExitCode()
  2. 8.9.x core/tests/Drupal/BuildTests/Framework/BuildTestBase.php \Drupal\BuildTests\Framework\BuildTestBase::assertCommandExitCode()
  3. 11.x core/tests/Drupal/BuildTests/Framework/BuildTestBase.php \Drupal\BuildTests\Framework\BuildTestBase::assertCommandExitCode()

Asserts that the last command returned the specified exit code.

Parameters

int $expected_code: The expected process exit code.

1 call to BuildTestBase::assertCommandExitCode()
BuildTestBase::assertCommandSuccessful in core/tests/Drupal/BuildTests/Framework/BuildTestBase.php
Asserts that the last command ran without error.

File

core/tests/Drupal/BuildTests/Framework/BuildTestBase.php, line 306

Class

BuildTestBase
Provides a workspace to test build processes.

Namespace

Drupal\BuildTests\Framework

Code

public function assertCommandExitCode($expected_code) {
    $this->assertEquals($expected_code, $this->commandProcess
        ->getExitCode(), 'COMMAND: ' . $this->commandProcess
        ->getCommandLine() . "\n" . 'OUTPUT: ' . $this->commandProcess
        ->getOutput() . "\n" . 'ERROR: ' . $this->commandProcess
        ->getErrorOutput() . "\n");
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.