File tree Expand file tree Collapse file tree 2 files changed +19
-2
lines changed
Expand file tree Collapse file tree 2 files changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -160,9 +160,9 @@ public function remove($item)
160160 return ;
161161 }
162162 }
163- }
164163
165- throw new \InvalidArgumentException ('The item you passed to remove() was not a child of this component ' );
164+ throw new \InvalidArgumentException ('The item you passed to remove() was not a child of this component ' );
165+ }
166166 }
167167
168168 /**
Original file line number Diff line number Diff line change @@ -72,6 +72,23 @@ public function testMagicGetGroups()
7272 $ this ->assertEquals (null , $ email3 [0 ]->group );
7373 }
7474
75+ public function testAddGroupProperties ()
76+ {
77+ $ comp = new VCard ([
78+ 'VERSION ' => '3.0 ' ,
79+ 'item2.X-ABLabel ' => 'item2-Foo ' ,
80+ ]);
81+
82+ $ comp ->{'ITEM1.X-ABLabel ' } = 'ITEM1-Foo ' ;
83+
84+ foreach (['item2 ' , 'ITEM1 ' ] as $ group ) {
85+ $ prop = $ comp ->{"$ group.X-ABLabel " };
86+ $ this ->assertInstanceOf (Property::class, $ prop );
87+ $ this ->assertSame ("$ group-Foo " , (string ) $ prop );
88+ $ this ->assertSame ($ group , $ prop ->group );
89+ }
90+ }
91+
7592 public function testMagicIsset ()
7693 {
7794 $ comp = new VCalendar ();
You can’t perform that action at this time.
0 commit comments