Skip to content

Commit dcde964

Browse files
committed
Merge pull request #13 from wmde/removeapiparsers
Removed API based parsers
2 parents 30a0dad + 04ac7dc commit dcde964

File tree

99 files changed

+512
-814
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+512
-814
lines changed

DataValues.resources.mw.php

Lines changed: 0 additions & 95 deletions
This file was deleted.

DataValues.tests.qunit.php

Lines changed: 0 additions & 103 deletions
This file was deleted.

DataValuesJavascript.php

Lines changed: 13 additions & 122 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
// @codeCoverageIgnoreStart
4+
35
if ( defined( 'DATA_VALUES_JAVASCRIPT_VERSION' ) ) {
46
// Do not initialize more than once.
57
return 1;
@@ -26,9 +28,10 @@
2628
// Resource Loader module registration
2729
$GLOBALS['wgResourceModules'] = array_merge(
2830
$GLOBALS['wgResourceModules'],
29-
include( __DIR__ . '/DataValues.resources.mw.php' ),
30-
include( __DIR__ . '/js/ValueParsers.resources.mw.php' ),
31-
include( __DIR__ . '/js/ValueFormatters.resources.mw.php' )
31+
include( __DIR__ . '/lib/resources.php' ),
32+
include( __DIR__ . '/src/resources.mw.php' ),
33+
include( __DIR__ . '/src/valueParsers/resources.mw.php' ),
34+
include( __DIR__ . '/src/valueFormatters/resources.mw.php' )
3235
);
3336

3437
// API module registration
@@ -48,129 +51,17 @@
4851
* @param \ResourceLoader &$resourceLoader
4952
* @return boolean
5053
*/
51-
$GLOBALS['wgHooks']['ResourceLoaderTestModules'][] = function ( array &$testModules, \ResourceLoader &$resourceLoader ) {
52-
// Register DataValue QUnit tests. Take the predefined test definitions and make them
53-
// suitable for registration with MediaWiki's resource loader.
54-
$ownModules = include( __DIR__ . '/DataValues.tests.qunit.php' );
55-
$ownModulesTemplate = array(
56-
'localBasePath' => __DIR__,
57-
'remoteExtPath' => '..' . substr( __DIR__, strlen( $GLOBALS['IP'] ) ),
58-
);
59-
foreach( $ownModules as $ownModuleName => $ownModule ) {
60-
$testModules['qunit'][ $ownModuleName ] = $ownModule + $ownModulesTemplate;
61-
}
62-
return true;
63-
};
64-
65-
/**
66-
* Hook to add QUnit test cases.
67-
* @see https://www.mediawiki.org/wiki/Manual:Hooks/ResourceLoaderTestModules
68-
* @since 0.1
69-
*
70-
* @param array &$testModules
71-
* @param \ResourceLoader &$resourceLoader
72-
* @return boolean
73-
*/
74-
$GLOBALS['wgHooks']['ResourceLoaderTestModules'][] = function ( array &$testModules, \ResourceLoader &$resourceLoader ) {
75-
// @codeCoverageIgnoreStart
76-
$moduleTemplate = array(
77-
'localBasePath' => __DIR__ . '/js/tests/ValueParsers',
78-
'remoteExtPath' => '..' . substr( __DIR__, strlen( $GLOBALS['IP'] ) ) . '/js/tests/ValueParsers',
79-
);
80-
81-
$testModules['qunit']['ext.valueParsers.tests'] = $moduleTemplate + array(
82-
'scripts' => array(
83-
'ValueParser.tests.js',
84-
),
85-
'dependencies' => array(
86-
'valueParsers.parsers',
87-
),
88-
);
89-
90-
$testModules['qunit']['ext.valueParsers.factory'] = $moduleTemplate + array(
91-
'scripts' => array(
92-
'ValueParserFactory.tests.js',
93-
),
94-
'dependencies' => array(
95-
'qunit.parameterize',
96-
'valueParsers.factory',
97-
'valueParsers.parsers',
98-
),
99-
);
100-
101-
$testModules['qunit']['ext.valueParsers.parsers'] = $moduleTemplate + array(
102-
'scripts' => array(
103-
'parsers/BoolParser.tests.js',
104-
'parsers/GlobeCoordinateParser.tests.js',
105-
'parsers/FloatParser.tests.js',
106-
'parsers/IntParser.tests.js',
107-
'parsers/StringParser.tests.js',
108-
'parsers/TimeParser.tests.js',
109-
'parsers/QuantityParser.tests.js',
110-
'parsers/NullParser.tests.js',
111-
),
112-
'dependencies' => array(
113-
'ext.valueParsers.tests',
114-
'util.inherit',
115-
),
116-
);
117-
118-
return true;
119-
// @codeCoverageIgnoreEnd
120-
};
121-
122-
/**
123-
* Adding valueFormatters QUnit tests.
124-
* @see https://www.mediawiki.org/wiki/Manual:Hooks/ResourceLoaderTestModules
125-
* @since 0.1
126-
*
127-
* @param array &$testModules
128-
* @param \ResourceLoader &$resourceLoader
129-
* @return boolean
130-
*/
13154
$GLOBALS['wgHooks']['ResourceLoaderTestModules'][] = function(
13255
array &$testModules,
13356
\ResourceLoader &$resourceLoader
13457
) {
135-
// @codeCoverageIgnoreStart
136-
$moduleTemplate = array(
137-
'localBasePath' => __DIR__ . '/js/tests/ValueFormatters',
138-
'remoteExtPath' => '..' . substr( __DIR__, strlen( $GLOBALS['IP'] ) ) . '/js/tests/ValueFormatters',
58+
$testModules['qunit'] = array_merge(
59+
$testModules['qunit'],
60+
include( __DIR__ . '/tests/lib/resources.php' ),
61+
include( __DIR__ . '/tests/src/resources.php' ),
62+
include( __DIR__ . '/tests/src/valueFormatters/resources.php' ),
63+
include( __DIR__ . '/tests/src/valueParsers/resources.php' )
13964
);
14065

141-
$testModules['qunit']['ext.valueFormatters.tests'] = $moduleTemplate + array(
142-
'scripts' => array(
143-
'ValueFormatter.tests.js',
144-
),
145-
'dependencies' => array(
146-
'valueFormatters',
147-
'valueFormatters.ValueFormatter',
148-
),
149-
);
150-
151-
$testModules['qunit']['ext.valueFormatters.factory'] = $moduleTemplate + array(
152-
'scripts' => array(
153-
'ValueFormatterFactory.tests.js',
154-
),
155-
'dependencies' => array(
156-
'qunit.parameterize',
157-
'valueFormatters.factory',
158-
'valueFormatters.formatters',
159-
),
160-
);
161-
162-
$testModules['qunit']['ext.valueFormatters.formatters'] = $moduleTemplate + array(
163-
'scripts' => array(
164-
'formatters/NullFormatter.tests.js',
165-
'formatters/StringFormatter.tests.js',
166-
),
167-
'dependencies' => array(
168-
'ext.valueFormatters.tests',
169-
'util.inherit',
170-
'valueFormatters.formatters',
171-
),
172-
);
173-
17466
return true;
175-
// @codeCoverageIgnoreEnd
176-
};
67+
};

COPYING renamed to LICENCE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
The license text below "----" applies to all files within this distribution, other
2-
than those that are in a directory which contains files named "LICENSE" or
2+
than those that are in a directory which contains files named "LICENCE", "LICENSE" or
33
"COPYING", or a subdirectory thereof. For those files, the license text contained in
44
said file overrides any license information contained in directories of smaller depth.
55
Alternative licenses are typically used for software that is provided by external

0 commit comments

Comments
 (0)