diff --git a/src/Html2Text.php b/src/Html2Text.php index 6e0f9e5..c7329d4 100644 --- a/src/Html2Text.php +++ b/src/Html2Text.php @@ -68,7 +68,6 @@ class Html2Text '/(
',
+ 'expected' => '',
+ ),
+ 'Without alt tag, wrapped in text' => array(
+ 'html' => 'xx
xx',
+ 'expected' => 'xxxx',
+ ),
+ 'With alt tag' => array(
+ 'html' => '
',
+ 'expected' => '',
+ ),
+ 'With alt, and title tags' => array(
+ 'html' => '
',
+ 'expected' => '',
+ ),
+ 'With alt tag, wrapped in text' => array(
+ 'html' => 'xx
xx',
+ 'expected' => 'xxxx',
+ ),
+ 'With italics' => array(
+ 'html' => '
Blah blah blah',
+ 'expected' => ' Blah _blah_ blah'
+ )
+ );
+ }
+
/**
* @dataProvider imageDataProvider
*/
- public function testImages($html, $expected)
+ public function testImagesAlt($html, $expected)
{
$html2text = new Html2Text($html);
$output = $html2text->getText();
$this->assertEquals($expected, $output);
}
+
+ /**
+ * @dataProvider ImageDataWithoutAltProvider
+ */
+ public function testImagesNoAlt($html, $expected)
+ {
+ $html2text = new Html2Text($html,array('images' => 'none'));
+ $output = $html2text->getText();
+
+ $this->assertEquals($expected, $output);
+ }
}