X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Fparser%2FMagicVariableTest.php;h=6a2afad6d7fc66a29511130f03021402d681bbdc;hb=999351249b1810385ea2818ec445f784b24b72af;hp=17226113e52fb9408d1f980456e26d7308936dd4;hpb=04d7d46b1d39340121698ba76fd8e433f60929c9;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/parser/MagicVariableTest.php b/tests/phpunit/includes/parser/MagicVariableTest.php index 17226113e5..6a2afad6d7 100644 --- a/tests/phpunit/includes/parser/MagicVariableTest.php +++ b/tests/phpunit/includes/parser/MagicVariableTest.php @@ -10,6 +10,8 @@ * @copyright Copyright © 2011, Antoine Musso * @file * @todo covers tags + * + * @group Database */ class MagicVariableTest extends MediaWikiTestCase { @@ -25,20 +27,20 @@ class MagicVariableTest extends MediaWikiTestCase { * them as integer. * @see MagicVariableTest::assertMagic() */ - private $expectedAsInteger = array( + private $expectedAsInteger = [ 'revisionday', 'revisionmonth1', - ); + ]; /** setup a basic parser object */ protected function setUp() { parent::setUp(); $contLang = Language::factory( 'en' ); - $this->setMwGlobals( array( + $this->setMwGlobals( [ 'wgLanguageCode' => 'en', 'wgContLang' => $contLang, - ) ); + ] ); $this->testParser = new Parser(); $this->testParser->Options( ParserOptions::newFromUserAndLang( new User, $contLang ) ); @@ -60,9 +62,9 @@ class MagicVariableTest extends MediaWikiTestCase { * @return array Array of numbers from 1 up to $num */ private static function createProviderUpTo( $num ) { - $ret = array(); + $ret = []; for ( $i = 1; $i <= $num; $i++ ) { - $ret[] = array( $i ); + $ret[] = [ $i ]; } return $ret; @@ -82,7 +84,7 @@ class MagicVariableTest extends MediaWikiTestCase { return self::createProviderUpTo( 31 ); } - ############### TESTS ############################################# + # ############## TESTS ############################################# # @todo FIXME: # - those got copy pasted, we can probably make them cleaner # - tests are lacking useful messages @@ -155,7 +157,7 @@ class MagicVariableTest extends MediaWikiTestCase { $this->assertUnPadded( 'revisionmonth1', $month ); } - ############### HELPERS ############################################ + # ############## HELPERS ############################################ /** assertion helper expecting a magic output which is zero padded */ public function assertZeroPadded( $magic, $value ) { @@ -187,7 +189,7 @@ class MagicVariableTest extends MediaWikiTestCase { ); # please keep the following commented line of code. It helps debugging. - //print "\nDEBUG (value $value):" . sprintf( '2010%02d%02d123456', $value, $value ) . "\n"; + // print "\nDEBUG (value $value):" . sprintf( '2010%02d%02d123456', $value, $value ) . "\n"; # format expectation and test it $expected = sprintf( $format, $value );