generated from yii2-extensions/template
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Description
Overview
Add a comprehensive tree integrity validation method to detect structural issues in nested set operations.
Requirements
- Tree integrity validation method checking for gaps, overlaps, and boundary correctness
- Integration points after critical operations (deletion, cross-tree movement, root promotion)
- Comprehensive test coverage for edge cases and boundary conditions
Detailed Implementation
- Add
validateTreeIntegrity()
method insrc/NestedSetsBehavior.php
- Validate no gaps or overlaps in lft/rgt values
- Check proper nesting relationships
- Verify depth consistency
- Integration after operations like
afterDelete()
,moveNode()
,moveNodeAsRoot()
Test Coverage
- Adjacent siblings scenarios
- Single children edge cases
- First/last boundary nodes
- Cross-tree movement validation
- Root promotion integrity checks
Background
Suggested during review of PR #13 to enhance confidence in nested set operations and detect potential off-by-one errors.
Related PR: #13
Comment: #13 (comment)
Metadata
Metadata
Assignees
Labels
No labels