Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F117887422
data_calendar.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
2 KB
Referenced Files
None
Subscribers
None
data_calendar.php
View Options
<?php
class
data_calendar
extends
PHPUnit_Framework_TestCase
{
/**
* Test for kolab_sync_data_calendar::from_kolab_alarm()
*/
function
test_from_kolab_alarm
()
{
$obj
=
new
kolab_sync_data_calendar_test
;
$result
=
$obj
->
from_kolab_alarm
(
array
());
$this
->
assertSame
(
null
,
$result
);
$event
=
array
(
'valarms'
=>
array
(
array
(
'action'
=>
'DISPLAY'
,
'trigger'
=>
'PT5M'
,
)));
$result
=
$obj
->
from_kolab_alarm
(
$event
);
$this
->
assertSame
(
null
,
$result
);
$event
=
array
(
'valarms'
=>
array
(
array
(
'action'
=>
'DISPLAY'
,
'trigger'
=>
'-PT5M'
,
)));
$result
=
$obj
->
from_kolab_alarm
(
$event
);
$this
->
assertSame
(
5
,
$result
);
$event
=
array
(
'valarms'
=>
array
(
array
(
'action'
=>
'DISPLAY'
,
'trigger'
=>
'PT0M'
,
)));
$result
=
$obj
->
from_kolab_alarm
(
$event
);
$this
->
assertSame
(
0
,
$result
);
$event
=
array
(
'valarms'
=>
array
(
array
(
'action'
=>
'DISPLAY'
,
'trigger'
=>
'-PT0M'
,
)));
$result
=
$obj
->
from_kolab_alarm
(
$event
);
$this
->
assertSame
(
0
,
$result
);
$event
=
array
(
'valarms'
=>
array
(
array
(
'action'
=>
'DISPLAY'
,
'trigger'
=>
'PT0S'
,
)));
$result
=
$obj
->
from_kolab_alarm
(
$event
);
$this
->
assertSame
(
0
,
$result
);
}
/**
* Test for kolab_sync_data_calendar::to_kolab_alarm()
*/
function
test_to_kolab_alarm
()
{
$obj
=
new
kolab_sync_data_calendar_test
;
$result
=
$obj
->
to_kolab_alarm
(
null
,
array
());
$this
->
assertSame
(
array
(),
$result
);
$result
=
$obj
->
to_kolab_alarm
(
0
,
array
());
$this
->
assertSame
(
'-PT0M'
,
$result
[
0
][
'trigger'
]);
$result
=
$obj
->
to_kolab_alarm
(
15
,
array
());
$this
->
assertSame
(
'-PT15M'
,
$result
[
0
][
'trigger'
]);
$this
->
assertSame
(
'DISPLAY'
,
$result
[
0
][
'action'
]);
}
}
/**
* kolab_sync_data_calendar wrapper, so we can test protected methods too
*/
class
kolab_sync_data_calendar_test
extends
kolab_sync_data_calendar
{
function
__construct
()
{
}
public
function
from_kolab_alarm
(
$value
)
{
return
parent
::
from_kolab_alarm
(
$value
);
}
public
function
to_kolab_alarm
(
$value
,
$event
)
{
return
parent
::
to_kolab_alarm
(
$value
,
$event
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, Apr 6, 2:59 AM (2 w, 4 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
5c/a5/d4c140975cded595e6538464c602
Default Alt Text
data_calendar.php (2 KB)
Attached To
Mode
rS syncroton
Attached
Detach File
Event Timeline