steffen: server/kolab-resource-handlers/kolab-resource-handlers/freebusy/test testRecurrence.php, 1.1, 1.2
cvs at intevation.de
cvs at intevation.de
Mon Feb 21 12:13:59 CET 2005
Author: steffen
Update of /kolabrepository/server/kolab-resource-handlers/kolab-resource-handlers/freebusy/test
In directory doto:/tmp/cvs-serv1144/test
Modified Files:
testRecurrence.php
Log Message:
Issue243 (Nth weekday of month recurrence problem) + test case
Index: testRecurrence.php
===================================================================
RCS file: /kolabrepository/server/kolab-resource-handlers/kolab-resource-handlers/freebusy/test/testRecurrence.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- testRecurrence.php 9 Feb 2005 12:59:34 -0000 1.1
+++ testRecurrence.php 21 Feb 2005 11:13:57 -0000 1.2
@@ -69,5 +69,47 @@
}
$tests_total++;
-// Test2:
+// Test2: "Nth weekday in month"
+$r =& new TestRecurrence();
+$r->setStartDate( FreeBusy::parseDateTime( "2005-03-21T09:00:00Z" ) );
+$r->setEndDate( FreeBusy::parseDateTime( "2005-03-21T10:00:00Z" ) );
+$r->setCycletype( 'monthly' );
+$r->setType( 'weekday' );
+$r->setInterval(1);
+$r->setDaynumber(3);
+$r->setDay('wednesday');
+
+$r->expand( FreeBusy::parseDateTime( "2005-02-01T00:00:00Z" ),
+ FreeBusy::parseDateTime( "2005-12-01T00:00:00Z" ) );
+print "Test2 result:\n";
+$r->printperiods();
+if( $r->periods != array( // Results adjusted for CET/CEST switching
+ array( FreeBusy::parseDateTime( "2005-04-20T08:00:00Z" ),
+ false, 3600 ),
+ array( FreeBusy::parseDateTime( "2005-05-18T08:00:00Z" ),
+ false, 3600 ),
+ array( FreeBusy::parseDateTime( "2005-06-15T08:00:00Z" ),
+ false, 3600 ),
+ array( FreeBusy::parseDateTime( "2005-07-20T08:00:00Z" ),
+ false, 3600 ),
+ array( FreeBusy::parseDateTime( "2005-08-17T08:00:00Z" ),
+ false, 3600 ),
+ array( FreeBusy::parseDateTime( "2005-09-21T08:00:00Z" ),
+ false, 3600 ),
+ array( FreeBusy::parseDateTime( "2005-10-19T08:00:00Z" ),
+ false, 3600 ),
+ array( FreeBusy::parseDateTime( "2005-11-16T09:00:00Z" ),
+ false, 3600 )
+ ) ) {
+ print_r($r->periods);
+ print "Test2 failed\n";
+ $tests_failed++;
+} else {
+ print "Test2 succeeded\n";
+ $tests_succeeded++;
+}
+$tests_total++;
+
+
+// Test3:
?>
More information about the commits
mailing list