wiki.techinc.nl/tests/parser
Tim Starling 75d7731dde In parserTests.php, fix upload directory handling
Instead of having two conflicting filerepo configurations, one at
/tmp/test-repo and another at a randomized path, and populating the one
that isn't used with files, let's just have a single upload directory,
populate it with files, and then actually use those files.

This fixes a set of confusing system-dependent parser test failures. In
the failure scenario, the file upload would be recorded, but then
invalid JPEG metadata would trigger LocalFile::loadFromFile(), which
would look for the file in the wrong place and mark it missing. Then
parser tests would fail due to image links being broken (red).

This is probably not as nice as the fake in-memory repo used by
NewParserTest, but this approach does provide a richer integration test.
This is a conservative fix that just fixes the things that are terribly
broken rather than making new things.

Also:

* Clear the RepoGroup singleton, for completeness, since it doesn't
  make sense to set $wgLocalRepo without clearing it. Since we now set up
  a similar repo at initialisation to the one set up with each test, it
  probably doesn't have any effect.

* Warn if gd is not present since this causes 49 test failures.

* Use glob patterns in teardownUploadDir() instead of requiring every
  file to be individually listed. This fixes an error due to failure to
  delete a 240px file.

Change-Id: I56a0e0d1cb363b40cf19c735e00cbb8929c1401a
2015-09-28 15:48:32 +10:00
..
preprocess Replace 'emailpage' with 'emailuser' 2015-08-20 10:49:03 +00:00
extraParserTests.txt
parserTest.inc In parserTests.php, fix upload directory handling 2015-09-28 15:48:32 +10:00
ParserTestResult.php tests: Clean up file headers 2015-04-01 00:17:12 +01:00
parserTests.txt Sync up with Parsoid parserTests. 2015-09-24 10:26:13 +02:00
parserTestsParserHook.php Tidy up tidy usage 2015-03-16 16:33:50 -04:00
README

Parser tests are run using our PHPUnit test suite in tests/phpunit:

 $ cd tests/phpunit
 ./phpunit.php --group Parser

You can optionally filter by title using --regex. I.e. :

 ./phpunit.php --group Parser --regex="Bug 6200"