wiki.techinc.nl/tests/phpunit
Roan Kattouw ca46126e98 resourceloader: Support single-file component .vue files
Allows .vue files to be used in package modules as if they were .js
files: they can be added to the 'packageFiles' array in module
definitions, and require()d from JS files.

In the load.php output, each .vue file is transformed to a function that
contains the JS from the <script> tag, then a line that sets
module.exports.template to the contents of the <template> tag (encoded
as a string). The contents of the <style> tag are added to the module's
styles.

Internally, the type of a .vue file is inferred as 'script-vue', and the
file is parsed with VueComponentParser, which extracts the three parts.
After the transformation, the file's type is set to 'script+style', and
files of this type contribute to both getScript() and getStyles().

This change also adds caching to getPackageFiles(), because it now needs
to be called twice (in getScript() and getStyles()).

Change-Id: Ic0a5c771901450a518eb7d24456053956507e1ed
2020-03-12 14:32:41 -07:00
..
data resourceloader: Support single-file component .vue files 2020-03-12 14:32:41 -07:00
docs
documentation Update all use of $wgVersion to MW_VERSION 2020-02-25 02:16:12 +00:00
includes resourceloader: Support single-file component .vue files 2020-03-12 14:32:41 -07:00
integration/includes rdbms: reduce duplication in Database via helper methods 2020-03-10 22:26:04 +00:00
languages Merge "Reduce usage of the Language class" 2020-03-03 00:08:35 +00:00
maintenance Make use of PHPUnit's assertCount feature where possible 2020-03-02 15:58:41 +00:00
mocks Remove LanguageConverter dependencies on Title and use LinkTarget 2020-02-12 18:37:11 +03:00
skins
structure Add PSR-4 mappings for existing namespaces and the top level 2020-03-10 21:08:30 +11:00
suites
tests
unit Replace all new stdClass() with identical (object)[] 2020-03-04 21:18:30 +00:00
bootstrap.maintenance.php
bootstrap.php
HamcrestPHPUnitIntegration.php
LessFileCompilationTest.php resourceloader: Separate style processing from style file loading 2020-02-12 20:23:24 +00:00
Makefile
MediaWikiCliOptions.php
MediaWikiCoversValidator.php phpunit: Speed up MediaWikiCoversValidator trait 2020-03-08 18:51:38 +00:00
MediaWikiGroupValidator.php
MediaWikiIntegrationTestCase.php
MediaWikiLangTestCase.php
MediaWikiLoggerPHPUnitTestListener.php
MediaWikiPHPUnitCommand.php
MediaWikiPHPUnitResultPrinter.php
MediaWikiPHPUnitTestListener.php
MediaWikiTestCaseTrait.php SearchHandler: add unit test 2020-03-02 20:52:46 +01:00
MediaWikiUnitTestCase.php
phpunit.php
PHPUnit4And6Compat.php
PHPUnit6And8Compat.php
README
ResourceLoaderTestCase.php
run-tests.bat
suite.xml

== MediaWiki PHPUnit Tests ==

The unit and integration tests for MediaWiki are implemented using the PHPUnit testing
framework and require PHPUnit to run.


=== WARNING ===

Some of the integration tests are DESTRUCTIVE and WILL ALTER YOUR WIKI'S CONTENTS.

DO NOT RUN THESE TESTS ON A PRODUCTION SYSTEM OR ON ANY SYSTEM WHERE YOU NEED
TO RETAIN YOUR DATA.


== Installation ==

If you used composer to install MediaWiki's dependencies PHPUnit will already be available, unless
you explicitly specified the --no-dev flag during the install. In this case just run "composer update".

Otherwise follow the installation instructions in the
PHPUnit Manual at:

  https://phpunit.de/manual/current/en/installation.html


== Running tests ==

The tests are run from your operating system's command line.

Ensure that you are in the tests/phpunit directory of your MediaWiki
installation.


On Unix-like operating systems, the tests runs are controlled with a makefile.
Run command:

  make help

for a full list of options for running tests.


On Windows-family operating systems, run the 'run-tests.bat' batch file.


=== Writing tests ===

A guide to writing PHP unit tests for MediaWiki can be found at:

	https://www.mediawiki.org/wiki/Manual:PHP_unit_testing