Introduce NameTableStoreFactory
authorTim Starling <tstarling@wikimedia.org>
Tue, 4 Sep 2018 01:59:03 +0000 (11:59 +1000)
committerTim Starling <tstarling@wikimedia.org>
Tue, 4 Sep 2018 05:08:38 +0000 (15:08 +1000)
commit0ecfe75502b5a7a7224cf79531b1fd90662048cb
treeaef15342651dea5eb18e75583da75fe5d1017c3d
parent1dc2212bc68c44963d1b32235bd6c80643999fd3
Introduce NameTableStoreFactory

With a separate service for each of the NameTableStore tables, it
wasn't possible to instantiate a NameTableStore for a foreign wiki,
leading to the inelegant situation of having RevisionStoreFactory
construct a new NameTableStoreFactory every time a RevisionStore for a
foreign wiki was requested. These NameTableStore objects were not
tracked in any structured way, so there was no way to reset them for
tests.

So, introduce NameTableStoreFactory, which tracks object instances for
both local and remote table access.

This also avoids having schema details in ServiceWiring.php.

Depends-On: I5c78cfb8bf90eca935a3264592366f63517c4fad
Bug: T202641
Change-Id: Ic0f2d1d94bad9dcc047ff19a1f92db89b7e014ce
includes/MediaWikiServices.php
includes/ServiceWiring.php
includes/Storage/NameTableStoreFactory.php [new file with mode: 0644]
includes/Storage/RevisionStoreFactory.php
tests/phpunit/MediaWikiTestCase.php
tests/phpunit/includes/Storage/NameTableStoreFactoryTest.php [new file with mode: 0644]
tests/phpunit/includes/Storage/RevisionStoreFactoryTest.php
tests/phpunit/includes/Storage/RevisionStoreTest.php
tests/phpunit/includes/changetags/ChangeTagsTest.php