Assert that the HTTP response status line equals a given value

@param string $line Expected HTTP response status line
@throws AssertionFailedException
@return void

@Then the response status line is :line
330574
public function assertResponseStatusLineIs($line) {
        $this->requireResponse();

        try {
            $actualStatusLine = sprintf(
                '%d %s',
                $this->response->getStatusCode(),
                $this->response->getReasonPhrase()
            );

            Assertion::same($line, $actualStatusLine, sprintf(
                'Expected response status line "%s", got "%s".',
                $line,
                $actualStatusLine
            ));
        } catch (AssertionFailure $e) {
            throw new AssertionFailedException($e->getMessage());
        }
    }
1018323
public function dontSeeResponseCodeIs($code)
    {
        $failureMessage = sprintf(
            'Expected HTTP status code other than %s',
            HttpCode::getDescription($code)
        );
        $this->assertNotEquals($code, $this->getResponseStatusCode(), $failureMessage);
    }
943140
public function respond(Match $match, TemplateInterface $template, $message = '')
    {
        if ($match->isMatch()) {
            return;
        }

        $this->formatter->setMatch($match);
        $message = ($message) ? $message : $this->formatter->getMessage($template);
        throw new AssertionException($message);
    }
1095621
public function assertResponseBodyIsAnEmptyJsonArray() {
        $this->requireResponse();

        try {
            Assertion::same(
                [],
                $body = $this->getResponseBodyArray(),
                sprintf('Expected response body to be an empty JSON array, got "%s".', json_encode($body, JSON_PRETTY_PRINT))
            );
        } catch (AssertionFailure $e) {
            throw new AssertionFailedException($e->getMessage());
        }
    }
108090
protected function _verifyResponse($expected)
	{
		$parts = null;

		// Wait for a response from the server, but timeout after the set time limit
		$endTime = time() + $this->timeout;
		$this->response = '';

		do
		{
			$this->response .= fgets($this->conn, 4096);
		}

		while (!preg_match("/^([0-9]{3})(-(.*" . CRLF . ")+\\1)? [^" . CRLF . "]+" . CRLF . "$/", $this->response, $parts) && time() < $endTime);

		// Catch a timeout or bad response
		if (!isset($parts[1]))
		{
			Log::add(
				sprintf(
					'%1$s: Timeout or unrecognised response while waiting for a response from the server. Server response: %2$s',
					__METHOD__, $this->response
				),
				Log::WARNING, 'jerror'
			);

			return false;
		}

		// Separate the code from the message
		$this->_responseCode = $parts[1];
		$this->_responseMsg = $parts[0];

		// Did the server respond with the code we wanted?
		if (is_array($expected))
		{
			if (in_array($this->_responseCode, $expected))
			{
				$retval = true;
			}
			else
			{
				$retval = false;
			}
		}
		else
		{
			if ($this->_responseCode == $expected)
			{
				$retval = true;
			}
			else
			{
				$retval = false;
			}
		}

		return $retval;
	}
352280
private function parseLine($line)
    {
        if (($pair = $this->generateRulePair($line, array_keys(self::TOP_LEVEL_DIRECTIVES))) !== false) {
            return $this->handler->{self::TOP_LEVEL_DIRECTIVES[$pair[0]]}->add($pair[1]);
        }
551890
private function writeLine($line)
    {
        $this->text .= str_repeat(' ', $this->indent * 4);
        $this->text .= $line;
        $this->text .= PHP_EOL;
    }
670604
public function write($line)
    {
        return $this->pipes !== null ? fwrite($this->pipes[0], $line . PHP_EOL) : false;
    }
135348
public static function assert($assertion, string $message = '')
    {
        self::$count += 1;
        assert($assertion, new AssertionError($message));
    }
859450
public function assertResponseBodyIsNot(PyStringNode $content) {
        $this->requireResponse();
        $content = (string) $content;

        try {
            Assertion::notSame((string) $this->response->getBody(), $content, sprintf(
                'Did not expect response body to be "%s".',
                $content
            ));
        } catch (AssertionFailure $e) {
            throw new AssertionFailedException($e->getMessage());
        }
    }
693996
public function assertResponseBodyJsonArrayLength($length) {
        $this->requireResponse();
        $length = (int) $length;

        try {
            Assertion::count(
                $body = $this->getResponseBodyArray(),
                $length,
                sprintf(
                    'Expected response body to be a JSON array with %d entr%s, got %d: "%s".',
                    $length,
                    $length === 1 ? 'y' : 'ies',
                    count($body),
                    json_encode($body, JSON_PRETTY_PRINT)
                )
            );
        } catch (AssertionFailure $e) {
            throw new AssertionFailedException($e->getMessage());
        }
    }
791113
public function assertIsTrue($value, $message='%s must be True', $exception='Asserts')
    {
        if (is_bool($value) === false || $value !== true) {
            $this->throwException($exception, $message, $value);
        }
    }
1363102
protected function lineHas0VatRate(array $line)
    {
        $result = false;
        if ($this->is0VatRate($line)) {
            $result = true;
        }
        return $result;
    }
776980
public function display($line)
    {
        $server = $this->username.'@'.$this->host;

        $lead = '<comment>['.$server.']</comment> <info>('.$this->name.')</info>';

        $this->getOutput()->writeln($lead.' '.$line);
    }
962392
static function assertEqualIterable(iterable $expected, $actual, string $message = ''): void
    {
        static::assertThat($actual, static::equalIterable($expected), $message);
    }
456960
public function assertResponseReasonPhraseMatches($pattern) {
        $this->requireResponse();

        try {
            Assertion::regex(
                $actual = $this->response->getReasonPhrase(),
                $pattern,
                sprintf(
                    'Expected the response reason phrase to match the regular expression "%s", got "%s".',
                    $pattern,
                    $actual
                ));
        } catch (AssertionFailure $e) {
            throw new AssertionFailedException($e->getMessage());
        }
    }
54780
public function assertIsEmpty($value, $message='%s must not be empty', $exception='Asserts')
    {
        if (isset($value) === false || empty($value)) {
            $this->throwException($exception, $message, $value);
        }
    }