summaryrefslogtreecommitdiff
path: root/www/wiki/extensions/Translate/tests/phpunit/MediaWikiMessageCheckerTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'www/wiki/extensions/Translate/tests/phpunit/MediaWikiMessageCheckerTest.php')
-rw-r--r--www/wiki/extensions/Translate/tests/phpunit/MediaWikiMessageCheckerTest.php105
1 files changed, 50 insertions, 55 deletions
diff --git a/www/wiki/extensions/Translate/tests/phpunit/MediaWikiMessageCheckerTest.php b/www/wiki/extensions/Translate/tests/phpunit/MediaWikiMessageCheckerTest.php
index cf564e54..11a4a11d 100644
--- a/www/wiki/extensions/Translate/tests/phpunit/MediaWikiMessageCheckerTest.php
+++ b/www/wiki/extensions/Translate/tests/phpunit/MediaWikiMessageCheckerTest.php
@@ -1,16 +1,11 @@
<?php
/**
- * Unit tests.
- *
* @file
* @author Niklas Laxström
* @copyright Copyright © 2012-2013, Niklas Laxström
- * @license GPL-2.0+
+ * @license GPL-2.0-or-later
*/
-/**
- * Unit tests for MediaWikiMessageCheckerTest class.
- */
class MediaWikiMessageCheckerTest extends MediaWikiTestCase {
/**
@@ -22,11 +17,11 @@ class MediaWikiMessageCheckerTest extends MediaWikiTestCase {
}
public function getPluralFormCountProvider() {
- return array(
- array( 2, 'en', 'English has two plural forms' ),
- array( 3, 'ro', 'Romanian has three plural forms' ),
- array( 5, 'br', 'Breton has five plural forms' ),
- );
+ return [
+ [ 2, 'en', 'English has two plural forms' ],
+ [ 3, 'ro', 'Romanian has three plural forms' ],
+ [ 5, 'br', 'Breton has five plural forms' ],
+ ];
}
/**
@@ -38,55 +33,55 @@ class MediaWikiMessageCheckerTest extends MediaWikiTestCase {
}
public function getPluralFormsProvider() {
- return array(
- array(
- array( array( '1', '2' ) ),
+ return [
+ [
+ [ [ '1', '2' ] ],
'a{{PLURAL:#|1|2}}b',
'one plural magic word is parsed correctly'
- ),
+ ],
- array(
- array( array( '1', '2' ), array( '3', '4' ) ),
+ [
+ [ [ '1', '2' ], [ '3', '4' ] ],
'{{PLURAL:#|1|2}}{{PLURAL:#|3|4}}',
'two plural magic words are parsed correctly'
- ),
+ ],
- array(
- array( array( '1', '2{{}}3' ) ),
+ [
+ [ [ '1', '2{{}}3' ] ],
'a{{PLURAL:#|1|2{{}}3}}',
'one plural magic word with curlies inside is parsed correctly'
- ),
+ ],
- array(
- array( array( '0=0', '1=one', '1', '2' ) ),
+ [
+ [ [ '0=0', '1=one', '1', '2' ] ],
'a{{PLURAL:#|0=0|1=one|1|2}}',
'one plural magic word with explicit forms is parsed correctly'
- ),
- array(
- array(),
+ ],
+ [
+ [],
'a{{PLURAL:#|0=0|1=one|1|2}',
'unclosed plural tag is ignored'
- ),
- array(
- array( array( '1=foo', '{{GENDER:#|he}}' ) ),
+ ],
+ [
+ [ [ '1=foo', '{{GENDER:#|he}}' ] ],
'a{{PLURAL:#|1=foo|{{GENDER:#|he}}}}',
'pipes in subtemplates are ignored'
- ),
- array(
- array( array( '[[Special:A|письмо]]', '[[Special:A|писем]]', '[[Special:A|письма]]' ) ),
+ ],
+ [
+ [ [ '[[Special:A|письмо]]', '[[Special:A|писем]]', '[[Special:A|письма]]' ] ],
'{{PLURAL:#|[[Special:A|письмо]]|[[Special:A|писем]]|[[Special:A|письма]]}}',
'pipes in links are ignored'
- ),
- array(
- array(
- array( 'a', 'b' ),
- array( 'c', 'd' ),
- array( '{{PLURAL:#|a|b}}', '{{PLURAL:#|c|d}}' ),
- ),
+ ],
+ [
+ [
+ [ 'a', 'b' ],
+ [ 'c', 'd' ],
+ [ '{{PLURAL:#|a|b}}', '{{PLURAL:#|c|d}}' ],
+ ],
'{{PLURAL:#|{{PLURAL:#|a|b}}|{{PLURAL:#|c|d}}}}',
'nested plurals are handled correctly'
- )
- );
+ ]
+ ];
}
/**
@@ -98,24 +93,24 @@ class MediaWikiMessageCheckerTest extends MediaWikiTestCase {
}
public function removeExplicitPluralFormsProvider() {
- return array(
- array(
- array( '1', '2' ),
- array( '1', '2' ),
+ return [
+ [
+ [ '1', '2' ],
+ [ '1', '2' ],
'default forms are not removed',
- ),
+ ],
- array(
- array( '1', '2' ),
- array( '0=0', '1', '0=0', '2', '1=one' ),
+ [
+ [ '1', '2' ],
+ [ '0=0', '1', '0=0', '2', '1=one' ],
'explicit forms are removed regardless of position',
- ),
+ ],
- array(
- array( '1', '2' ),
- array( '1', '2', '500=lots' ),
+ [
+ [ '1', '2' ],
+ [ '1', '2', '500=lots' ],
'works for any number',
- ),
- );
+ ],
+ ];
}
}