public static function PHPUnit_Framework_Assert::assertNotContains

Asserts that a haystack does not contain a needle.

@since Method available since Release 2.1.0

Parameters

mixed $needle:

mixed $haystack:

string $message:

boolean $ignoreCase:

boolean $checkForObjectIdentity:

7 calls to PHPUnit_Framework_Assert::assertNotContains()
Framework_AssertTest::testAssertArrayNotContainsObject in drupal/core/vendor/phpunit/phpunit/Tests/Framework/AssertTest.php
@covers PHPUnit_Framework_Assert::assertNotContains
Framework_AssertTest::testAssertArrayNotContainsString in drupal/core/vendor/phpunit/phpunit/Tests/Framework/AssertTest.php
@covers PHPUnit_Framework_Assert::assertNotContains
Framework_AssertTest::testAssertNotContainsThrowsException in drupal/core/vendor/phpunit/phpunit/Tests/Framework/AssertTest.php
@covers PHPUnit_Framework_Assert::assertNotContains @expectedException PHPUnit_Framework_Exception
Framework_AssertTest::testAssertSplObjectStorageNotContainsObject in drupal/core/vendor/phpunit/phpunit/Tests/Framework/AssertTest.php
@covers PHPUnit_Framework_Assert::assertNotContains
Framework_AssertTest::testAssertStringNotContainsString in drupal/core/vendor/phpunit/phpunit/Tests/Framework/AssertTest.php
@covers PHPUnit_Framework_Assert::assertNotContains

... See full list

File

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

Class

PHPUnit_Framework_Assert
A set of assert methods.

Code

public static function assertNotContains($needle, $haystack, $message = '', $ignoreCase = FALSE, $checkForObjectIdentity = TRUE) {
  if (is_array($haystack) || is_object($haystack) && $haystack instanceof Traversable) {
    $constraint = new PHPUnit_Framework_Constraint_Not(new PHPUnit_Framework_Constraint_TraversableContains($needle, $checkForObjectIdentity));
  }
  else {
    if (is_string($haystack)) {
      $constraint = new PHPUnit_Framework_Constraint_Not(new PHPUnit_Framework_Constraint_StringContains($needle, $ignoreCase));
    }
    else {
      throw PHPUnit_Util_InvalidArgumentHelper::factory(2, 'array, iterator or string');
    }
  }
  self::assertThat($haystack, $constraint, $message);
}