lithium\test\Unit::assertNotContains PHP Method

assertNotContains() public method

$this->assertNotContains(4, array(1,2,3)); // succeeds $this->assertNotContains('foo', array('foo', 'bar', 'baz')); // fails
See also: lithium\test\Unit::assert()
public assertNotContains ( string $needle, miexed $haystack, string | boolean $message = '{:message}' ) : boolean
$needle string The needle you are looking for.
$haystack miexed Array or iterable object or a string.
$message string | boolean
return boolean `true` if the assertion succeeded, `false` otherwise.
    public function assertNotContains($needle, $haystack, $message = '{:message}')
    {
        if (is_string($haystack)) {
            return $this->assert(strpos($haystack, $needle) === false, $message, array('expected' => $needle, 'result' => $haystack));
        }
        foreach ($haystack as $key => $value) {
            if ($value === $needle) {
                return $this->assert(false, $message, array('expected' => $needle, 'result' => $haystack));
            }
        }
        return $this->assert(true, $message, array('expected' => $needle, 'result' => $haystack));
    }