mirror of
https://github.com/erusev/parsedown.git
synced 2023-08-10 21:13:06 +03:00
update test case to make it run on PHP 5.2
This commit is contained in:
parent
96bf75bd91
commit
d96f668c42
@ -20,20 +20,29 @@ class Test extends PHPUnit_Framework_TestCase
|
|||||||
{
|
{
|
||||||
$provider = array();
|
$provider = array();
|
||||||
|
|
||||||
$DirectoryIterator = new DirectoryIterator(__DIR__ . '/' . self::provider_dir);
|
$path = dirname(__FILE__).'/';
|
||||||
|
|
||||||
|
$DirectoryIterator = new DirectoryIterator($path . '/' . self::provider_dir);
|
||||||
|
|
||||||
foreach ($DirectoryIterator as $Item)
|
foreach ($DirectoryIterator as $Item)
|
||||||
{
|
{
|
||||||
if ($Item->isFile() and $Item->getExtension() === 'md')
|
if ($Item->isFile())
|
||||||
{
|
{
|
||||||
|
$filename = $Item->getFilename();
|
||||||
|
|
||||||
|
$extension = pathinfo($filename, PATHINFO_EXTENSION);
|
||||||
|
|
||||||
|
if ($extension !== 'md')
|
||||||
|
continue;
|
||||||
|
|
||||||
$basename = $Item->getBasename('.md');
|
$basename = $Item->getBasename('.md');
|
||||||
|
|
||||||
$markdown = file_get_contents(__DIR__ . '/' . self::provider_dir . $basename . '.md');
|
$markdown = file_get_contents($path . '/' . self::provider_dir . $basename . '.md');
|
||||||
|
|
||||||
if (!$markdown)
|
if (!$markdown)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
$expected_markup = file_get_contents(__DIR__ . '/' . self::provider_dir . $basename . '.html');
|
$expected_markup = file_get_contents($path . '/' . self::provider_dir . $basename . '.html');
|
||||||
$expected_markup = str_replace("\r\n", "\n", $expected_markup);
|
$expected_markup = str_replace("\r\n", "\n", $expected_markup);
|
||||||
$expected_markup = str_replace("\r", "\n", $expected_markup);
|
$expected_markup = str_replace("\r", "\n", $expected_markup);
|
||||||
|
|
||||||
@ -44,4 +53,3 @@ class Test extends PHPUnit_Framework_TestCase
|
|||||||
return $provider;
|
return $provider;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user