From: Antoine Musso Date: Thu, 22 Nov 2012 10:23:13 +0000 (+0100) Subject: normalize sanitizerTest and add coverage tips X-Git-Tag: 1.31.0-rc.0~20998 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/?a=commitdiff_plain;h=2b3714db26c598aa3ded330ac0132472a233e71e;p=lhc%2Fweb%2Fwiklou.git normalize sanitizerTest and add coverage tips * @cover let us mention which function the test is using, help out when building coverage report to make sure we only record traces for that function. * Normalized test functions so they look alike and make use of an optional message. Change-Id: I3e431b28e377f2ca21d06300537f63b2df4a3a99 --- diff --git a/tests/phpunit/includes/SanitizerTest.php b/tests/phpunit/includes/SanitizerTest.php index 5930d6cedf..72b35faf4c 100644 --- a/tests/phpunit/includes/SanitizerTest.php +++ b/tests/phpunit/includes/SanitizerTest.php @@ -156,13 +156,17 @@ class SanitizerTest extends MediaWikiTestCase { /** * @dataProvider provideDeprecatedAttributes + * @cover Sanitizer::fixTagAttributes */ - function testDeprecatedAttributesUnaltered( $inputAttr, $inputEl ) { - - $this->assertEquals( " $inputAttr", Sanitizer::fixTagAttributes( $inputAttr, $inputEl ) ); + function testDeprecatedAttributesUnaltered( $inputAttr, $inputEl, $message = '' ) { + $this->assertEquals( " $inputAttr", + Sanitizer::fixTagAttributes( $inputAttr, $inputEl ), + $message + ); } public static function provideDeprecatedAttributes() { + /** array( , , [message] ) */ return array( array( 'clear="left"', 'br' ), array( 'clear="all"', 'br' ), @@ -180,10 +184,10 @@ class SanitizerTest extends MediaWikiTestCase { /** * @dataProvider provideCssCommentsFixtures + * @cover Sanitizer::checkCss */ function testCssCommentsChecking( $expected, $css, $message = '' ) { - $this->assertEquals( - $expected, + $this->assertEquals( $expected, Sanitizer::checkCss( $css ), $message );