Fix wrong static calls
[lhc/web/wiklou.git] / tests / phpunit / includes / Providers.php
1 <?php
2 /**
3 * Generic providers for the MediaWiki PHPUnit test suite
4 *
5 * @author Ashar Voultoiz
6 * @copyright Copyright © 2011, Ashar Voultoiz
7 * @file
8 */
9
10 /** */
11 class MediaWikiProvide {
12
13 /* provide an array of numbers from 1 up to @param $num */
14 private function createProviderUpTo( $num ) {
15 $ret = array();
16 for( $i=1; $i<=$num;$i++ ) {
17 $ret[] = array( $i );
18 }
19 return $ret;
20 }
21
22 /* array of months numbers (as an integer) */
23 public function Months() {
24 return $this->createProviderUpTo( 12 );
25 }
26
27 /* array of days numbers (as an integer) */
28 public function Days() {
29 return $this->createProviderUpTo( 31 );
30 }
31
32 public function DaysMonths() {
33 $ret = array();
34
35 $months = $this->Months();
36 $days = $this->Days();
37 foreach( $months as $month) {
38 foreach( $days as $day ) {
39 $ret[] = array( $day[0], $month[0] );
40 }
41 }
42 return $ret;
43 }
44 }