public function elementAttributeContains($selectorType, $selector, $attribute, $text)
    {
        $element = $this->elementAttributeExists($selectorType, $selector, $attribute);
        $actual = $element->getAttribute($attribute);
        $regex = '/'.preg_quote($text, '/').'/ui';

        $message = sprintf(
            'The text "%s" was not found in the attribute "%s" of the %s.',
            $text,
            $attribute,
            $this->getMatchingElementRepresentation($selectorType, $selector)
        );

        $this->assertElement((bool) preg_match($regex, $actual), $message, $element);
    }
public function elementAttributeContains($selectorType, $selector, $attribute, $text)
    {
        $element = $this->elementAttributeExists($selectorType, $selector, $attribute);
        $actual = $element->getAttribute($attribute);
        $regex = '/'.preg_quote($text, '/').'/ui';

        $message = sprintf(
            'The text "%s" was not found in the attribute "%s" of the %s.',
            $text,
            $attribute,
            $this->getMatchingElementRepresentation($selectorType, $selector)
        );

        $this->assertElement((bool) preg_match($regex, $actual), $message, $element);
    }
public function elementAttributeContains ( $ selectorType , $ selector , $ attribute , $ text ) { $ element = $ this -> elementAttributeExists ( $ selectorType , $ selector , $ attribute ) ; $ actual = $ element -> getAttribute ( $ attribute ) ; $ regex = '/' . preg_quote ( $ text , '/' ) . '/ui' ; $ message = sprintf ( 'The text "%s" was not found in the attribute "%s" of the %s.' , $ text , $ attribute , $ this -> getMatchingElementRepresentation ( $ selectorType , $ selector ) ) ; $ this -> assertElement ( ( bool ) preg_match ( $ regex , $ actual ) , $ message , $ element ) ; }
Checks that an attribute of a specific elements contains text.

@param string       $selectorType
@param string|array $selector
@param string       $attribute
@param string       $text

@throws ElementHtmlException
Checks that an attribute of a specific elements contains text .