Blame | Letzte Änderung | Log anzeigen | RSS feed
<?php/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4 foldmethod=marker: */// CVS: $Id: bug-727-1.phpt,v 1.1 2006/11/20 08:54:51 firman Exp $?>--TEST--Bug #727: Date_Calc::weeksInMonth() wrong resultTests for weeksInMonth, february with 4 weeksMonday as 1st day of week--FILE--<?php/*** Test for: Date_Calc* Parts tested: Date_Calc::weeksInMonth()*//*** Monday as 1st day of week*/define('DATE_CALC_BEGIN_WEEKDAY', 1);require_once "Date/Calc.php";$tests = array(array(1999, 2), array(2010, 2), array(2021, 2), array(2027, 2),array(1937, 2), array(1943, 2), array(1802, 2), array(1813, 2),array(1819, 2), array(1830, 2), array(1841, 2), array(1847, 2),array(1858, 2), array(1869, 2), array(1875, 2), array(1886, 2),array(1897, 2), array(1909, 2), array(1915, 2), array(1926, 2));foreach ($tests as $date) {list ($year, $month) = $date;echo $year . '/' . $month . ' = ' . Date_Calc::weeksInMonth($month, $year) . ' weeks' . "\n";}?>--EXPECT--1999/2 = 4 weeks2010/2 = 4 weeks2021/2 = 4 weeks2027/2 = 4 weeks1937/2 = 4 weeks1943/2 = 4 weeks1802/2 = 4 weeks1813/2 = 4 weeks1819/2 = 4 weeks1830/2 = 4 weeks1841/2 = 4 weeks1847/2 = 4 weeks1858/2 = 4 weeks1869/2 = 4 weeks1875/2 = 4 weeks1886/2 = 4 weeks1897/2 = 4 weeks1909/2 = 4 weeks1915/2 = 4 weeks1926/2 = 4 weeks<?php/** Local variables:* mode: php* tab-width: 4* c-basic-offset: 4* c-hanging-comment-ender-p: nil* End:*/?>