function doTest($test) { $this->assertTrue(file_exists(__DIR__ . "/{$test}.html"), "File '{$test}.html' did not exist"); $this->assertTrue(file_exists(__DIR__ . "/{$test}.txt"), "File '{$test}.txt' did not exist"); $input = file_get_contents(__DIR__ . "/{$test}.html"); $expected = Html2Text\Html2Text::fixNewlines(file_get_contents(__DIR__ . "/{$test}.txt")); $output = Html2Text\Html2Text::convert($input); if ($output != $expected) { file_put_contents(__DIR__ . "/{$test}.output", $output); } $this->assertEquals($output, $expected); }
function fix_newlines($text) { return Html2Text\Html2Text::fixNewlines($text); }