File tree 2 files changed +28
-1
lines changed
2 files changed +28
-1
lines changed Original file line number Diff line number Diff line change @@ -104,7 +104,7 @@ public function getValidationRules(): array
104
104
'LAST-MODIFIED ' => '? ' ,
105
105
'LOCATION ' => '? ' ,
106
106
'ORGANIZER ' => '? ' ,
107
- 'PERCENT ' => '? ' ,
107
+ 'PERCENT-COMPLETE ' => '? ' ,
108
108
'PRIORITY ' => '? ' ,
109
109
'RECURRENCE-ID ' => '? ' ,
110
110
'SEQUENCE ' => '? ' ,
Original file line number Diff line number Diff line change @@ -168,4 +168,31 @@ public function testValidateDueBeforeDateTimeStart(): void
168
168
'DUE must occur after DTSTART ' ,
169
169
], $ messages );
170
170
}
171
+
172
+ public function testValidateDuplicatePercentComplete (): void
173
+ {
174
+ $ input = <<<HI
175
+ BEGIN:VCALENDAR
176
+ VERSION:2.0
177
+ PRODID:YoYo
178
+ BEGIN:VTODO
179
+ UID:8ed267e1-67c4-467d-8ae2-28e6ff03b033
180
+ DTSTAMP:20240729T133309Z
181
+ PERCENT-COMPLETE:70
182
+ PERCENT-COMPLETE:80
183
+ END:VTODO
184
+ END:VCALENDAR
185
+ HI ;
186
+ $ obj = Reader::read ($ input );
187
+
188
+ $ warnings = $ obj ->validate ();
189
+ $ messages = [];
190
+ foreach ($ warnings as $ warning ) {
191
+ $ messages [] = $ warning ['message ' ];
192
+ }
193
+
194
+ self ::assertEquals ([
195
+ 'PERCENT-COMPLETE MUST NOT appear more than once in a VTODO component ' ,
196
+ ], $ messages );
197
+ }
171
198
}
You can’t perform that action at this time.
0 commit comments