diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2011-12-03 13:29:22 +0100 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2011-12-03 13:29:22 +0100 |
commit | ca32f08966f1b51fcb19460f0996bb0c4048e6fe (patch) | |
tree | ec04cc15b867bc21eedca904cea9af0254531a11 /tests/phpunit/includes/Providers.php | |
parent | a22fbfc60f36f5f7ee10d5ae6fe347340c2ee67c (diff) |
Update to MediaWiki 1.18.0
* also update ArchLinux skin to chagnes in MonoBook
* Use only css to hide our menu bar when printing
Diffstat (limited to 'tests/phpunit/includes/Providers.php')
-rw-r--r-- | tests/phpunit/includes/Providers.php | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/tests/phpunit/includes/Providers.php b/tests/phpunit/includes/Providers.php new file mode 100644 index 00000000..02898673 --- /dev/null +++ b/tests/phpunit/includes/Providers.php @@ -0,0 +1,44 @@ +<?php +/** + * Generic providers for the MediaWiki PHPUnit test suite + * + * @author Ashar Voultoiz + * @copyright Copyright © 2011, Ashar Voultoiz + * @file + */ + +/** */ +class MediaWikiProvide { + + /* provide an array of numbers from 1 up to @param $num */ + private static function createProviderUpTo( $num ) { + $ret = array(); + for( $i=1; $i<=$num;$i++ ) { + $ret[] = array( $i ); + } + return $ret; + } + + /* array of months numbers (as an integer) */ + public static function Months() { + return self::createProviderUpTo( 12 ); + } + + /* array of days numbers (as an integer) */ + public static function Days() { + return self::createProviderUpTo( 31 ); + } + + public static function DaysMonths() { + $ret = array(); + + $months = self::Months(); + $days = self::Days(); + foreach( $months as $month) { + foreach( $days as $day ) { + $ret[] = array( $day[0], $month[0] ); + } + } + return $ret; + } +} |