Merge "Use AutoCommitUpdate instead of Database->onTransactionIdle"
[lhc/web/wiklou.git] / tests / phpunit / includes / specials / ContribsPagerTest.php
1 <?php
2
3 /**
4 * @group Database
5 */
6 class ContribsPagerTest extends \PHPUnit_Framework_TestCase {
7 /**
8 * @dataProvider dateFilterOptionProcessingProvider
9 * @param array $inputOpts Input options
10 * @param array $expectedOpts Expected options
11 */
12 public function testDateFilterOptionProcessing( $inputOpts, $expectedOpts ) {
13 $this->assertArraySubset( $expectedOpts, ContribsPager::processDateFilter( $inputOpts ) );
14 }
15
16 public static function dateFilterOptionProcessingProvider() {
17 return [
18 [ [ 'start' => '2016-05-01',
19 'end' => '2016-06-01',
20 'year' => null,
21 'month' => null ],
22 [ 'start' => '2016-05-01',
23 'end' => '2016-06-01' ] ],
24 [ [ 'start' => '2016-05-01',
25 'end' => '2016-06-01',
26 'year' => '',
27 'month' => '' ],
28 [ 'start' => '2016-05-01',
29 'end' => '2016-06-01' ] ],
30 [ [ 'start' => '2016-05-01',
31 'end' => '2016-06-01',
32 'year' => '2012',
33 'month' => '5' ],
34 [ 'start' => '',
35 'end' => '2012-05-31' ] ],
36 [ [ 'start' => '',
37 'end' => '',
38 'year' => '2012',
39 'month' => '5' ],
40 [ 'start' => '',
41 'end' => '2012-05-31' ] ],
42 [ [ 'start' => '',
43 'end' => '',
44 'year' => '2012',
45 'month' => '' ],
46 [ 'start' => '',
47 'end' => '2012-12-31' ] ],
48 ];
49 }
50 }