Introduce separate unit tests PHPUnit configuration
authorMáté Szabó <mszabo@wikia-inc.com>
Mon, 17 Jun 2019 21:15:25 +0000 (23:15 +0200)
committerMáté Szabó <mszabo@wikia-inc.com>
Tue, 18 Jun 2019 14:58:34 +0000 (16:58 +0200)
commitb4c546f5ae99575be6b96de50228b263cf6e0c28
tree391d07f3f99664e63f75ebaf4806a0ada610c616
parent6f28cda9d73f0ecdbbbb893137120af572b79ae0
Introduce separate unit tests PHPUnit configuration

This changeset lays down the basic groundwork required to implement
T89432 and related tickets and is based on exploration done
at the Prague Hackathon. The goal is to identify tests in MediaWiki core
that can be run without having to install & configure MediaWiki and its dependencies,
and provide a way to execute these tests via the standard phpunit entry point,
allowing for faster development and integration with existing tooling like IDEs.

This changeset creates a  new subdirectory under phpunit/ and organizes it
into a separate test suite. The environment for this suite is set up
via a PHPUnit bootstrap file without a custom entry point. For B/C, this
directory is also registered in suite.xml, to ensure that existing CI jobs
still pick up tests in the new suite.

For initial testing, a single test class, PasswordFactoryTest, was moved
to this new suite.

You can run the new suite using the follwoing command:
$ vendor/bin/phpunit -d memory_limit=512M -c tests/phpunit/unit-tests.xml

Bug: T84948
Bug: T89432
Bug: T87781
Change-Id: I69b92db3e70093570e05cc0a64c7780a278b321a
tests/common/TestsAutoLoader.php
tests/phpunit/MediaWikiUnitTestCase.php [new file with mode: 0644]
tests/phpunit/includes/password/PasswordFactoryTest.php [deleted file]
tests/phpunit/suite.xml
tests/phpunit/unit-tests.xml [new file with mode: 0644]
tests/phpunit/unit/includes/password/PasswordFactoryTest.php [new file with mode: 0644]
tests/phpunit/unit/initUnitTests.php [new file with mode: 0644]