This changeset implements 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.
The initial set of tests that met these criteria were identified using the work Amir did in
I88822667693d9e00ac3d4639c87bc24e5083e5e8. These tests were then moved into a new subdirectory
under phpunit/ and organized into a separate test suite. The environment for this suite
is set up via a PHPUnit bootstrap file without a custom entry point.
You can execute these tests by running:
$ vendor/bin/phpunit -d memory_limit=512M -c tests/phpunit/unit-tests.xml
Bug: T89432
Bug: T87781
Bug: T84948
Change-Id: Iad01033a0548afd4d2a6f2c1ef6fcc9debf72c0d
Various miscellaneous clean ups with no change to any of the
logical code. This to make the next commit have a cleaner diff
for easier review.
* Make internal millitime() non-static.
* Improve documentation and add missing @covers annotations.
* Correct getTimestampedID88() documentation to state that
only two values need to be passed, not three.
This is significant because the Flow extension is actually
using this method in a subclass and passes only two values.
Bug: T94522
Change-Id: I2a0c51bea58df4cc0c253c1c10de3ac383f04c8e
I was bored. What? Don't look at me that way.
I mostly targetted mixed tabs and spaces, but others were not spared.
Note that some of the whitespace changes are inside HTML output,
extended regexps or SQL snippets.
Change-Id: Ie206cc946459f6befcfc2d520e35ad3ea3c0f1e0
This should fix the test and make the test failures (if any)
more informative.
The issue was that it was trying to extract a 46-bit segment
(the timestamp). But because the whole thing wasn't 0-padded first,
the timestamp might be shorter. So it would extract part of the next
segment too. That meant it was testing a 46-bit segment with no
guaranteed properties, with arbitrary results.
Bug: T131549
Change-Id: I11c9e86951cc1d6b186710cda6e42ee58c920db8
Currently causing builds to break all over the place. Disable
until someone can attend to it.
Bug: T131549
Change-Id: I0eb29c53e70ef84a4facc137a3bf20f64a673511
These are available in phpunit since 3.5.0, which I think
is reasonable to expect people to have at this point,
especially when we actually require 3.7.0 or higher in phpunit.php:
Use assertSame instead of assertArrayEquals in UIDGeneratorTest.
assertSame (and assertEqual) care about sortorder of the array,
and is perfectly sufficient in this case to check they array is correct.
if ( $puVersion !== '@package_version@' && version_compare( $puVersion, '3.7.0', '<' ) ) {
die( "PHPUnit 3.7.0 or later required; you have {$puVersion}.\n" );
}
Change-Id: Ic32ab45110e4c4304ef046ae8d0e98c741255559
Currently, this test passes in Jenkins, but not with Travis
CI's hhvm where apparently code execution is slower so not
all UIDs are created within the same millisecond. This also
previously masked that the test did not indeed test if the
host bits are identical as instead it tested the MSBs twice.
Bug: 73668
Change-Id: Ic68af599599ace5faa6a687d115d2d3802f6ba1b
Add a UIDGenerator::unitTestTearDown() method that can find an delete
cache files created by UIDGenerator. Call that cleanup method from the
tearDown() method of the UIDGenerator unit tests.
Bug: 44850
Change-Id: If342586d93bbc2a926af2dc388325dcb7c345e37