3 * Created by JetBrains PhpStorm.
7 * To change this template use File | Settings | File Templates.
10 require_once('inc/vCalendar.php');
12 class myCalendarTest
extends PHPUnit_Framework_TestCase
{
14 function getData($filename){
15 $file = fopen($filename, 'r');
16 $data = fread($file, filesize($filename));
24 $mycalendar = new vCalendar($this->getData('tests/data/0000-Setup-PUT-collection.test'));
25 $test = $mycalendar->Render();
27 $timezones = $mycalendar->GetComponents('VTIMEZONE',true);
28 $components = $mycalendar->GetComponents('VTIMEZONE',false);
32 foreach($components as $comp){
34 $uid = $comp->GetPValue('UID');
35 $resources[$uid][] = $comp;
40 foreach($resources as $key => $res){
41 $testcal = new vCalendar();
42 $testcal->SetComponents($res);
43 $t = $testcal->Render();
44 $t = $testcal->Render();
47 $mycalendar->Render();
53 $data = explode("\n",$this->getData('tests/data/0244-MOZ-POST-FB.test'));
55 $data = implode($data, "\r\n");
57 $mycalendar = new vCalendar($data);
58 // foreach($mycalendar->GetComponents() as $comp){
59 // $next = $comp->GetComponents();
61 // foreach($next as $comp2){
62 // $comp2->GetComponents();
63 // $comp2->GetProperties();
67 // $comp->GetProperties();
69 //$test = $mycalendar->Render();
70 $property = $mycalendar->GetProperties()[0];
71 $value = $property->Value();
72 $name = $property->Name();
75 $this->assertStringEndsNotWith("\r", $value);