Checks whether previously runned command failed|passed.

@Then /^it should (fail|pass)$/

@param string $success "fail" or "pass"
168994
public function itShouldFail($success)
    {
        if ('fail' === $success) {
            if (0 === $this->getExitCode()) {
                echo 'Actual output:'.PHP_EOL.PHP_EOL.$this->getOutput();
            }

            \PHPUnit_Framework_Assert::assertNotEquals(0, $this->getExitCode());
        } else {
            if (0 !== $this->getExitCode()) {
                echo 'Actual output:'.PHP_EOL.PHP_EOL.$this->getOutput();
            }

            \PHPUnit_Framework_Assert::assertEquals(0, $this->getExitCode());
        }
    }
471595
public function setResult($jobname, $result = null)
    {
        if (isset($this->results[$jobname])) {
            return false;
        }
        $this->results[$jobname] = $result;
        ++$this->resultsNum;
        $this->checkIfAllReady();
        return true;
    }
998229
def execute_return_success(cmd):
    '''
    
    '''

    ret = _run_all(cmd)

    if ret['retcode'] != 0 or 'not supported' in ret['stdout'].lower():
        msg = 'Command Failed: {0}\n'.format(cmd)
        msg += 'Return Code: {0}\n'.format(ret['retcode'])
        msg += 'Output: {0}\n'.format(ret['stdout'])
        msg += 'Error: {0}\n'.format(ret['stderr'])
        raise CommandExecutionError(msg)

    return True
893154
protected function validateTaskResult(Result $result)
    {
        if ($result->getExitCode() !== Result::EXITCODE_OK) {
            throw new TaskResultRuntimeException($result);
        }

        return $result;
    }
983576
protected function success_or_failure( $response ) {
		list( $type, $msg ) = $response;

		if ( 'success' === $type ) {
			WP_CLI::success( $msg );
			$status = 0;
		} else {
			WP_CLI::warning( $msg );
			$status = 1;
		}

		return $status;
	}
1262776
protected function printBoolean(OutputInterface $output, $success, $fail, $value, $line = true)
    {
        if ($value) {
            $message = '<info>' . $success . '</info>';
        } else {
            $message = '<error>' . $fail . '</error>';
        }

        if (false === $line) {
            return $message;
        }

        $output->writeln($message);
    }
811023
public function displayStatusMessage($error, $output = null, $success = null)
    {
        // If all went well
        if ($this->checkResults($output)) {
            if ($success) {
                $this->explainer->success($success);
            }

            return $output || true;
        }

        // Else display the error
        $error = sprintf('An error occured: "%s"', $error);
        if ($output) {
            $error .= ', while running:'.PHP_EOL.$output;
        }

        $this->explainer->error($error);

        return false;
    }
15681
private function confirmQuery ($result)
	{
		if ($result) return;
	    $outputMessage = "";
		if (DEPLOYMENT_STATE == "local"):
		    $outputMessage = "Database query failed: ".mysqli_error($this->connection)."<br /><br />";
		    $outputMessage .= "Last SQL query: ".static::lastQuery();
	    else:
		    $outputMessage = "A DATABASE ERROR OCCURRED TRY AGAIN LATER OR CONTACT ADMINISTRATOR<br /><br />";
		    $log = "Database query failed: ".mysqli_error($this->connection)."\nLast SQL query: ".static::lastQuery();
		    (new Log($log, "ERROR"))->setLogFile("DBLog.txt")->logMessage();
	    endif;
	    die($outputMessage);
	}
967977
public function itShouldPassWith($success, PyStringNode $text)
    {
        $this->itShouldFail($success);
        $this->theOutputShouldContain($text);
    }
332575
private function fireLoginEvent($succeeded)
    {
        event(
            $succeeded
                ? new LoginSucceeded($this->getUser())
                : new LoginFailed($this->getUser())
        );

        return $succeeded;
    }
747062
function execute($command) {
        $output = array();
        $result = null;

        // Redirect standard error to stdout so we can do something with
        // it.
        $command .= " 2>&1";

        exec($command, $output, $result);

        if ($result !== 0) {
            if ($result === self::RESULT_CODE_COMMAND_NOT_FOUND) {
                throw new CommandNotFoundError(implode("\t", $output), $result);
            }
            else {
                throw new ExecutionError(implode("\t", $output), $result);
            }
        }
        return $output;
    }
529833
protected function throwExceptionOnClientCallFailure($result)
    {
        if ($result !== false) {
            return;
        }

        throw new OperationFailed(
            $this->client->getResultMessage(),
            $this->client->getResultCode()
        );
    }
71366
protected function success($message)
    {
        if ($this->isVerbose() === true) {
            $this->out("%g${message}%n", true);
        }
        
        exit(self::EXIT_SUCCESS);
    }
93897
protected function log(bool $success) : void
    {
        if ($success) {
            $this->stdout('Success!', Console::FG_GREEN, Console::BOLD);
        } else {
            $this->stderr('Error!', Console::FG_RED, Console::BOLD);
        }
        $this->stdout(PHP_EOL);
    }
446191
function _success(test, result) {
  process.stdout.write('.'.green);
  successes.push({ test: test, result: result });
}
276505
public function response($success, $data = '', $code = null) {
        $this->_success = (bool) $success;
        $this->_data = $data;
        $this->_code = $code;
    }
1293873
public final function setFail(\Throwable $fail): void
    {
        if ($this->failOption) {
            if ($this->failOption == 'log') {
                $logger = clone $this->service->getApp()->getLogger();
                $logger->setDirectory($this->failLogDirectory);
                $logger->logFail($fail);
            } elseif ($this->failOption == 'throw') {
                throw $fail;
            }
        }
        $this->fail = $fail;
    }