Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Assert.php

function Assert::assertThat

Evaluates a PHPUnit\Framework\Constraint matcher object.

Throws

ExpectationFailedException

119 calls to Assert::assertThat()
Assert::assertArrayHasKey in vendor/phpunit/phpunit/src/Framework/Assert.php
Asserts that an array has a specified key.
Assert::assertArrayNotHasKey in vendor/phpunit/phpunit/src/Framework/Assert.php
Asserts that an array does not have a specified key.
Assert::assertContains in vendor/phpunit/phpunit/src/Framework/Assert.php
Asserts that a haystack contains a needle.
Assert::assertContainsEquals in vendor/phpunit/phpunit/src/Framework/Assert.php
Assert::assertContainsOnly in vendor/phpunit/phpunit/src/Framework/Assert.php
Asserts that a haystack contains only values of a given type.

... See full list

File

vendor/phpunit/phpunit/src/Framework/Assert.php, line 1863

Class

Assert
@no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit

Namespace

PHPUnit\Framework

Code

public static final function assertThat(mixed $value, Constraint $constraint, string $message = '') : void {
    self::$count += count($constraint);
    $hasFailed = true;
    try {
        $constraint->evaluate($value, $message);
        $hasFailed = false;
    } finally {
        if ($hasFailed) {
            Event\Facade::emitter()->testAssertionFailed($value, $constraint, $message);
        }
        else {
            Event\Facade::emitter()->testAssertionSucceeded($value, $constraint, $message);
        }
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal