PHPUnit_Framework_Assert::assertNotContainsOnly PHP Method

assertNotContainsOnly() public static method

Asserts that a haystack does not contain only values of a given type.
public static assertNotContainsOnly ( string $type, mixed $haystack, boolean $isNativeType = null, string $message = '' )
$type string
$haystack mixed
$isNativeType boolean
$message string
    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 traversable');
        }
        if ($isNativeType == null) {
            $isNativeType = PHPUnit_Util_Type::isType($type);
        }
        static::assertThat($haystack, new PHPUnit_Framework_Constraint_Not(new PHPUnit_Framework_Constraint_TraversableContainsOnly($type, $isNativeType)), $message);
    }

Usage Example

Esempio n. 1
0
/**
 * Asserts that a haystack does not contain only values of a given type.
 *
 * @param  string  $type
 * @param  mixed   $haystack
 * @param  boolean $isNativeType
 * @param  string  $message
 * @since  Method available since Release 3.1.4
 */
function assertNotContainsOnly($type, $haystack, $isNativeType = NULL, $message = '')
{
    return PHPUnit_Framework_Assert::assertNotContainsOnly($type, $haystack, $isNativeType, $message);
}
All Usage Examples Of PHPUnit_Framework_Assert::assertNotContainsOnly
PHPUnit_Framework_Assert