1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-16 19:44:09 +02:00

Tweak last parser commit and added getTags() test.

This commit is contained in:
Cameron
2020-12-14 11:18:12 -08:00
parent 2a31f831a9
commit c258b856f2
3 changed files with 33 additions and 11 deletions

View File

@@ -787,12 +787,32 @@ while($row = $sql->fetch())
{
}
*/
public function testGetTags()
{
$html = "<div><img src='#' alt='whatever' /></div>";
$result = $this->tp->getTags($html, 'img');
$expected = array (
'img' =>
array (
0 =>
array (
'src' => '#',
'alt' => 'whatever',
'@value' => '<img alt="whatever" src="#"></img>',
),
),
);
if(empty($expected['img'][0]))
{
$this->assertTrue(false, "getTags() didn't return the correct value");
}
$this->assertSame($expected['img'][0]['src'], $result['img'][0]['src']);
$this->assertSame($expected['img'][0]['alt'], $result['img'][0]['alt']);
}
*/
public function testToGlyph()
{