mirror of
https://github.com/Universal-Omega/PortableInfobox.git
synced 2024-11-15 20:09:44 +00:00
DAT-3331 update comment, reformat
This commit is contained in:
parent
5f42ce9742
commit
c477600b9d
|
@ -215,10 +215,14 @@ class PortableInfoboxParserTagControllerTest extends WikiaBaseTest {
|
||||||
|
|
||||||
$result = [ ];
|
$result = [ ];
|
||||||
$xpath = $this->getXPath( $output );
|
$xpath = $this->getXPath( $output );
|
||||||
|
// get all data nodes from parsed infobox
|
||||||
$dataNodes = $xpath->query( '//aside/div[contains(@class,\'pi-data\')]' );
|
$dataNodes = $xpath->query( '//aside/div[contains(@class,\'pi-data\')]' );
|
||||||
for ( $i = 0; $i < $dataNodes->length; $i++ ) {
|
for ( $i = 0; $i < $dataNodes->length; $i++ ) {
|
||||||
$result[ $xpath->query( 'h3[contains(@class, \'pi-data-label\')]', $dataNodes->item( $i ) )->item( 0 )->nodeValue ] =
|
// get map of label => value from parsed data node
|
||||||
$xpath->query( 'div[contains(@class, \'pi-data-value\')]', $dataNodes->item( $i ) )->item( 0 )->nodeValue;
|
$result[ $xpath->query( 'h3[contains(@class, \'pi-data-label\')]', $dataNodes->item( $i ) )
|
||||||
|
->item( 0 )->nodeValue ] =
|
||||||
|
$xpath->query( 'div[contains(@class, \'pi-data-value\')]', $dataNodes->item( $i ) )
|
||||||
|
->item( 0 )->nodeValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->assertEquals( $expected, $result );
|
$this->assertEquals( $expected, $result );
|
||||||
|
|
Loading…
Reference in a new issue