Skip to content

Commit 1353671

Browse files
committed
Added test for issue #109
1 parent c8e2b6d commit 1353671

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

tests/DomTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -520,4 +520,13 @@ public function testLoadGetAttributeWithBackslash()
520520
$this->assertEquals("/img/test.png", $imgs->getAttribute('src'));
521521

522522
}
523+
524+
public function test25ChildrenFound()
525+
{
526+
$dom = new Dom();
527+
$dom->setOptions(['whitespaceTextNode' => false]);
528+
$dom->loadFromFile('tests/data/files/51children.html');
529+
$children = $dom->find('#red-line-g *');
530+
$this->assertEquals(25, count($children));
531+
}
523532
}

tests/data/files/51children.html

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<g id="red-line-g" fill="#CC0000">
2+
<rect id="" x="480" y="0" width="10" height="66" clip-path="url(#red-line-2)" data-display="portrait"></rect>
3+
<path d="M485,281 C424.248678,281 375,231.527465 375,170.5 C375,109.472535 424.248678,60 485,60 C545.751322,60 595,109.472535 595,170.5 C595,231.527465 545.751322,281 485,281 Z M485,270.954545 C540.228475,270.954545 585,225.979514 585,170.5 C585,115.020486 540.228475,70.0454545 485,70.0454545 C429.771525,70.0454545 385,115.020486 385,170.5 C385,225.979514 429.771525,270.954545 485,270.954545 Z" id="" clip-path="url(#red-line-4)"></path>
4+
<rect id="" x="480" y="275" width="10" height="738" clip-path="url(#red-line-6)" data-display="portrait"></rect>
5+
<rect id="" x="490" y="1002" width="390" height="11" clip-path="url(#red-line-8)" data-display="landscape"></rect>
6+
<rect id="" x="870" y="1012" width="10" height="246" clip-path="url(#red-line-10)" data-display="portrait"></rect>
7+
<path d="M875,1473 C814.248678,1473 765,1423.52746 765,1362.5 C765,1301.47254 814.248678,1252 875,1252 C935.751322,1252 985,1301.47254 985,1362.5 C985,1423.52746 935.751322,1473 875,1473 Z M875,1462.95455 C930.228475,1462.95455 975,1417.97951 975,1362.5 C975,1307.02049 930.228475,1262.04545 875,1262.04545 C819.771525,1262.04545 775,1307.02049 775,1362.5 C775,1417.97951 819.771525,1462.95455 875,1462.95455 Z" id="" clip-path="url(#red-line-12)"></path>
8+
<rect id="" x="870" y="1467" width="10" height="246" clip-path="url(#red-line-14)" data-display="portrait"></rect>
9+
<rect id="" x="140" y="2312" width="10" height="331" clip-path="url(#red-line-16)" data-display="portrait"></rect>
10+
<rect id="" x="150" y="2632" width="766" height="11" clip-path="url(#red-line-18)" data-display="landscape"></rect>
11+
<rect id="" x="916" y="2632" width="10" height="649" clip-path="url(#red-line-20)" data-display="portrait"></rect>
12+
<rect id="" x="0" y="3270" width="916" height="11" clip-path="url(#red-line-22)" data-display="landscape"></rect>
13+
<rect id="" x="926" y="3270" width="274" height="11" clip-path="url(#red-line-24)" data-display="landscape"></rect>
14+
<rect id="" x="1190" y="3280" width="10" height="961" clip-path="url(#red-line-26)" data-display="portrait"></rect>
15+
<rect id="" x="284" y="4240" width="916" height="11" clip-path="url(#red-line-28)" data-display="landscape"></rect>
16+
<rect id="" x="0" y="4240" width="274" height="11" clip-path="url(#red-line-30)" data-display="landscape"></rect>
17+
<rect id="" x="0" y="3280" width="10" height="961" clip-path="url(#red-line-32)" data-display="portrait"></rect>
18+
<rect id="" x="274" y="4240" width="10" height="207" clip-path="url(#red-line-34)" data-display="portrait"></rect>
19+
<path d="M279,4663 C218.248678,4663 169,4613.52746 169,4552.5 C169,4491.47254 218.248678,4442 279,4442 C339.751322,4442 389,4491.47254 389,4552.5 C389,4613.52746 339.751322,4663 279,4663 Z M279,4652.95455 C334.228475,4652.95455 379,4607.97951 379,4552.5 C379,4497.02049 334.228475,4452.04545 279,4452.04545 C223.771525,4452.04545 179,4497.02049 179,4552.5 C179,4607.97951 223.771525,4652.95455 279,4652.95455 Z" id="" clip-path="url(#red-line-36)"></path>
20+
<rect id="" x="274" y="4657" width="10" height="154" clip-path="url(#red-line-38)" data-display="portrait"></rect>
21+
<rect id="" x="20" y="4810" width="518" height="11" clip-path="url(#red-line-40)" data-display="landscape"></rect>
22+
<rect id="" x="20" y="5056" width="518" height="11" clip-path="url(#red-line-42)" data-display="landscape"></rect>
23+
<rect id="" x="274" y="5066" width="10" height="201" clip-path="url(#red-line-44)" data-display="portrait"></rect>
24+
<rect id="" x="284" y="5256" width="476" height="11" clip-path="url(#red-line-46)" data-display="landscape"></rect>
25+
<rect id="" x="750" y="5266" width="10" height="911" clip-path="url(#red-line-48)" data-display="portrait"></rect>
26+
<path d="M755,6392 C694.248678,6392 645,6342.52746 645,6281.5 C645,6220.47254 694.248678,6171 755,6171 C815.751322,6171 865,6220.47254 865,6281.5 C865,6342.52746 815.751322,6392 755,6392 Z M755,6381.95455 C810.228475,6381.95455 855,6336.97951 855,6281.5 C855,6226.02049 810.228475,6181.04545 755,6181.04545 C699.771525,6181.04545 655,6226.02049 655,6281.5 C655,6336.97951 699.771525,6381.95455 755,6381.95455 Z" id="" clip-path="url(#red-line-50)"></path>
27+
</g>

0 commit comments

Comments
 (0)