src/MarkupAssertionsTrait.php
protected function getInnerHtmlOfMatchedElements($markup, $query)
    {
        $results  = $this->executeDomQuery($markup, $query);
        $contents = [];

        // Loop through results and collect their innerHTML values.
        foreach ($results as $result) {
            $document = new DOMDocument;
            $document->appendChild($document->importNode($result->firstChild, true));

            $contents[] = trim($document->saveHTML());
        }

        return implode(PHP_EOL, $contents);
    }
protected function getInnerHtmlOfMatchedElements($markup, $query)
    {
        $results  = $this->executeDomQuery($markup, $query);
        $contents = [];

        // Loop through results and collect their innerHTML values.
        foreach ($results as $result) {
            $document = new DOMDocument;
            $document->appendChild($document->importNode($result->firstChild, true));

            $contents[] = trim($document->saveHTML());
        }

        return implode(PHP_EOL, $contents);
    }
protected function getInnerHtmlOfMatchedElements ( $ markup , $ query ) { $ results = $ this -> executeDomQuery ( $ markup , $ query ) ; $ contents = [ ] ; // Loop through results and collect their innerHTML values. foreach ( $ results as $ result ) { $ document = new DOMDocument ; $ document -> appendChild ( $ document -> importNode ( $ result -> firstChild , true ) ) ; $ contents [ ] = trim ( $ document -> saveHTML ( ) ) ; } return implode ( PHP_EOL , $ contents ) ; }
Given HTML markup and a DOM selector query, collect the innerHTML of the matched selectors.

@since 1.1.0

@param string $markup The HTML for the DOMDocument.
@param string $query  The DOM selector query.

@return string The concatenated innerHTML of any matched selectors.
Given HTML markup and a DOM selector query collect the innerHTML of the matched selectors .