mediawiki-extensions-Echo/tests/phpunit
Timo Tijhof 2142be10b0 cache: Reduce responsibility of subclass and remove unused parts
* Reduce responsibility of resolve() methods to only supplying
  the resolves values.
  Moved logic for populating the cache and clearing the queue
  to the base class, and made 'lookups' private.

* The second parameter to LocalCache::add() is unused, and never passed.
  Removed to avoid confusion.

* The getTargets() method is unused. Removed.

* The getLookups() method is unused. Removed.

* The internal 'lookups' member was being used both for its keys and its
  values, but never at the same time. This seemed risky, especially in
  EchoRevisionLocalCache::resolve() where the associative array was passed
  directly to the 'where' clause of IDatabase::select(), which shouldn't
  espect keys when creating the 'IN' clause.

  Using only values would keep value types flexible, but would require
  use of the less efficient in_array().
  Keeping both keys and values and calling array_values() would work.
  Using only keys also works and is simpler, so long only ints are used.

* The tests were swapping 'targets' MapCacheLRU with a HashBagOStuff.
  Following-up 4939bff7, this was forgotten, but works because the two
  called methods (get and set) exist in both, but still seems odd.

  Fixed by using TestingAccessWrapper to act on the existing object
  instead of swapping it out.

* Improved tests by asserting more of the observed behaviour and impact.

Change-Id: I530eeac8bf3b407b8c633e0e20c7d35cc49f7a9f
2018-08-17 03:28:02 +00:00
..
api Remove call to doLogin(), which does nothing 2018-04-11 17:11:27 +03:00
cache cache: Reduce responsibility of subclass and remove unused parts 2018-08-17 03:28:02 +00:00
controller Add @covers tags 2018-01-23 16:44:45 -08:00
gateway Add @covers tags 2018-01-23 16:44:45 -08:00
iterator Add @covers tags 2018-01-23 16:44:45 -08:00
maintenance Add @covers tags 2018-01-23 16:44:45 -08:00
mapper NotificationMapper: Use batching in deleteByUserEventOffset() 2018-08-08 14:57:58 -07:00
model Avoid counting where not necessary 2018-06-26 07:10:38 +00:00
revision_txt Ping users mentioned in edit summaries 2018-02-22 12:37:35 -08:00
AttributeManagerTest.php Remove two unused properties from AttributeManager 2018-08-15 09:29:54 +00:00
BundlerTest.php Add @covers tags 2018-01-23 16:44:45 -08:00
ContainmentSetTest.php Add @covers tags 2018-01-23 16:44:45 -08:00
DiffParserTest.php Fix common typos in Echo extension 2018-08-14 12:34:43 +01:00
DiscussionParserTest.php Make "@… array" type hints more specific 2018-08-13 09:27:37 +02:00
EchoDbFactoryTest.php Add @covers tags 2018-01-23 16:44:45 -08:00
EchoSummaryParserTest.php Don't ping from user talk links in summary 2018-03-08 14:36:58 -08:00
NotificationsTest.php Move NotificationsTest to tests/phpunit 2018-06-06 19:30:35 +00:00
NotifUserTest.php Add missing newlines before "use" sections 2018-08-13 09:29:32 +02:00
TalkPageFunctionalTest.php Merge "Fix missing/mismatching type hints PHPDoc tags" 2018-08-16 08:39:29 +00:00
ThankYouEditTest.php Re-enable test coverage reporting, add @covers tags 2018-06-28 08:32:57 -04:00
UserLocatorTest.php Add @covers tags 2018-01-23 16:44:45 -08:00