Skip to content

Commit cab0b0b

Browse files
committed
Changes suggested in review
1 parent bc840af commit cab0b0b

File tree

1 file changed

+21
-5
lines changed

1 file changed

+21
-5
lines changed

tests/Unit/RuleSet/RuleSetTest.php

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -313,16 +313,32 @@ public function addRuleWithSiblingNotInRuleSetAddsRuleAfterInitialRulesAndSetsVa
313313
*
314314
* @dataProvider provideInitialPropertyNamesAndIndexOfOne
315315
*/
316-
public function removeRuleRemovesRuleInSetAndKeepsOthers(array $initialPropertyNames, int $indexToRemove): void
316+
public function removeRuleRemovesRuleInSet(array $initialPropertyNames, int $indexToRemove): void
317317
{
318318
$this->setRulesFromPropertyNames($initialPropertyNames);
319319
$ruleToRemove = $this->subject->getRules()[$indexToRemove];
320320

321321
$this->subject->removeRule($ruleToRemove);
322322

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());
326342
}
327343

328344
/**
@@ -332,7 +348,7 @@ public function removeRuleRemovesRuleInSetAndKeepsOthers(array $initialPropertyN
332348
*
333349
* @dataProvider provideInitialPropertyNamesAndAnotherPropertyName
334350
*/
335-
public function removeRuleDoesNothingWithRuleNotInSet(
351+
public function removeRuleWithRuleNotInSetKeepsSetUnchanged(
336352
array $initialPropertyNames,
337353
string $propertyNameToRemove
338354
): void {

0 commit comments

Comments
 (0)