diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2015-12-17 09:15:42 +0100 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2015-12-17 09:44:51 +0100 |
commit | a1789ddde42033f1b05cc4929491214ee6e79383 (patch) | |
tree | 63615735c4ddffaaabf2428946bb26f90899f7bf /vendor/oojs/oojs-ui/bin/generate-JSPHP-for-karma.php | |
parent | 9e06a62f265e3a2aaabecc598d4bc617e06fa32d (diff) |
Update to MediaWiki 1.26.0
Diffstat (limited to 'vendor/oojs/oojs-ui/bin/generate-JSPHP-for-karma.php')
-rw-r--r-- | vendor/oojs/oojs-ui/bin/generate-JSPHP-for-karma.php | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/vendor/oojs/oojs-ui/bin/generate-JSPHP-for-karma.php b/vendor/oojs/oojs-ui/bin/generate-JSPHP-for-karma.php index 445da65c..2cee51e6 100644 --- a/vendor/oojs/oojs-ui/bin/generate-JSPHP-for-karma.php +++ b/vendor/oojs/oojs-ui/bin/generate-JSPHP-for-karma.php @@ -1,26 +1,20 @@ <?php -// Quick and dirty autoloader to make it possible to run without Composer. -spl_autoload_register( function ( $class ) { - $class = preg_replace( '/^OOUI\\\\/', '', $class ); - foreach ( array( 'elements', 'layouts', 'themes', 'widgets', '.' ) as $dir ) { - $path = "../php/$dir/$class.php"; - if ( file_exists( $path ) ) { - require_once $path; - return; - } - } -} ); +require_once __DIR__ . '/../vendor/autoload.php'; -$testSuiteJSON = file_get_contents( 'JSPHP-suite.json' ); +$testSuiteJSON = file_get_contents( __DIR__ . '/../tests/JSPHP-suite.json' ); $testSuite = json_decode( $testSuiteJSON, true ); $testSuiteOutput = array(); +// @codingStandardsIgnoreStart function new_OOUI( $class, $config = array() ) { + // @codingStandardsIgnoreEnd $class = "OOUI\\" . $class; return new $class( $config ); } +// @codingStandardsIgnoreStart function unstub( &$value ) { + // @codingStandardsIgnoreEnd if ( is_string( $value ) && substr( $value, 0, 13 ) === '_placeholder_' ) { $value = json_decode( substr( $value, 13 ), true ); array_walk_recursive( $value['config'], 'unstub' ); @@ -47,4 +41,4 @@ $testSuiteOutputJSON = json_encode( $testSuiteOutput, JSON_PRETTY_PRINT ); echo "var testSuiteConfigs = $testSuiteJSON;\n\n"; echo "var testSuitePHPOutput = $testSuiteOutputJSON;\n\n"; -echo file_get_contents( 'JSPHP.test.karma.js' ); +echo file_get_contents( __DIR__ . '/../tests/JSPHP.test.karma.js' ); |