Checks that wrapped element meets the acceptance criteria.

@return void
@throws TypifiedElementException When no criteria matches.
18674
protected function assertWrappedElement()
	{
		if ( !$this->acceptanceCriteria ) {
			return;
		}

		foreach ( $this->acceptanceCriteria as $criterion ) {
			if ( !$this->isTagNameMatching($criterion) ) {
				continue;
			}

			if ( $this->isAttributeMatching($criterion) ) {
				return;
			}
		}

		$message = 'Wrapped element "%s" does not match "%s" criteria';

		throw new TypifiedElementException(
			sprintf($message, $this->getWrappedElement(), get_class($this)),
			TypifiedElementException::TYPE_INCORRECT_WRAPPED_ELEMENT
		);
	}
300573
protected function detectAutoValidate()
	{
		$this->autoValidate = true;

		if ($this->xml->firstChild->nextSibling->hasAttributeNS(self::NS, 'validate'))
		{
			$value = $this->xml->firstChild->nextSibling->getAttributeNS(self::NS, 'validate');

			switch ($value)
			{
				case '':
				case '0':
				case 'false':
					$this->autoValidate = false;
					$this->js []= 'autoValidate = false;';
				break;
			}
		}
	}
1158294
public function verifyElements(): void
    {
        $this->context->waitUntilElementIsVisible($this->fields['username']);
        $this->context->waitUntilElementIsVisible($this->fields['password']);

        $this->context->waitUntil(5, function () {
            return '' == $this->context->findElement($this->fields['password'], $this->defaultTimeout)->getValue();
        });
    }
1281466
public static boolean isElementIgnored(Node source, Node received, Set<String> ignoreExpressions, NamespaceContext namespaceContext) {
        if (isElementIgnored(received, ignoreExpressions, namespaceContext)) {
            if (log.isDebugEnabled()) {
                log.debug("Element: '" + received.getLocalName() + "' is on ignore list - skipped validation");
            }
            return true;
        } else if (source.getFirstChild() != null &&
                StringUtils.hasText(source.getFirstChild().getNodeValue()) &&
                source.getFirstChild().getNodeValue().trim().equals(Citrus.IGNORE_PLACEHOLDER)) {
            if (log.isDebugEnabled()) {
                log.debug("Element: '" + received.getLocalName() + "' is ignored by placeholder '" +
                        Citrus.IGNORE_PLACEHOLDER + "'");
            }
            return true;
        }
        return false;
    }
685507
public function evaluate()
    {
        
		
		$this->initElements();
		
		if(isset($_POST["{$this->name}_sent"])){
			
			$this->submited = true;
			
			//set posted values
			foreach($this->elements as $id => $element){
				$this->elements[$id]->feed();
			}
			
			$this->validate();
			
		}
			
        
    }
1073316
public function accept()
    {
        $query = $this->getInnerIterator()->current();
        $pattern = $this->isRegex($this->statement) ? $this->statement : '/^' . $this->statement . '/i';
        if (!preg_match($pattern, $query[0])) {
            return false;
        }

        return true;
    }
217629
protected function validate_data() {
        parent::validate_data();

        if (!in_array($this->other['cmielement'],
                array('cmi.completion_status', 'cmi.core.lesson_status', 'cmi.success_status'))) {
            throw new \coding_exception(
                "The 'cmielement' must represents a valid CMI status element ({$this->other['cmielement']}).");
        }

        if (!in_array($this->other['cmivalue'],
                array('passed', 'completed', 'failed', 'incomplete', 'browsed', 'not attempted', 'unknown'))) {
            throw new \coding_exception(
                "The 'cmivalue' must represents a valid CMI status value ({$this->other['cmivalue']}).");
        }
    }
238654
public function validate($element): bool
    {
        if (!$expectedType = $this->getType()) {
            return true;
        }

        $expectedType = $this->typeMap[$expectedType] ?? $expectedType;
        $actualType   = \gettype($element);

        if (($actualType === 'object' && $element instanceof $expectedType) || $actualType === $expectedType) {
            return true;
        }

        throw new InvalidTypeException($expectedType, $actualType === 'object' ? \get_class($element) : $actualType);
    }
578477
public function isAccepted($value, $var = null)
    {
        if ($this->getContentInstance() instanceof ContentSet) {
            if (!($value instanceof AbstractClassContent)) {
                // ContentSet accepts only AbstractClassContent elements
                return false;
            }

            if (in_array('!' . $this->_getType($value), $this->_accept)) {
                // ContentSet can exclude content types
                return false;
            }

            $acceptArray = array_filter($this->_accept, function($item) { return '!' !== substr($item, 0, 1); });
        } else {
            if (null === $var) {
                return false;
            }

            if (!array_key_exists($var, $this->_accept)) {
                return true;
            }

            $acceptArray = $this->_accept[$var];
        }

        if (0 === count($acceptArray)) {
            return true;
        }

        return in_array($this->_getType($value), $acceptArray);
    }
1279003
protected function validateElement(string $type, string $element)
    {
        if (!in_array($element, $this->{$type})) {
            $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 2)[1]['function'];

            throw new InvalidArgumentException("Breadcrumbs::{$trace} was passed \"$element\", but " .
            "this is not a valid element. Allowed list : " . implode(' ', $this->{$type}));
        }
    }
145737
def accepts?(*types)
      request.accepts.compact.each do |priority|
        # Because IE always sends */* in the accepts header and we assume
        # that if you really wanted XML or something else you would say so
        # explicitly, we will assume */* to only ask for :html
        return types.include?(:html) if priority == Mime::ALL

        return true if types.include?(priority.to_sym)
      end
      false
    end
733594
@Requires("e != null")
  @Ensures("result != null")
  private Boolean isContractedType(TypeElement e) {
    Boolean result = Boolean.FALSE;

    /* The current element has contracts on its annotations. */
    result = hasContracts(e.getAnnotationMirrors());

    /* Checks superclass. */
    if (!result) {
      Element superclass =
          utils.typeUtils.asElement(e.getSuperclass());
      if (superclass != null) {
        /* Scans up in the syntax tree looking for contract annotations. */
        result = superclass.accept(this, null);
      }
    }

    /* Checks interfaces. */
    if (!result) {
      Collection<? extends TypeMirror> interfaces = e.getInterfaces();
      for (TypeMirror i : interfaces) {
        Element iface = utils.typeUtils.asElement(i);
        result = iface.accept(this, null);
        if (result) {
          break;
        }
      }
    }

    /* Scan the enclosed elements of this. */
    if (!result) {
      List<? extends Element> enclosed = e.getEnclosedElements();
      for (Element element : enclosed) {
        result = element.accept(this, null);
        if (result) {
          break;
        }
      }
    }

    return result;
  }
644047
protected function isElementValid($element) : bool
    {
        return is_a($element, $this->getType()) || is_subclass_of($element, $this->getType());
    }
42497
private function validate($element)
    {
        $violationList = $this->validator->validate($element, null, ['Generator']);
        if (0 < $violationList->count()) {
            $this->output->writeln('<error>Invalid element</error>');
            /** @var \Symfony\Component\Validator\ConstraintViolationInterface $violation */
            foreach ($violationList as $violation) {
                $this->output->writeln(sprintf('<error>%s : %s</error>', $violation->getPropertyPath(), $violation->getMessage()));
            }

            return false;
        }

        return true;
    }
1044144
public function accept()
    {
        $file = $this->getInnerIterator()->current();
        return !$this->isFileExcluded($this->baseDirectory, $file);
    }
5477
public function valid() : bool
    {
        if ($this->privateErrors()) {
            return false;
        }
        foreach ((array)$this as $element) {
            if (is_string($element)) {
                continue;
            }
            if (!$element->getElement()->valid()) {
                return false;
            }
        }
        return true;
    }
1240807
public function verifyElements(): void
    {
        $this->navLinkTabs->verifyVisibility();
        $this->adminLists['Policies']->verifyVisibility();
        $this->navLinkTabs->goToTab('Assignments');
        $this->adminLists['Assignments']->verifyVisibility();
    }