cvs: pear /Calendar/tests week_test.php
| From: | Lorenzo Alberton | Date: | Thu, 08 Jul 2004 10:33:01 +0000 |
| Subject: | cvs: pear /Calendar/tests week_test.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-21637@lists.php.net to get a copy of this message | ||
quipo Thu Jul 8 06:33:01 2004 EDT
Modified files:
/pear/Calendar/tests week_test.php
Log:
add test for bug #1798
http://cvs.php.net/diff.php/pear/Calendar/tests/week_test.php?r1=1.1&r2=1.2&ty=u
Index: pear/Calendar/tests/week_test.php
diff -u pear/Calendar/tests/week_test.php:1.1 pear/Calendar/tests/week_test.php:1.2
--- pear/Calendar/tests/week_test.php:1.1 Mon May 24 18:25:43 2004
+++ pear/Calendar/tests/week_test.php Thu Jul 8 06:33:01 2004
@@ -1,5 +1,5 @@
<?php
-// $Id: week_test.php,v 1.1 2004/05/24 22:25:43 quipo Exp $
+// $Id: week_test.php,v 1.2 2004/07/08 10:33:01 quipo Exp $
require_once('simple_include.php');
require_once('calendar_include.php');
@@ -173,6 +173,28 @@
$i++;
}
$this->assertTrue($Child->isSelected());
+ }
+ function testSelectionCornerCase() {
+ require_once(CALENDAR_ROOT . 'Day.php');
+ $selectedDays = array(
+ new Calendar_Day(2003, 12, 28),
+ new Calendar_Day(2003, 12, 29),
+ new Calendar_Day(2003, 12, 30),
+ new Calendar_Day(2003, 12, 31),
+ new Calendar_Day(2004, 01, 01),
+ new Calendar_Day(2004, 01, 02),
+ new Calendar_Day(2004, 01, 03)
+ );
+ $this->cal = new Calendar_Week(2003, 12, 31, 0);
+ $this->cal->build($selectedDays);
+ while ($Day = $this->cal->fetch()) {
+ $this->assertTrue($Day->isSelected());
+ }
+ $this->cal = new Calendar_Week(2004, 1, 1, 0);
+ $this->cal->build($selectedDays);
+ while ($Day = $this->cal->fetch()) {
+ $this->assertTrue($Day->isSelected());
+ }
}
}
if (!defined('TEST_RUNNING')) {