public static function PHPUnit_Framework_Assert::assertNotInstanceOf

Asserts that a variable is not of a given type.

@since Method available since Release 3.5.0

Parameters

string $expected:

mixed $actual:

string $message:

1 call to PHPUnit_Framework_Assert::assertNotInstanceOf()
PHPUnit_Framework_Assert::assertAttributeNotInstanceOf in drupal/core/vendor/phpunit/phpunit/PHPUnit/Framework/Assert.php
Asserts that an attribute is of a given type.

File

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

Class

PHPUnit_Framework_Assert
A set of assert methods.

Code

public static function assertNotInstanceOf($expected, $actual, $message = '') {
  if (is_string($expected)) {
    if (class_exists($expected) || interface_exists($expected)) {
      $constraint = new PHPUnit_Framework_Constraint_Not(new PHPUnit_Framework_Constraint_IsInstanceOf($expected));
    }
    else {
      throw PHPUnit_Util_InvalidArgumentHelper::factory(1, 'class or interface name');
    }
  }
  else {
    throw PHPUnit_Util_InvalidArgumentHelper::factory(1, 'string');
  }
  self::assertThat($actual, $constraint, $message);
}