Asserts the text in the header tag matches the given text.

@param string $expected

@throws \Behat\Mink\Exception\ExpectationException
171760
public function assertHasHeader(string $expected)
    {
        $actual = $this->getHeaderText();
        if ($expected === $actual) {
            return;
        }

        throw new ExpectationException(
            sprintf(
                '[W402] Expected screen header "%1$s", found "%2$s".',
                $expected,
                $actual
            ),
            $this->getDriver()
        );
    }
630123
private function assertFormHasValidationMessage($expectedMessage)
    {
        Assert::true(
            $this->createPage->hasFormValidationError($expectedMessage),
            sprintf(
                'The validation message "%s" was not found on the page.',
                $expectedMessage
            )
        );
    }
109260
public function is($actual, $expected)
	{
		if (!is_scalar($actual) || !is_scalar($expected)) {
			throw new \Exception("'try/predict-is' can only compare scalar values. 'try/predict' for complex predictions.");
		}

		if ($actual !== $expected) {
			throw new \Exception("Expected '$expected', but got '$actual'.");
		}
	}
49404
public static function match($actual, $expected)
    {
        $length = static::actual($actual);
        static::_buildDescription($actual, $length, $expected);

        return $length === $expected;
    }
855690
public static function expectedToken(
        $expected,
        array $token = null,
        DocLexer $lexer = null
    ) {
        if ((null === $token) && $lexer) {
            $token = $lexer->lookahead;
        }

        $message = "Expected $expected, received ";

        if ($token) {
            $message .= "'{$token['value']}' at position {$token['position']}.";
        } else {
            $message .= 'end of string.';
        }

        return new self($message);
    }
547953
public function checkIsNotString($value = false, $expected = false)
    {
        if (is_string($this->token) || ($value && ($this->token[0] != $value))) {
            $this->bailUnexpectedToken($expected);
        }
    }
779851
protected function __isValueMatchAsExpected($value, $expectedString)
    {
        $match = false;

        if ($expectedString === null)
            ## undefined expected values must not be NULL
            ## except when it write down on docblock "@return void"
            return $value === null;

        $valueType = strtolower(gettype($value));

        /**
         * @return string|null|object|\Stdclass|void
         */
        $expectedString = explode('|', $expectedString);
        foreach($expectedString as $ext) {
            $ext = strtolower(trim($ext));
            if ($ext == '') continue;

            if ($value === VOID && $ext == 'void')
                $match = true;
            elseif ($valueType === $ext && $value != null)
                $match = true;
            elseif ($valueType === 'object') {
                if (is_a($value, $ext))
                    $match = true;
            }

            if ($match) break;
        }

        return $match;
    }
365613
public static function assertEquals($actual, $expected, Throwable $exception)
    {
        static::makeAssertion($actual === $expected, $exception);
        return $actual;
    }
1118049
public function assertEqualXMLStructure(\DOMElement $expectedElement, $checkAttributes = false) {
        $this->callAssertMethod(__FUNCTION__, [
            'expected' => $expectedElement,
            'options' => [
                $checkAttributes,
            ],
        ]);
    }
427248
public static void assertToken(int expectedType, String expectedText, LexerResults lexerResults)
    {
        assertToken(expectedType, expectedText, lexerResults.getToken());
    }
343267
public function assertParameters($name, $expected) {
    $value = \Drupal::getContainer()->getParameter($name);
    Assert::eq($value, $this->castParameter($expected));
  }
494638
public function assertImageEffects(TableNode $expected) {
    $image_style_info = [];
    foreach ($this->getImageStyles() as $image_style) {
      foreach ($image_style->getEffects() as $effect) {
        $image_style_info[] = [
          $image_style->label(),
          (string) $effect->label(),
          $this->formatImageEffectSummary($effect->getSummary()),
        ];
      }
    }
    $actual = new TableNode($image_style_info);

    (new TableEqualityAssertion($expected, $actual))
      ->expectHeader([
        'Image style',
        'Effect',
        'Summary',
      ])
      ->setMissingRowsLabel(self::missingRowsLabelFor('workflow'))
      ->setUnexpectedRowsLabel(self::unexpectedRowsLabelFor('workflow'))
      ->assert();
  }
1221129
public function assertLessThanOrEqual($expected, $message = '')
    {
        Assert::assertLessThanOrEqual($expected, $this->getData(), $message);

        return $this;
    }
530198
protected function assert_rating_matches($expected, $stored) {
        $this->assertEquals($expected->rating, $stored->rating);
        $this->assertEquals($expected->userid, $stored->author);
    }
628514
public function assertRolesExist(TableNode $expected) {
    $role_info = [];
    /** @var \Drupal\user\Entity\Role[] $roles */
    $roles = $this->entityTypeManager()
      ->getStorage('user_role')
      ->loadMultiple();
    foreach ($roles as $id => $role) {
      $role_info[] = [$role->label(), $id];
    }
    $actual = new TableNode($role_info);

    (new TableEqualityAssertion($expected, $actual))
      ->expectHeader(['Name', 'Machine name'])
      ->ignoreRowOrder()
      ->setMissingRowsLabel(self::missingRowsLabelFor('roles'))
      ->setUnexpectedRowsLabel(self::unexpectedRowsLabelFor('roles'))
      ->assert();
  }
1089876
public function expectImplicit($expectedTag = null): ImplicitTagging
    {
        $el = $this;
        if (!$el instanceof ImplicitTagging) {
            throw new \UnexpectedValueException(
                "Element doesn't implement implicit tagging.");
        }
        if (isset($expectedTag)) {
            $el->expectTagged($expectedTag);
        }
        return $el;
    }
173566
public function syntaxError($expected = '', $token = null)
    {
        if ($token === null) {
            $token = $this->lexer->lookahead;
        }

        $tokenPos = (isset($token['position'])) ? $token['position'] : '-1';

        $message  = "line 0, col {$tokenPos}: Error: ";
        $message .= ($expected !== '') ? "Expected {$expected}, got " : 'Unexpected ';
        $message .= ($this->lexer->lookahead === null) ? 'end of string.' : "'{$token['value']}'";

        throw ExpressionException::syntaxError($message, ExpressionException::expressionError($this->expression));
    }