@@ -313,16 +313,32 @@ public function addRuleWithSiblingNotInRuleSetAddsRuleAfterInitialRulesAndSetsVa
313
313
*
314
314
* @dataProvider provideInitialPropertyNamesAndIndexOfOne
315
315
*/
316
- public function removeRuleRemovesRuleInSetAndKeepsOthers (array $ initialPropertyNames , int $ indexToRemove ): void
316
+ public function removeRuleRemovesRuleInSet (array $ initialPropertyNames , int $ indexToRemove ): void
317
317
{
318
318
$ this ->setRulesFromPropertyNames ($ initialPropertyNames );
319
319
$ ruleToRemove = $ this ->subject ->getRules ()[$ indexToRemove ];
320
320
321
321
$ this ->subject ->removeRule ($ ruleToRemove );
322
322
323
- $ remainingRules = $ this ->subject ->getRules ();
324
- self ::assertNotContains ($ ruleToRemove , $ remainingRules );
325
- self ::assertCount (\count ($ initialPropertyNames ) - 1 , $ remainingRules );
323
+ self ::assertNotContains ($ ruleToRemove , $ this ->subject ->getRules ());
324
+ }
325
+
326
+ /**
327
+ * @test
328
+ *
329
+ * @param non-empty-list<string> $initialPropertyNames
330
+ * @param int<0, max> $indexToRemove
331
+ *
332
+ * @dataProvider provideInitialPropertyNamesAndIndexOfOne
333
+ */
334
+ public function removeRuleRemovesExactlyOneRule (array $ initialPropertyNames , int $ indexToRemove ): void
335
+ {
336
+ $ this ->setRulesFromPropertyNames ($ initialPropertyNames );
337
+ $ ruleToRemove = $ this ->subject ->getRules ()[$ indexToRemove ];
338
+
339
+ $ this ->subject ->removeRule ($ ruleToRemove );
340
+
341
+ self ::assertCount (\count ($ initialPropertyNames ) - 1 , $ this ->subject ->getRules ());
326
342
}
327
343
328
344
/**
@@ -332,7 +348,7 @@ public function removeRuleRemovesRuleInSetAndKeepsOthers(array $initialPropertyN
332
348
*
333
349
* @dataProvider provideInitialPropertyNamesAndAnotherPropertyName
334
350
*/
335
- public function removeRuleDoesNothingWithRuleNotInSet (
351
+ public function removeRuleWithRuleNotInSetKeepsSetUnchanged (
336
352
array $ initialPropertyNames ,
337
353
string $ propertyNameToRemove
338
354
): void {
0 commit comments