Commit fb6d733
committed
Fix Coalesce mutation escape in AbstractPage cycle detection test
The test test_parent_page_is_checked_before_parent_page_data_in_cycle_detection
set both parents on $subject (the root node being validated), not on an
intermediate node in the chain. The mutation swaps the coalesce operands on
line 124 of AbstractPage.validateNoCircularParent:
$parent = $parent->getParentPage() ?? $parent->getParentPageData();
The existing test never reached a node where both operands were non-null
simultaneously during the loop walk, so the swap made no difference and the
mutant escaped.
Fix: set both parentPage (cyclic) and parentPageData (safe, no cycle) on the
intermediate node $B in the chain $subject→$B→... With the original order,
$B.parentPage=$subject is followed (cycle detected). With the swapped mutation,
$B.parentPageData=$safe is followed (no cycle, mutant revealed).1 parent f8a8062 commit fb6d733
2 files changed
Lines changed: 174 additions & 78 deletions
0 commit comments