Manual talk:PHP unit testing/Writing unit tests

From MediaWiki.org
Jump to navigation Jump to search

Set all the configuration settings the test depends on[edit]

Shouldn't the guide also tell to explicitly set all the configuration settings globals a test assumes, via setMWGlobals? Otherwise the test will test those globals, rather than whatever it's supposed to test: a nightmare for everyone running tests on a true development checkout (rather than vanilla core), or changing configuration defaults. Example: [1]. --Nemo 10:51, 5 December 2013 (UTC)

Data Provider naming[edit]

I disagree with provideFoo being a better name than fooProvider. We are generally following the second on for Wikibase (and we actually have over twice as many data providers as core). Now that I noticed some people are using the former one because that is listed here, I will updated the Wikibase guidelines. I can only suggest the same is done here. See also: PHPUnit docs. --Jeroen De Dauw (talk) 08:45, 21 April 2014 (UTC)