5
5
6
6
7
7
use BaconQrCode \Exception \InvalidArgumentException ;
8
- use DateTime ;
9
8
use PHPUnit \Framework \TestCase ;
10
9
use SimpleSoftwareIO \QrCode \DataTypes \Calendar ;
11
10
@@ -18,6 +17,13 @@ class CalendarTest extends TestCase
18
17
*/
19
18
private $ separator ;
20
19
20
+ /**
21
+ * The calendar variable
22
+ *
23
+ * @var Calendar
24
+ */
25
+ private $ calendar ;
26
+
21
27
public function setUp (): void
22
28
{
23
29
$ this ->separator = "\r\n" ;
@@ -63,7 +69,7 @@ public function test_it_generates_a_proper_format_with_just_the_summary_and_star
63
69
64
70
$ properFormat = "BEGIN:VEVENT " .$ this ->separator .
65
71
"SUMMARY:My FooBar Event " .$ this ->separator .
66
- "DTSTART:20201008UTC161000 " .$ this ->separator .
72
+ "DTSTART:20201008T161000 " .$ this ->separator .
67
73
"END:VEVENT " ;
68
74
69
75
$ this ->assertEquals ($ properFormat , strval ($ this ->calendar ));
@@ -81,8 +87,8 @@ public function test_it_generates_a_proper_format_with_summary_start_date_time_a
81
87
82
88
$ properFormat = "BEGIN:VEVENT " .$ this ->separator .
83
89
"SUMMARY:My FooBar Event " .$ this ->separator .
84
- "DTSTART:20201008UTC161000 " .$ this ->separator .
85
- "DTEND:20201008UTC181000 " .$ this ->separator .
90
+ "DTSTART:20201008T161000 " .$ this ->separator .
91
+ "DTEND:20201008T181000 " .$ this ->separator .
86
92
"END:VEVENT " ;
87
93
88
94
$ this ->assertEquals ($ properFormat , strval ($ this ->calendar ));
@@ -101,8 +107,8 @@ public function test_it_generates_a_proper_format_with_specified_date_time_forma
101
107
102
108
$ properFormat = "BEGIN:VEVENT " .$ this ->separator .
103
109
"SUMMARY:My FooBar Event " .$ this ->separator .
104
- "DTSTART:20201008UTC161000 " .$ this ->separator .
105
- "DTEND:20201008UTC181000 " .$ this ->separator .
110
+ "DTSTART:20201008T161000 " .$ this ->separator .
111
+ "DTEND:20201008T181000 " .$ this ->separator .
106
112
"END:VEVENT " ;
107
113
108
114
$ this ->assertEquals ($ properFormat , strval ($ this ->calendar ));
@@ -133,7 +139,7 @@ public function test_it_generates_a_proper_format_with_summary_start_date_time_a
133
139
134
140
$ properFormat = "BEGIN:VEVENT " .$ this ->separator .
135
141
"SUMMARY:My FooBar Event " .$ this ->separator .
136
- "DTSTART:20201008UTC161000 " .$ this ->separator .
142
+ "DTSTART:20201008T161000 " .$ this ->separator .
137
143
"LOCATION:Fooon " .$ this ->separator .
138
144
"END:VEVENT " ;
139
145
@@ -152,7 +158,7 @@ public function test_it_generates_a_proper_format_with_summary_start_date_time_a
152
158
153
159
$ properFormat = "BEGIN:VEVENT " .$ this ->separator .
154
160
"SUMMARY:My FooBar Event " .$ this ->separator .
155
- "DTSTART:20201008UTC161000 " .$ this ->separator .
161
+ "DTSTART:20201008T161000 " .$ this ->separator .
156
162
"URL:https://www.google.com " .$ this ->separator .
157
163
"END:VEVENT " ;
158
164
@@ -168,16 +174,18 @@ public function test_it_generates_a_proper_format_with_calendar_parameters()
168
174
'endDateTime ' => '2020-10-08 18:00 ' ,
169
175
'location ' => 'Foo Location ' ,
170
176
'url ' => 'https://www.google.com ' ,
171
- 'dateTimeFormat ' => 'Y-m-d H:i '
177
+ 'dateTimeFormat ' => 'Y-m-d H:i ' ,
178
+ 'description ' => 'FooBar \'s Event description can be longer than this. '
172
179
],
173
180
]);
174
181
175
182
$ properFormat = "BEGIN:VEVENT " .$ this ->separator .
176
183
"SUMMARY:My FooBar Event " .$ this ->separator .
177
- "DTSTART:20201008UTC161000 " .$ this ->separator .
178
- "DTEND:20201008UTC181000 " .$ this ->separator .
184
+ "DTSTART:20201008T161000 " .$ this ->separator .
185
+ "DTEND:20201008T181000 " .$ this ->separator .
179
186
"LOCATION:Foo Location " .$ this ->separator .
180
187
"URL:https://www.google.com " .$ this ->separator .
188
+ "DESCRIPTION:FooBar's Event description can be longer than this. " .$ this ->separator .
181
189
"END:VEVENT " ;
182
190
183
191
$ this ->assertEquals ($ properFormat , strval ($ this ->calendar ));
0 commit comments