tests: Add PHPUnit tests for methods in MagicWordFactory::class
authorAlangi Derick <alangiderick@gmail.com>
Mon, 19 Nov 2018 19:07:30 +0000 (20:07 +0100)
committerAlangi Derick <alangiderick@gmail.com>
Tue, 18 Dec 2018 08:03:46 +0000 (09:03 +0100)
commite2de7663bc210f274f9e794fe665e34c3356af49
tree3fbde599de775866764bf05f40931755a389f573
parentd79f256590243e52c8bebd3ad635c73b8abb0498
tests: Add PHPUnit tests for methods in MagicWordFactory::class

* testGetContentLanguage() - covers the getContentLanguage() method.
* testGet() - covers the get() method in the MagicWordFactory class.
* testGetVariableIDs() - covers the getVariableIDs method.
* testGetSubstIDs() - covers the getSubstIDs() method.
* testGetCacheTTL() - covers the getCacheTTL() method. This covers
  both paths when there is a valid and an invalid caching hint.
* makeMagicWordFactory() - a helper function for creating an object
  of the MagicWordFactory class.
* testGetDoubleUnderscoreArray() - covers getDoubleUnderscoreArray()
  method and also calls newArray() under the hood so that is also
  covered.

Change-Id: I5d2166f155e31900cb40c22fb976e81d0d545627
tests/phpunit/includes/MagicWordFactoryTest.php [new file with mode: 0644]