diff options
Diffstat (limited to 'lib/htmlpurifier/tests/generate_mock_once.func.php')
-rw-r--r-- | lib/htmlpurifier/tests/generate_mock_once.func.php | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/htmlpurifier/tests/generate_mock_once.func.php b/lib/htmlpurifier/tests/generate_mock_once.func.php new file mode 100644 index 000000000..3d8710182 --- /dev/null +++ b/lib/htmlpurifier/tests/generate_mock_once.func.php @@ -0,0 +1,11 @@ +<?php + +// since Mocks can't be called from within test files, we need to do +// a little jumping through hoops to generate them +function generate_mock_once($name) { + $mock_name = $name . 'Mock'; + if (class_exists($mock_name, false)) return false; + Mock::generate($name, $mock_name); +} + +// vim: et sw=4 sts=4 |