File tree Expand file tree Collapse file tree 2 files changed +13
-4
lines changed
Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -167,7 +167,11 @@ protected function parseDocument()
167167
168168 while (true ) {
169169 // Reading until we hit END:
170- $ line = $ this ->readLine ();
170+ try {
171+ $ line = $ this ->readLine ();
172+ } catch (EofException $ oEx ) {
173+ $ line = 'END: ' .$ this ->root ->name ;
174+ }
171175 if ('END: ' === strtoupper (substr ($ line , 0 , 4 ))) {
172176 break ;
173177 }
Original file line number Diff line number Diff line change @@ -114,11 +114,16 @@ public function testReadMappedPropertyGrouped()
114114 $ this ->assertEquals ('20110529 ' , $ result ->getValue ());
115115 }
116116
117- public function testReadBrokenLine ()
117+ public function testReadMissingEnd ()
118118 {
119- $ this ->expectException (ParseException::class);
120- $ data = "BEGIN:VCALENDAR \r\nPROPNAME;propValue " ;
119+ $ data = "BEGIN:VCALENDAR \r\nPROPNAME:propValue " ;
121120 $ result = Reader::read ($ data );
121+ $ this ->assertInstanceOf (Component::class, $ result );
122+ $ this ->assertEquals ('VCALENDAR ' , $ result ->name );
123+ $ this ->assertEquals (1 , count ($ result ->children ()));
124+ $ this ->assertInstanceOf (Property::class, $ result ->children ()[0 ]);
125+ $ this ->assertEquals ('PROPNAME ' , $ result ->children ()[0 ]->name );
126+ $ this ->assertEquals ('propValue ' , $ result ->children ()[0 ]->getValue ());
122127 }
123128
124129 public function testReadPropertyInComponent ()
You can’t perform that action at this time.
0 commit comments