1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
<?php
/**
* @file
* @author Geoffrey Mon
* @license GPL-2.0-or-later
*/
class NumericalParameterInsertablesSuggesterTest extends PHPUnit\Framework\TestCase {
/**
* @dataProvider getInsertablesProvider
*/
public function testGetInsertables( $input, $expected ) {
$suggester = new MediaWikiInsertablesSuggester();
$this->assertEquals( $expected, $suggester->getInsertables( $input ) );
}
public function getInsertablesProvider() {
return [
[ '$1 $2 $3', [
new Insertable( '$1', '$1', '' ),
new Insertable( '$2', '$2', '' ),
new Insertable( '$3', '$3', '' ),
] ],
[ 'test $1 foo $2 bar $3spam eggs', [
new Insertable( '$1', '$1', '' ),
new Insertable( '$2', '$2', '' ),
new Insertable( '$3', '$3', '' ),
] ],
[ '$1 or $2, $15!', [
new Insertable( '$1', '$1', '' ),
new Insertable( '$2', '$2', '' ),
new Insertable( '$15', '$15', '' ),
] ],
];
}
}
|