@@ 39-46 (lines=8) @@ | ||
36 | * @return bool |
|
37 | */ |
|
38 | protected function matchesSafelyWithDiagnosticDescription( $item, Description $mismatchDescription ) { |
|
39 | if ( $item instanceof \DOMDocument ) { |
|
40 | $directChildren = iterator_to_array( $item->documentElement->childNodes ); |
|
41 | ||
42 | $body = array_shift( $directChildren ); |
|
43 | $directChildren = $body->childNodes; |
|
44 | } else { |
|
45 | $directChildren = $item->childNodes; |
|
46 | } |
|
47 | ||
48 | if ( $directChildren->length === 0 ) { |
|
49 | $mismatchDescription->appendText( 'having no children' ); |
@@ 39-46 (lines=8) @@ | ||
36 | * @return bool |
|
37 | */ |
|
38 | protected function matchesSafelyWithDiagnosticDescription( $item, Description $mismatchDescription ) { |
|
39 | if ( $item instanceof \DOMDocument ) { |
|
40 | $directChildren = iterator_to_array( $item->documentElement->childNodes ); |
|
41 | ||
42 | $body = array_shift( $directChildren ); |
|
43 | $directChildren = $body->childNodes; |
|
44 | } else { |
|
45 | $directChildren = $item->childNodes; |
|
46 | } |
|
47 | ||
48 | if ( $directChildren->length === 0 ) { |
|
49 | $mismatchDescription->appendText( 'with no direct children' ); |