diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2015-08-16 08:22:05 +0200 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2015-08-16 08:22:05 +0200 |
commit | 1a365e77dfb8825136626202b1df462731b42060 (patch) | |
tree | 1dc4468eaabf070e051e790a9e67a9a9a2c63d99 /vendor/zordius/lightncandy/build/gen_test.php | |
parent | a72fd280f7acb4d2a1ba579a0f1b2b2ae8958530 (diff) |
Update to MediaWiki 1.25.2
Diffstat (limited to 'vendor/zordius/lightncandy/build/gen_test.php')
-rw-r--r-- | vendor/zordius/lightncandy/build/gen_test.php | 64 |
1 files changed, 0 insertions, 64 deletions
diff --git a/vendor/zordius/lightncandy/build/gen_test.php b/vendor/zordius/lightncandy/build/gen_test.php deleted file mode 100644 index 97d49489..00000000 --- a/vendor/zordius/lightncandy/build/gen_test.php +++ /dev/null @@ -1,64 +0,0 @@ -<?php - -foreach (Array( - 'vendor/phpunit/phpunit/PHPUnitPHPUnit/Autoload.php', - 'PHPUnit/Autoload.php', - 'src/lightncandy.php' -) as $inc) { - if (file_exists($inc)) { - include_once($inc); - break; - } -} - -genTestForClass('LightnCandy'); -genTestForClass('LCRun3'); - -function genTestForClass($classname) { - ob_start(); - - echo <<<VAR -<?php -/** - * Generated by build/gen_test - */ -require_once('src/lightncandy.php'); - -class {$classname}Test extends PHPUnit_Framework_TestCase -{ - -VAR - ; - - $class = new ReflectionClass($classname); - foreach ($class->getMethods() as $method) { - if (preg_match_all('/@expect (.+) when input (.+)( after (.+))?/', $method->getDocComment(), $matched)) { - echo <<<VAR - /** - * @covers {$classname}::{$method->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"); - } -} -?> |