From: Antoine Musso Date: Tue, 14 Feb 2012 09:59:59 +0000 (+0000) Subject: split ns selector tests for filter / disable options X-Git-Tag: 1.31.0-rc.0~24717 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/?a=commitdiff_plain;h=51dacc9fbf7785894abe3b7a0bb3eb5d8bf62258;p=lhc%2Fweb%2Fwiklou.git split ns selector tests for filter / disable options ping r111376 --- diff --git a/tests/phpunit/includes/HtmlTest.php b/tests/phpunit/includes/HtmlTest.php index 566152e4c1..c3c7646ddd 100644 --- a/tests/phpunit/includes/HtmlTest.php +++ b/tests/phpunit/includes/HtmlTest.php @@ -265,19 +265,12 @@ class HtmlTest extends MediaWikiTestCase { ), 'Basic namespace selector with custom values' ); - $immovable = array(); - $namespaces = $wgContLang->getNamespaces(); - foreach ( $namespaces as $nsId => $nsName ) { - if ( !MWNamespace::isMovable( intval( $nsId ) ) ) { - $immovable[] = $nsId; - } } - $this->assertEquals( - '' . "\n" . '' . "\n" . -'' . "\n" . '' . "\n" . '' . "\n" . '' . "\n" . @@ -286,13 +279,40 @@ class HtmlTest extends MediaWikiTestCase { '' . "\n" . '' . "\n" . '' . "\n" . -'' . "\n" . +'' . "\n" . '' . "\n" . '', Html::namespaceSelector( - array( 'exclude' => array( 100, 101 ), 'disable' => $immovable ) + array( 'exclude' => array( 0, 1, 3, 100, 101 ) ) ), - 'Namespace selector without the custom namespace and immovable namespaces disabled.' + 'Namespace selector namespace filtering.' + ); + } + + function testCanDisableANamespaces() { + $this->assertEquals( +'', + Html::namespaceSelector( array( + 'disable' => array( 0, 1, 2, 3, 4 ) + ) ), + 'Namespace selector namespace disabling' ); }