wiki.techinc.nl/tests/phpunit/includes
Thiemo Kreuz ea7397e071 title: Fix Title::findSubpageDivider() destroying certain strings
This helper method was introduced in I3d8c6f6. I found this bug while
working on I0a5be39. The method was cutting off strings like "/subpage"
into "ubpage".

I made sure no existing test case changed, as you can see.

I also tried to document the basic idea:

The first character can never be a subpage divider, even if it is a
slash, because this would result in an empty base. The code tries to
skip initial slashes and use the first non-empty substring as the base.
However, if there is nothing but slashes, the worst-case fallback is
to use the first slash as if it is the base.

I think there are still 2 different ways to split the following
edge-cases:
* "//foo" could become:
  a) base "/" + divider + subpage "foo", or
  b) base "//foo" with NO subpage.
* "//" could become:
  a) base "/" + divider + empty subpage, or
  b) base "//" with NO subpage.

Personally, I would pick b). But there was a test case already that
forced me to stick to a).

Bug: T229443
Change-Id: I4914b57c81ce6c7fdf10746f0da902c65f0ac2c9
2020-07-28 12:49:55 +02:00
..
actions Merge "Add watchlist expiry to edit form" 2020-07-01 20:32:26 +00:00
api Remove hard deprecated ApiTestCase::doLogin 2020-07-27 14:35:14 +00:00
auth MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
block MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
cache MCR import 2020-07-18 20:34:16 -04:00
changes Fix watchlist query and filters for RecentChanges 2020-07-28 08:38:25 +08:00
changetags Merge "me/contributions: filter by tag" 2020-07-06 06:01:52 +00:00
collation MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
config MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
content Create fallback for undefined content models. 2020-07-22 19:59:09 +02:00
context MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
db MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
debug MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
deferred MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
diff Create fallback for undefined content models. 2020-07-22 19:59:09 +02:00
editpage MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
exception MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
externalstore MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
filebackend Reduce nesting by turning big if-else into guard clauses 2020-07-24 11:55:31 +02:00
filerepo Cleanup up excess commit() call in LocalRepoTest 2020-07-22 16:22:01 -07:00
GlobalFunctions MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
HookContainer HookContainer Integration Test 2020-05-11 13:45:39 -07:00
htmlform MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
http MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
import Check for unknown slot. 2020-07-20 10:39:28 -04:00
interwiki MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
jobqueue MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
language MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
libs Revert "Add a new type of database to the installer from extension" 2020-07-22 16:05:31 -07:00
linkeddata Fix broken PHPDoc comments that don't start with /** 2020-07-23 16:09:41 +00:00
linker Fix visibility of setUp/tearDown 2020-06-16 21:02:05 +02:00
logging MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
mail MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
media MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
Message MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
Navigation MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
objectcache MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
page Fix broken PHPDoc comments that don't start with /** 2020-07-23 16:09:41 +00:00
pager
ParamValidator/TypeDef
parser MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
password MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
Permissions Whitespace cleanup: Use tabs for indentation, avoid double spaces 2020-06-27 07:53:07 +00:00
poolcounter MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
preferences MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
rcfeed MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
registration MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
resourceloader resourceloader: Add some typehints and misc clean up 2020-07-02 03:05:59 +01:00
Rest Rest: Handle Uri constructor exception 2020-07-14 16:54:29 +00:00
Revision Merge "Create fallback for undefined content models." 2020-07-22 18:54:23 +00:00
search MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
session Support SameSite=None cookies 2020-07-07 02:18:45 +01:00
shell shell: Demonstrate that ->restrict( RESTRICT_NONE ) is broken 2020-07-06 17:18:39 -07:00
site MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
skins MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
sparql Whitespace cleanup: Use tabs for indentation, avoid double spaces 2020-06-27 07:53:07 +00:00
specialpage Remove hard deprecated old SpecialPageFactory 2020-07-27 15:01:35 +00:00
specials Fix watchlist query and filters for RecentChanges 2020-07-28 08:38:25 +08:00
Storage PageUpdater: fix handling of null edits 2020-07-21 12:22:33 +02:00
title MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
upload MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
user Remove selectFields User method 2020-07-12 15:21:48 +01:00
utils MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
watcheditem Replace uses of Revision constants 2020-07-03 01:23:44 +00:00
ActorMigrationTest.php
ActorMigrationTest.sql Mostly drop old pre-actor user schemas 2019-09-09 11:38:36 -04:00
AutoLoaderTest.php MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
AutopromoteTest.php MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
CategoryTest.php MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
CommentStoreCommentTest.php
CommentStoreTest.php
CommentStoreTest.sql
ContentSecurityPolicyTest.php MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
DeprecatedGlobalTest.php MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
DiffHistoryBlobTest.php MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
EditPageTest.php Hard deprecate the rest of the Revision class 2020-07-02 09:02:02 +00:00
ExportTest.php Work around change in SimpleXMLElement behavior introduced in PHP 7.3.17 2020-04-30 18:27:15 -04:00
ExtraParserTest.php Remove hard deprecated old SpecialPageFactory 2020-07-27 15:01:35 +00:00
FauxRequestTest.php Fix visibility of setUp/tearDown 2020-06-16 21:02:05 +02:00
GitInfoTest.php MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
HooksTest.php Fix scopedRegister() handler key 2020-07-22 12:24:22 -07:00
HtmlTest.php MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
LinkerTest.php Display remaining watch period in watchstar 2020-07-18 01:45:51 +00:00
LinkFilterTest.php
ListToggleTest.php MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
MagicWordFactoryTest.php MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
MediaWikiServicesTest.php Merge "MediaWikiServicesTest: newMediaWikiServices never has parameters passed" 2020-07-08 07:27:35 +00:00
MediaWikiTest.php MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
MediaWikiVersionFetcherTest.php
MergeHistoryTest.php MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
MessageTest.php Replace all call_user_func(_array) in all tests 2020-06-06 18:41:20 +02:00
MovePageTest.php MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
MultiHttpClientTest.php MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
MWTimestampTest.php
OutputPageTest.php MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
PagePropsTest.php
PrefixSearchTest.php Fix tests/ PSR12.Properties.ConstantVisibility.NotFound 2020-05-16 04:30:21 +01:00
ReadOnlyModeTest.php MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
RevisionDbTest.php Hard deprecate the rest of the Revision class 2020-07-02 09:02:02 +00:00
RevisionTest.php Hard deprecate the rest of the Revision class 2020-07-02 09:02:02 +00:00
RevisionTestModifyableContent.php Fix tests/ PSR12.Properties.ConstantVisibility.NotFound 2020-05-16 04:30:21 +01:00
RevisionTestModifyableContentHandler.php
SampleTest.php
SiteStatsTest.php MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
StatusTest.php Add getMockMessage to MediaWikiTestCaseTrait 2020-05-20 21:52:11 +02:00
SystemBlockTest.php
TemplateCategoriesTest.php
TestLocalisationCache.php
TestLogger.php Replace all call_user_func(_array) in all tests 2020-06-06 18:41:20 +02:00
TestUser.php MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
TestUserRegistry.php
TimeAdjustTest.php Remove unneeded ::setUp and ::tearDown methods that only call parent 2020-06-07 10:09:32 +00:00
TitleMethodsTest.php Fix visibility of setUp/tearDown 2020-06-16 21:02:05 +02:00
TitlePermissionTest.php
TitleTest.php title: Fix Title::findSubpageDivider() destroying certain strings 2020-07-28 12:49:55 +02:00
WebRequestTest.php Make WebRequest::getAcceptLang() return floats instead of strings 2020-07-14 19:10:24 +00:00
WikiMapTest.php Fix visibility of setUp/tearDown 2020-06-16 21:02:05 +02:00
WikiReferenceTest.php
XmlTest.php MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00