r92590 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r92589‎ | r92590 | r92591 >
Date:22:10, 19 July 2011
Author:platonides
Status:ok (Comments)
Tags:
Comment:
Follow-up r92588. Make it work regardless of $wgHtml5
Modified paths:
  • /trunk/phase3/tests/phpunit/includes/HtmlTest.php (modified) (history)

Diff [purge]

Index: trunk/phase3/tests/phpunit/includes/HtmlTest.php
@@ -36,6 +36,7 @@
3737 }
3838
3939 public function testExpandAttributesForBooleans() {
 40+ global $wgHtml5;
4041 $this->AssertEquals(
4142 '',
4243 Html::expandAttributes( array( 'selected'=>false) ),
@@ -48,12 +49,12 @@
4950 );
5051
5152 $this->AssertEquals(
52 - ' selected="selected"',
 53+ $wgHtml5 ? ' selected=""' : ' selected="selected"',
5354 Html::expandAttributes( array( 'selected'=>true ) ),
5455 'Boolean attributes skip value output'
5556 );
5657 $this->AssertEquals(
57 - ' selected="selected"',
 58+ $wgHtml5 ? ' selected=""' : ' selected="selected"',
5859 Html::expandAttributes( array( 'selected' ) ),
5960 'Boolean attributes (ex: selected) do not need a value'
6061 );

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r92588Follow up r91419. A boolean attribute can be both the empty string and its na...platonides21:38, 19 July 2011

Comments

#Comment by Nikerabbit (talk | contribs)   09:17, 20 July 2011

Is it ok to have dynamic tests like this? Wouldn't it be better to test twice for both cases?

Status & tagging log