From 80f7dc77d430774192b929d780f96260066df2ee Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sun, 18 Oct 2015 09:31:31 +0200 Subject: Update to MediaWiki 1.25.3 --- vendor/zordius/lightncandy/build/gen_test.php | 64 +++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 vendor/zordius/lightncandy/build/gen_test.php (limited to 'vendor/zordius/lightncandy/build/gen_test.php') diff --git a/vendor/zordius/lightncandy/build/gen_test.php b/vendor/zordius/lightncandy/build/gen_test.php new file mode 100644 index 00000000..97d49489 --- /dev/null +++ b/vendor/zordius/lightncandy/build/gen_test.php @@ -0,0 +1,64 @@ +getMethods() as $method) { + if (preg_match_all('/@expect (.+) when input (.+)( after (.+))?/', $method->getDocComment(), $matched)) { + echo <<name} + */ + public function testOn_{$method->name}() { + \$method = new ReflectionMethod('$classname', '{$method->name}'); + +VAR + ; + if ($method->isPrivate() || $method->isProtected()) { + echo " \$method->setAccessible(true);\n"; + } + foreach ($matched[1] as $idx => $expect) { + if ($matched[3][$idx]) { + echo " {$matched[3][$idx]}\n"; + } + echo " \$this->assertEquals($expect, \$method->invoke(null,\n {$matched[2][$idx]}\n ));\n"; + } + echo " }\n"; + } + } + echo "}\n?>"; + + $fn = "tests/{$classname}Test.php"; + if (!file_put_contents($fn, ob_get_clean())) { + die("Can not generate tests into file $fn !!\n"); + } +} +?> -- cgit v1.2.3-54-g00ecf