public static function PHPUnit_Framework_Assert::assertSame

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

Parameters

mixed $expected:

mixed $actual:

string $message:

55 calls to PHPUnit_Framework_Assert::assertSame()
FailureTest::testAssertFloatSameFloat in drupal/core/vendor/phpunit/phpunit/Tests/_files/FailureTest.php
FailureTest::testAssertObjectSameNull in drupal/core/vendor/phpunit/phpunit/Tests/_files/FailureTest.php
FailureTest::testAssertObjectSameObject in drupal/core/vendor/phpunit/phpunit/Tests/_files/FailureTest.php
FailureTest::testAssertTextSameText in drupal/core/vendor/phpunit/phpunit/Tests/_files/FailureTest.php
Framework_AssertTest::testAssertSame in drupal/core/vendor/phpunit/phpunit/Tests/Framework/AssertTest.php
@covers PHPUnit_Framework_Assert::assertSame

... See full list

File

drupal/core/vendor/phpunit/phpunit/PHPUnit/Framework/Assert.php, line 1086

Class

PHPUnit_Framework_Assert
A set of assert methods.

Code

public static function assertSame($expected, $actual, $message = '') {
  if (is_bool($expected) && is_bool($actual)) {
    self::assertEquals($expected, $actual, $message);
  }
  else {
    $constraint = new PHPUnit_Framework_Constraint_IsIdentical($expected);
    self::assertThat($actual, $constraint, $message);
  }
}