Commit graph

7 commits

Author SHA1 Message Date
Thiemo Kreuz b6250d3791 Add missing test cases for ExtractFormatter
This is especially covering:
* The behavior on different kinds of HTML encoded characters.
* Trimming, or more precisely the fact that the formatter currently does
  not do all the trimming. There is a trim() call in the test that should
  not be there. This will be reworked in a following patch.

Additionally:
* Prefer strict assertSame() where possible.
* Remove two assertions that don't help making the test more safe.
* Utilize the new `// phpcs:…` syntax.

Change-Id: Ic361f2644300dcef3fc972a2dc2ae19ad34fa513
2019-03-19 17:58:32 +01:00
Thiemo Kreuz ed1f73365f Add test cases for all (private) memory caching helper methods
This patch does two things:

* Add a testMemCacheHelpers() test for the setCache(), getFromCache(),
as well as cacheKey() methods.

* Simplify the existing test setup utilizing the PHPUnit4And6Compat
layer. I'm also replacing the Config mock with an actual HashConfig,
because that's a really trivial object that does not need to be mocked.

Change-Id: I7e8a62651a53919d338a7d921f548e941b671670
2019-02-13 14:37:24 +01:00
Thiemo Kreuz ca83bbfd3b Improve coverage for mostly untested ApiQueryExtracts
Instead of trying to come up with a (probably hypercomplex) integration
test for the entire API module, I start to test a few more critical
details. Yes, this is now testing private implementation details. This
is meant as a migration path. See, it's hard to test code like this
without rewriting it, and hard to rewrite it without tests. This patch
aims to give us a little more confidence for future rewrites.

Change-Id: I0405e13eba31124fcb5af83159d7438fe0ad9879
2019-02-11 17:37:20 +01:00
libraryupgrader 2ecb9f8f06 build: Updating mediawiki/mediawiki-codesniffer to 16.0.0
Change-Id: Ib1a9584cab61f71c3525b0a81d906f457dab3eb6
2018-02-15 14:32:47 +00:00
Kunal Mehta b463a99a79 Fix and add @covers tags
Change-Id: Ifa11ee418e016c103fb0ac6b32a790a2977aec8d
2018-01-23 14:54:12 -08:00
Baha 182304dc6d API: Limit maximum number of characters when exchars is passed.
Set the limit to 1200 characters.

Bug: T156467
Change-Id: I4e53b26a3f57f5f5cf7acbd3702c8bc4541a5eb5
2017-05-24 18:04:20 -04:00
Baha 6bfe60508a Increase default API limit from 1 to 20
Bug: T153707
Change-Id: I6ba3adb7c680e1a60461cd3903cbf8640721ea02
2017-05-19 09:39:13 -04:00