Skip to content

Commit

Permalink
Add testcase
Browse files Browse the repository at this point in the history
  • Loading branch information
k1LoW committed Oct 20, 2011
1 parent 68ccb0d commit 2bb37da
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions config/schema/schema.php
Expand Up @@ -16,6 +16,7 @@ function after($event = array()) {
'dtstart' => array('type' => 'timestamp', 'null' => true, 'default' => NULL),
'dtend' => array('type' => 'timestamp', 'null' => true, 'default' => NULL),
'daylong' => array('type' => 'boolean', 'null' => true, 'default' => NULL),
'exdate' => array('type' => 'text', 'null' => true, 'default' => NULL),

'rrule_freq' => array('type' => 'text', 'null' => true, 'default' => NULL),
'rrule_interval' => array('type' => 'text', 'null' => true, 'default' => NULL),
Expand Down
21 changes: 21 additions & 0 deletions tests/cases/models/vevent.test.php
Expand Up @@ -1374,6 +1374,27 @@ function test_RFC2445freqYearlyCount10Bymonth6_7() {
* (2003 9:00 AM EST)January 10;February 10;March 10
*/
function test_RFC2445freqYearlyInterval2Count10Bymonth1_2_3() {
$data = array(
'dtstart' => '1997-03-10 09:00:00',
'dtend' => '1997-03-10 12:00:00',
'summary' => 'RFC2445',
'rrule_freq' => 'yearly',
'rrule_interval' => 2,
'rrule_count' => 10,
'rrule_bymonth' => '1,2,3'
);
$uid = $this->Vevent->setEvent($data);
$result = $this->Vevent->findByRange('1997-03-01', '2003-03-31');
$this->assertIdentical($result['1997-03-10'][0]['Vevent']['uid'], $uid);
$this->assertIdentical($result['1999-01-10'][0]['Vevent']['uid'], $uid);
$this->assertIdentical($result['1999-02-10'][0]['Vevent']['uid'], $uid);
$this->assertIdentical($result['1999-03-10'][0]['Vevent']['uid'], $uid);
$this->assertIdentical($result['2001-01-10'][0]['Vevent']['uid'], $uid);
$this->assertIdentical($result['2001-02-10'][0]['Vevent']['uid'], $uid);
$this->assertIdentical($result['2001-03-10'][0]['Vevent']['uid'], $uid);
$this->assertIdentical($result['2003-01-10'][0]['Vevent']['uid'], $uid);
$this->assertIdentical($result['2003-02-10'][0]['Vevent']['uid'], $uid);
$this->assertIdentical($result['2003-03-10'][0]['Vevent']['uid'], $uid);
}

/**
Expand Down
1 change: 1 addition & 0 deletions tests/fixtures/vevent_fixture.php
Expand Up @@ -9,6 +9,7 @@ class VeventFixture extends CakeTestFixture {
'dtstart' => array('type' => 'timestamp', 'null' => true, 'default' => NULL),
'dtend' => array('type' => 'timestamp', 'null' => true, 'default' => NULL),
'daylong' => array('type' => 'boolean', 'null' => true, 'default' => NULL),
'exdate' => array('type' => 'text', 'null' => true, 'default' => NULL),

'rrule_freq' => array('type' => 'text', 'null' => true, 'default' => NULL),
'rrule_interval' => array('type' => 'text', 'null' => true, 'default' => NULL),
Expand Down

0 comments on commit 2bb37da

Please sign in to comment.