File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed
Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -121,6 +121,36 @@ public function testHandleRemaining()
121121 self ::assertTrue ($ hasRan );
122122 }
123123
124+ public function testHandleMultipleRemaining ()
125+ {
126+ $ hasRan = false ;
127+
128+ $ this ->propPatch = new PropPatch ([
129+ '{DAV:}displayname ' => 'foo ' ,
130+ 'unittest ' => 'bar ' ,
131+ ]);
132+
133+ $ this ->propPatch ->handleRemaining (function ($ mutations ) use (&$ hasRan ) {
134+ static $ numberOfCalls = 0 ;
135+
136+ self ::assertCount (2 , $ mutations );
137+ self ::assertLessThan (2 , ++$ numberOfCalls );
138+
139+ $ hasRan = true ;
140+
141+ return true ;
142+ });
143+
144+ self ::assertTrue ($ this ->propPatch ->commit ());
145+ $ result = $ this ->propPatch ->getResult ();
146+ self ::assertEquals ([
147+ '{DAV:}displayname ' => 200 ,
148+ 'unittest ' => 200 ,
149+ ], $ result );
150+
151+ self ::assertTrue ($ hasRan );
152+ }
153+
124154 public function testHandleRemainingNothingToDo ()
125155 {
126156 $ hasRan = false ;
You can’t perform that action at this time.
0 commit comments