test: coverage recording now needs to be explicit
[mediawiki.git] / tests / phpunit / includes / Providers.php
blob4ddc0b049fb6b1b8206d242902de0bd79c9bf6ab
1 <?php
2 /**
3 * Generic providers for the MediaWiki PHPUnit test suite
5 * @author Antoine Musso
6 * @copyright Copyright © 2011, Antoine Musso
7 * @file
8 */
10 /** */
11 class MediaWikiProvide {
13 /* provide an array of numbers from 1 up to @param $num */
14 private static function createProviderUpTo( $num ) {
15 $ret = array();
16 for ( $i = 1; $i <= $num; $i++ ) {
17 $ret[] = array( $i );
20 return $ret;
23 /* array of months numbers (as an integer) */
24 public static function Months() {
25 return self::createProviderUpTo( 12 );
28 /* array of days numbers (as an integer) */
29 public static function Days() {
30 return self::createProviderUpTo( 31 );
33 public static function DaysMonths() {
34 $ret = array();
36 $months = self::Months();
37 $days = self::Days();
38 foreach ( $months as $month ) {
39 foreach ( $days as $day ) {
40 $ret[] = array( $day[0], $month[0] );
44 return $ret;