alecpl
2012-03-08 54dfd155414e501ad62e81625ffadec86ca90980
tests/html_to_text.php
@@ -32,14 +32,29 @@
                'in'    => '"',
                'out'   => '"',
            ),
            3 => array(
                'title' => 'HTML entity in STRONG tag',
                'in'    => '<strong>&#347;</strong>', // ś
                'out'   => 'Ś', // upper ś
            ),
            4 => array(
                'title' => 'STRONG tag to upper-case conversion',
                'in'    => '<strong>ś</strong>',
                'out'   => 'Ś',
            ),
            5 => array(
                'title' => 'STRONG inside B tag',
                'in'    => '<b><strong>&#347;</strong></b>',
                'out'   => 'Ś',
            ),
        );
        $ht = new html2text(null, false, false);
        foreach ($data as $item) {
        foreach ($data as $idx => $item) {
            $ht->set_html($item['in']);
            $res = $ht->get_text();
            $this->assertEqual($item['out'], $res, $item['title']);
            $this->assertEqual($item['out'], $res, $item['title'] . "($idx)");
        }
    }