Last modified: 2013-10-30 13:15:48 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T41461, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 39461 - Impossible to add articles starting with lower case letter during parser tests using "!!article"
Impossible to add articles starting with lower case letter during parser test...
Status: PATCH_TO_REVIEW
Product: MediaWiki
Classification: Unclassified
Unit tests (Other open bugs)
1.20.x
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on: 39473
Blocks:
  Show dependency treegraph
 
Reported: 2012-08-17 18:44 UTC by Daniel A. R. Werner
Modified: 2013-10-30 13:15 UTC (History)
8 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Daniel A. R. Werner 2012-08-17 18:44:15 UTC
Adding an article during a parser test like:

 !! article
 Template:test
 !! text
 Test
 !! endarticle

will not create "Template:test" but "Template:Test", even if $wgCapitalLinks was set to false before (using the new 'ParserTestGlobals' hook).

Apparently, since the following change ParserTest::addArticle() temporarily changes the global during parser tests article creation (to work around another issue?):
https://www.mediawiki.org/w/index.php?title=Special:Code/MediaWiki/71511&path=#c33010

Anyhow, it might be nice to be able use:

 !! article
 Template:test
 !! config
 wgCapitalLinks=false
 !! text
 Test
 !! endarticle

to create the article with certain globals set to specific values. The code above should create the article with the lower "s" instead of "S". Also, $wgCapitalLinks should not be ignored by ParserTest::addArticle() anymore.
Comment 1 Platonides 2012-08-17 18:49:47 UTC
Yes, it would be nice to use 
!! config
 wgCapitalLinks=false


Although it is creating a strange environment to test in, since the tests are
run with wgCapitalLinks=true...
Comment 2 Daniel A. R. Werner 2012-08-18 02:46:09 UTC
I will submit a patch for this soon.

The environment is only strange if you explicitly long for it, and that's even a real world scenario, isn't it? In most cases you would probably set $wgCapitalLinks=false for the tests using this page. But there could even be tests for core, testing how articles created with the option in one state behave after changing the option.
Comment 3 Platonides 2012-08-18 21:12:19 UTC
It looks to me that it should be a different file to be run with different settings. I think that behavior after changing the settings is "undefined" (articles created with initial lowercase will be unavailable until you run a maintenance script, for instance).
Comment 4 Daniel A. R. Werner 2012-08-19 00:38:39 UTC
Submitted a fix, I611d8086

Extensions use different files than the default parser test file already. Core could do the same and use different files for different groups of tests.

I also introduced a new hook, 'ParserTestGlobals' in an earlier commit recently. I will extend that one to allow for registering a certain set of settings per file rather than always registering them for all tests.
It would also be nice to be able to overwrite settings for a whole file within that file.
Comment 5 Platonides 2012-08-20 12:03:27 UTC
(In reply to comment #4)
> Extensions use different files than the default parser test file already. Core
> could do the same and use different files for different groups of tests.

Yes, that's what I was talking about.
Comment 6 Daniel A. R. Werner 2012-11-06 10:45:15 UTC
This is kind of blocked by 39473. At least it is the reason for I611d8086 failing. It's just a paint to make this work with having the two different ways of running parser tests. I believe the change-set I have submitted was optimized by the non-PHPUnit way of running the tests.
Comment 7 Gerrit Notification Bot 2013-10-30 12:46:45 UTC
Change 20534 had a related patch set uploaded by Krinkle:
$wgCapitalLinks=false not ignored during article creation in parser tests anymore

https://gerrit.wikimedia.org/r/20534

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links