mageekguy\atoum\asserters\phpArray::intersect PHP Method

intersect() protected method

protected intersect ( array $values, $failMessage, $strict )
$values array
    protected function intersect(array $values, $failMessage, $strict)
    {
        $this->valueIsSet();
        $unknownValues = array();
        foreach ($values as $value) {
            if (in_array($value, $this->value, $strict) === false) {
                $unknownValues[] = $value;
            }
        }
        if (sizeof($unknownValues) <= 0) {
            $this->pass();
        } else {
            if ($failMessage === null) {
                if ($strict === false) {
                    $failMessage = $this->_('%s does not contain values %s', $this, $this->getTypeOf($unknownValues));
                } else {
                    $failMessage = $this->_('%s does not contain strictly values %s', $this, $this->getTypeOf($unknownValues));
                }
            }
            $this->fail($failMessage);
        }
        return $this;
    }