public static function PHPUnit_Framework_Assert::assertNotSame

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

Parameters

mixed $expected:

mixed $actual:

string $message:

12 calls to PHPUnit_Framework_Assert::assertNotSame()
Framework_AssertTest::testAssertNotSame in drupal/core/vendor/phpunit/phpunit/Tests/Framework/AssertTest.php
@covers PHPUnit_Framework_Assert::assertNotSame
Framework_AssertTest::testAssertNotSame2 in drupal/core/vendor/phpunit/phpunit/Tests/Framework/AssertTest.php
@covers PHPUnit_Framework_Assert::assertNotSame
Framework_AssertTest::testAssertNotSameFails in drupal/core/vendor/phpunit/phpunit/Tests/Framework/AssertTest.php
@covers PHPUnit_Framework_Assert::assertNotSame @dataProvider sameProvider
Framework_AssertTest::testAssertNotSameFailsNull in drupal/core/vendor/phpunit/phpunit/Tests/Framework/AssertTest.php
@covers PHPUnit_Framework_Assert::assertNotSame
Framework_AssertTest::testAssertNotSameSucceeds in drupal/core/vendor/phpunit/phpunit/Tests/Framework/AssertTest.php
@covers PHPUnit_Framework_Assert::assertNotSame @dataProvider notSameProvider

... See full list

File

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

Class

PHPUnit_Framework_Assert
A set of assert methods.

Code

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