Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F117884450
data.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.php
View Options
<?php
class
data
extends
PHPUnit_Framework_TestCase
{
/**
* Test for kolab_sync_data::recurrence_to_kolab()
*/
function
test_recurrence_to_kolab
()
{
$xml
=
'<!DOCTYPE AirSync PUBLIC "-//AIRSYNC//DTD AirSync//EN" "http://www.microsoft.com/">
<Sync xmlns="uri:AirSync" xmlns:AirSyncBase="uri:AirSyncBase" xmlns:Calendar="uri:Calendar">
<ApplicationData>
<Calendar:Recurrence>
<Calendar:Type>0</Calendar:Type>
<Calendar:Interval>1</Calendar:Interval>
<Calendar:Until>20101128T225959Z</Calendar:Until>
</Calendar:Recurrence>
</ApplicationData>
</Sync>'
;
$xml
=
new
SimpleXMLElement
(
$xml
);
$event
=
new
Syncroton_Model_Event
(
$xml
->
ApplicationData
);
$data
=
new
kolab_sync_data_test
;
$result
=
$data
->
recurrence_to_kolab
(
$event
);
$this
->
assertEquals
(
'DAILY'
,
$result
[
'FREQ'
]);
$this
->
assertEquals
(
1
,
$result
[
'INTERVAL'
]);
$this
->
assertEquals
(
'20101128T225959Z'
,
$result
[
'UNTIL'
]->
format
(
"Ymd
\T
His
\Z
"
));
$xml
=
'<!DOCTYPE AirSync PUBLIC "-//AIRSYNC//DTD AirSync//EN" "http://www.microsoft.com/">
<Sync xmlns="uri:AirSync" xmlns:AirSyncBase="uri:AirSyncBase" xmlns:Calendar="uri:Calendar">
<ApplicationData>
<Calendar:Recurrence>
<Calendar:Type>1</Calendar:Type>
<Calendar:Interval>1</Calendar:Interval>
<Calendar:DayOfWeek>8</Calendar:DayOfWeek>
</Calendar:Recurrence>
</ApplicationData>
</Sync>'
;
$xml
=
new
SimpleXMLElement
(
$xml
);
$event
=
new
Syncroton_Model_Event
(
$xml
->
ApplicationData
);
$result
=
$data
->
recurrence_to_kolab
(
$event
,
null
);
$this
->
assertEquals
(
'WEEKLY'
,
$result
[
'FREQ'
]);
$this
->
assertEquals
(
1
,
$result
[
'INTERVAL'
]);
$this
->
assertEquals
(
'WE'
,
$result
[
'BYDAY'
]);
}
}
/**
* kolab_sync_data wrapper, so we can test preotected methods too
*/
class
kolab_sync_data_test
extends
kolab_sync_data
{
function
__construct
()
{
}
public
function
recurrence_to_kolab
(
$data
,
$dummy1
=
null
,
$dummy2
=
null
)
{
return
parent
::
recurrence_to_kolab
(
$data
,
null
);
}
function
toKolab
(
Syncroton_Model_IEntry
$data
,
$folderId
,
$entry
=
null
,
$timezone
=
null
)
{
}
function
getEntry
(
Syncroton_Model_SyncCollection
$collection
,
$serverId
,
$as_array
=
false
)
{
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, Apr 6, 1:27 AM (2 d, 12 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
a7/a5/a62fb08d318482031a41b3cef23b
Default Alt Text
data.php (2 KB)
Attached To
Mode
rS syncroton
Attached
Detach File
Event Timeline