"Hashar" posted a comment on MediaWiki.r105809. URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/105809#c27333
Commit summary for MediaWiki.r105809: Update wfArrayToCGI and wfCgiToArray: - 'foo' => '' now outputs "&foo=" instead of the key being omitted - 'foo' => null and 'foo' => false now omit the key instead of outputting "&foo=" - Added a test to make sure that 'foo' => true outputs "&foo=1" - Fixed a php notice caused when passing a =value-less bit like "&qwerty" to wfCgiToArray by treating it like php and extracting it as 'qwerty' => '' - Updated tests Hashar's comment: You really want to add one test by expectation. In the above case, if some break, you don't know what is broken exactly since everything is tested in the same assertion. Make sure to test CGI to Array and the same issue with Array to CGI Consider adding a test per type: 'StringEmpty' => '' Then another one for: 'StringNull' =>null And a last one for: 'BooleanFalse' => false What does '?empty=&some=1' gives when using CGI to Array? Will $empty be null ? _______________________________________________ MediaWiki-CodeReview mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview
