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

Breadcrumb

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

function Assert::assertSame

Asserts that two variables have the same type and value. Used on objects, it asserts that two variables reference the same object.

@psalm-template ExpectedType

@psalm-param ExpectedType $expected

@psalm-assert =ExpectedType $actual

Throws

ExpectationFailedException

11 calls to Assert::assertSame()
AbstractTransportFactoryTestCase::testSupports in vendor/symfony/mailer/Test/AbstractTransportFactoryTestCase.php
@dataProvider supportsProvider
AssertingContextualValidator::doAtPath in vendor/symfony/validator/Test/ConstraintValidatorTestCase.php
AssertingContextualValidator::doValidate in vendor/symfony/validator/Test/ConstraintValidatorTestCase.php
CompoundConstraintTestCase::assertNoViolation in vendor/symfony/validator/Test/CompoundConstraintTestCase.php
ConstraintValidatorTestCase::assertNoViolation in vendor/symfony/validator/Test/ConstraintValidatorTestCase.php

... See full list

File

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

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 assertSame(mixed $expected, mixed $actual, string $message = '') : void {
    static::assertThat($actual, new IsIdentical($expected), $message);
}
RSS feed
Powered by Drupal