public static function PHPUnit_Framework_Assert::assertNotContainsOnly

Asserts that a haystack does not contain only values of a given type.

@since Method available since Release 3.1.4

Parameters

string $type:

mixed $haystack:

boolean $isNativeType:

string $message:

3 calls to PHPUnit_Framework_Assert::assertNotContainsOnly()
Framework_AssertTest::testAssertArrayNotContainsOnlyIntegers in drupal/core/vendor/phpunit/phpunit/Tests/Framework/AssertTest.php
@covers PHPUnit_Framework_Assert::assertNotContainsOnly
Framework_AssertTest::testAssertArrayNotContainsOnlyStdClass in drupal/core/vendor/phpunit/phpunit/Tests/Framework/AssertTest.php
@covers PHPUnit_Framework_Assert::assertNotContainsOnly
PHPUnit_Framework_Assert::assertAttributeNotContainsOnly in drupal/core/vendor/phpunit/phpunit/PHPUnit/Framework/Assert.php
Asserts that a haystack that is stored in a static attribute of a class or an attribute of an object does not contain only values of a given type.

File

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

Class

PHPUnit_Framework_Assert
A set of assert methods.

Code

public static function assertNotContainsOnly($type, $haystack, $isNativeType = NULL, $message = '') {
  if (!(is_array($haystack) || is_object($haystack) && $haystack instanceof Traversable)) {
    throw PHPUnit_Util_InvalidArgumentHelper::factory(2, 'array or iterator');
  }
  if ($isNativeType == NULL) {
    $isNativeType = PHPUnit_Util_Type::isType($type);
  }
  self::assertThat($haystack, new PHPUnit_Framework_Constraint_Not(new PHPUnit_Framework_Constraint_TraversableContainsOnly($type, $isNativeType)), $message);
}