public function elementContains($selectorType, $selector, $html)
    {
        $element = $this->elementExists($selectorType, $selector);
        $actual = $element->getHtml();
        $regex = '/'.preg_quote($html, '/').'/ui';

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

        $this->assertElement((bool) preg_match($regex, $actual), $message, $element);
    }
public function elementContains($selectorType, $selector, $html)
    {
        $element = $this->elementExists($selectorType, $selector);
        $actual = $element->getHtml();
        $regex = '/'.preg_quote($html, '/').'/ui';

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

        $this->assertElement((bool) preg_match($regex, $actual), $message, $element);
    }
public function elementContains ( $ selectorType , $ selector , $ html ) { $ element = $ this -> elementExists ( $ selectorType , $ selector ) ; $ actual = $ element -> getHtml ( ) ; $ regex = '/' . preg_quote ( $ html , '/' ) . '/ui' ; $ message = sprintf ( 'The string "%s" was not found in the HTML of the %s.' , $ html , $ this -> getMatchingElementRepresentation ( $ selectorType , $ selector ) ) ; $ this -> assertElement ( ( bool ) preg_match ( $ regex , $ actual ) , $ message , $ element ) ; }
Checks that specific element contains HTML.

@param string       $selectorType element selector type (css, xpath)
@param string|array $selector     element selector
@param string       $html         expected text

@throws ElementHtmlException
Checks that specific element contains HTML .