r92588 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r92587‎ | r92588 | r92589 >
Date:21:38, 19 July 2011
Author:platonides
Status:resolved (Comments)
Tags:
Comment:
Follow up r91419. A boolean attribute can be both the empty string and its name [http://www.whatwg.org/specs/web-apps/current-work/multipage/common-microsyntaxes.html#boolean-attributes]
We use the later since that's what xhtml1 required [http://www.w3.org/TR/xhtml1/#h-4.5].
Modified paths:
  • /trunk/phase3/tests/phpunit/includes/HtmlTest.php (modified) (history)

Diff [purge]

Index: trunk/phase3/tests/phpunit/includes/HtmlTest.php
@@ -47,14 +47,13 @@
4848 'Boolean attributes do not generates output when value is null'
4949 );
5050
51 - ### FIXME: maybe they should just output 'selected'
5251 $this->AssertEquals(
53 - ' selected=""',
 52+ ' selected="selected"',
5453 Html::expandAttributes( array( 'selected'=>true ) ),
5554 'Boolean attributes skip value output'
5655 );
5756 $this->AssertEquals(
58 - ' selected=""',
 57+ ' selected="selected"',
5958 Html::expandAttributes( array( 'selected' ) ),
6059 'Boolean attributes (ex: selected) do not need a value'
6160 );

Follow-up revisions

RevisionCommit summaryAuthorDate
r92590Follow-up r92588. Make it work regardless of $wgHtml5platonides22:10, 19 July 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r91419tests for Html::testExpandAttributes()...hashar19:51, 4 July 2011

Comments

#Comment by 😂 (talk | contribs)   22:05, 19 July 2011

Breaks tests:

$ ./phpunit.php includes/HtmlTest.php 
PHPUnit 3.5.13 by Sebastian Bergmann.

.F.

Time: 0 seconds, Memory: 17.75Mb

There was 1 failure:

1) HtmlTest::testExpandAttributesForBooleans
Boolean attributes skip value output
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
- selected="selected"
+ selected=""

/opt/local/apache2/htdocs/phase3/tests/phpunit/includes/HtmlTest.php:54
/opt/local/apache2/htdocs/phase3/tests/phpunit/MediaWikiTestCase.php:64
/opt/local/apache2/htdocs/phase3/tests/phpunit/MediaWikiPHPUnitCommand.php:20
/opt/local/apache2/htdocs/phase3/tests/phpunit/phpunit.php:60

FAILURES!
Tests: 3, Assertions: 10, Failures: 1.
#Comment by Platonides (talk | contribs)   22:08, 19 July 2011

Passes for me. That's precisely why I changed it... it was failing.

#Comment by 😂 (talk | contribs)   22:09, 19 July 2011

Perhaps we have different config? $wgHtml5 related perhaps?

#Comment by Platonides (talk | contribs)   22:10, 19 July 2011

I had tried changing $wgHtml5 without noticing it was overwritten again some lines below. Fixed in r92590.

#Comment by 😂 (talk | contribs)   22:11, 19 July 2011

Works with the followup, thanks!

Status & tagging log