diff --git a/test/DailyImageWidgetTest.php b/test/DailyImageWidgetTest.php index 07c7796..425ff02 100644 --- a/test/DailyImageWidgetTest.php +++ b/test/DailyImageWidgetTest.php @@ -295,12 +295,22 @@ class DailyImageWidgetTest extends PHPUnit_Framework_TestCase { $this->assertEquals($parse_xml_result, is_array(get_option('hubblesite-daily-image-cache'))); } - function testWidowProtection() { - $this->assertEquals("this is fixed", $this->diw->_fix_widows("this is fixed")); - $this->assertEquals("
this is fixed
", $this->diw->_fix_widows("this is fixed
")); - $this->assertEquals("this is fixed", $this->diw->_fix_widows("this is fixed")); - $this->assertEquals("word", $this->diw->_fix_widows("word")); - $this->assertEquals("this is fixed
Also fixed
", $this->diw->_fix_widows("this is fixed
Also fixed
")); + + function providerTestWidowProtection() { + return array( + array("this is fixed", "this is fixed"), + array("this is fixed
" ,"this is fixed
"), + array("this is fixed", "this is fixed"), + array("word", "word"), + array("this is fixed
Also fixed
", 'this is fixed
Also fixed
') + ); + } + + /** + * @dataProvider providerTestWidowProtection + */ + function testWidowProtection($source, $result) { + $this->assertEquals($result, $this->diw->_fix_widows($source)); } }