MediaWiki
REL1_31
wfShorthandToIntegerTest.php
Go to the documentation of this file.
1
<?php
2
7
class
WfShorthandToIntegerTest
extends
MediaWikiTestCase
{
11
public
function
testWfShorthandToInteger
(
$input
,
$output
, $description ) {
12
$this->assertEquals(
13
wfShorthandToInteger
(
$input
),
14
$output
,
15
$description
16
);
17
}
18
19
public
static
function
provideABunchOfShorthands
() {
20
return
[
21
[
''
, -1,
'Empty string'
],
22
[
' '
, -1,
'String of spaces'
],
23
[
'1G'
, 1024 * 1024 * 1024,
'One gig uppercased'
],
24
[
'1g'
, 1024 * 1024 * 1024,
'One gig lowercased'
],
25
[
'1M'
, 1024 * 1024,
'One meg uppercased'
],
26
[
'1m'
, 1024 * 1024,
'One meg lowercased'
],
27
[
'1K'
, 1024,
'One kb uppercased'
],
28
[
'1k'
, 1024,
'One kb lowercased'
],
29
];
30
}
31
}
wfShorthandToInteger
wfShorthandToInteger( $string='', $default=-1)
Converts shorthand byte notation to integer form.
Definition
GlobalFunctions.php:3094
MediaWikiTestCase
Definition
MediaWikiTestCase.php:17
WfShorthandToIntegerTest
GlobalFunctions wfShorthandToInteger.
Definition
wfShorthandToIntegerTest.php:7
WfShorthandToIntegerTest\testWfShorthandToInteger
testWfShorthandToInteger( $input, $output, $description)
provideABunchOfShorthands
Definition
wfShorthandToIntegerTest.php:11
WfShorthandToIntegerTest\provideABunchOfShorthands
static provideABunchOfShorthands()
Definition
wfShorthandToIntegerTest.php:19
$output
static configuration should be added through ResourceLoaderGetConfigVars instead can be used to get the real title after the basic globals have been set but before ordinary actions take place $output
Definition
hooks.txt:2255
$input
if(is_array($mode)) switch( $mode) $input
Definition
postprocess-phan.php:145
tests
phpunit
includes
GlobalFunctions
wfShorthandToIntegerTest.php
Generated on Mon Nov 25 2024 15:36:23 for MediaWiki by
1.10.0