Skip to content
This repository was archived by the owner on Feb 13, 2020. It is now read-only.

Commit 03105a8

Browse files
committed
MarkdownExtra_Parser fails to autoload triggering a fatal error in PHPUnit - Refs #4086
1 parent 20adfa5 commit 03105a8

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

init.php

+15-1
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,18 @@
2727
'controller' => 'userguide',
2828
'action' => 'docs',
2929
'module' => '',
30-
));
30+
));
31+
32+
// Simple autoloader used to encourage PHPUnit to behave itself.
33+
class Markdown_Autoloader {
34+
public static function autoload($class)
35+
{
36+
if ($class == 'Markdown_Parser' OR $class == 'MarkdownExtra_Parser')
37+
{
38+
include_once Kohana::find_file('vendor', 'markdown/markdown');
39+
}
40+
}
41+
}
42+
43+
// Register the autoloader
44+
spl_autoload_register(array('Markdown_Autoloader', 'autoload'));

0 commit comments

Comments
 (0)