dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "[MCR] pass $queryFlags into RevisionStore::getTitle"
[lhc/web/wiklou.git]
/
tests
/
phpunit
/
includes
/
parser
/
MagicVariableTest.php
diff --git
a/tests/phpunit/includes/parser/MagicVariableTest.php
b/tests/phpunit/includes/parser/MagicVariableTest.php
index
cd54a9e
..
9f5e386
100644
(file)
--- a/
tests/phpunit/includes/parser/MagicVariableTest.php
+++ b/
tests/phpunit/includes/parser/MagicVariableTest.php
@@
-9,11
+9,13
@@
* @author Antoine Musso
* @copyright Copyright © 2011, Antoine Musso
* @file
* @author Antoine Musso
* @copyright Copyright © 2011, Antoine Musso
* @file
- * @todo covers tags
*
* @group Database
*/
*
* @group Database
*/
+/**
+ * @covers Parser::getVariableValue
+ */
class MagicVariableTest extends MediaWikiTestCase {
/**
* @var Parser
class MagicVariableTest extends MediaWikiTestCase {
/**
* @var Parser
@@
-27,20
+29,20
@@
class MagicVariableTest extends MediaWikiTestCase {
* them as integer.
* @see MagicVariableTest::assertMagic()
*/
* them as integer.
* @see MagicVariableTest::assertMagic()
*/
- private $expectedAsInteger =
array(
+ private $expectedAsInteger =
[
'revisionday',
'revisionmonth1',
'revisionday',
'revisionmonth1',
-
)
;
+
]
;
/** setup a basic parser object */
protected function setUp() {
parent::setUp();
$contLang = Language::factory( 'en' );
/** setup a basic parser object */
protected function setUp() {
parent::setUp();
$contLang = Language::factory( 'en' );
- $this->setMwGlobals(
array(
+ $this->setMwGlobals(
[
'wgLanguageCode' => 'en',
'wgContLang' => $contLang,
'wgLanguageCode' => 'en',
'wgContLang' => $contLang,
-
)
);
+
]
);
$this->testParser = new Parser();
$this->testParser->Options( ParserOptions::newFromUserAndLang( new User, $contLang ) );
$this->testParser = new Parser();
$this->testParser->Options( ParserOptions::newFromUserAndLang( new User, $contLang ) );
@@
-62,9
+64,9
@@
class MagicVariableTest extends MediaWikiTestCase {
* @return array Array of numbers from 1 up to $num
*/
private static function createProviderUpTo( $num ) {
* @return array Array of numbers from 1 up to $num
*/
private static function createProviderUpTo( $num ) {
- $ret =
array()
;
+ $ret =
[]
;
for ( $i = 1; $i <= $num; $i++ ) {
for ( $i = 1; $i <= $num; $i++ ) {
- $ret[] =
array( $i )
;
+ $ret[] =
[ $i ]
;
}
return $ret;
}
return $ret;
@@
-84,7
+86,7
@@
class MagicVariableTest extends MediaWikiTestCase {
return self::createProviderUpTo( 31 );
}
return self::createProviderUpTo( 31 );
}
- ############### TESTS #############################################
+ #
############## TESTS #############################################
# @todo FIXME:
# - those got copy pasted, we can probably make them cleaner
# - tests are lacking useful messages
# @todo FIXME:
# - those got copy pasted, we can probably make them cleaner
# - tests are lacking useful messages
@@
-157,7
+159,7
@@
class MagicVariableTest extends MediaWikiTestCase {
$this->assertUnPadded( 'revisionmonth1', $month );
}
$this->assertUnPadded( 'revisionmonth1', $month );
}
- ############### HELPERS ############################################
+ #
############## HELPERS ############################################
/** assertion helper expecting a magic output which is zero padded */
public function assertZeroPadded( $magic, $value ) {
/** assertion helper expecting a magic output which is zero padded */
public function assertZeroPadded( $magic, $value ) {
@@
-189,7
+191,7
@@
class MagicVariableTest extends MediaWikiTestCase {
);
# please keep the following commented line of code. It helps debugging.
);
# 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 );
# format expectation and test it
$expected = sprintf( $format, $value );