-
-
Notifications
You must be signed in to change notification settings - Fork 0
test: Add verification for accessibility of protected method moveNode
in subclasses of NestedSetsBehavior
.
#35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…e` in subclasses of `NestedSetsBehavior`.
WalkthroughA new test method was added to the Changes
Sequence Diagram(s)sequenceDiagram
participant Test as NestedSetsBehaviorTest
participant Source as ExtendableMultipleTree (sourceNode)
participant Target as ExtendableMultipleTree (targetNode)
participant Behavior as NestedSetsBehavior (from sourceNode)
Test->>Source: Create as root
Test->>Target: Append to source node
Test->>Behavior: Retrieve from source node
Test->>Behavior: Call exposedMoveNode()
Behavior->>Behavior: Call protected moveNode()
Test->>Test: Assert moveNode was called
Possibly related issues
Possibly related PRs
Suggested labels
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 phpcs (3.7.2)tests/NestedSetsBehaviorTest.phpWarning: PHP Startup: Invalid date.timezone value 'UTC', using 'UTC' instead in Unknown on line 0 Fatal error: Uncaught Error: Class "Phar" not found in /usr/local/bin/phpcs:3 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (11)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #35 +/- ##
===========================================
Coverage 100.00% 100.00%
Complexity 90 90
===========================================
Files 2 2
Lines 469 469
===========================================
Hits 469 469 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
tests/NestedSetsBehaviorTest.php (1)
2210-2210
: Fix method name for consistency.The method name should use "Remains" instead of "Remain" to be consistent with other similar test methods in this file (e.g.,
testProtectedApplyTreeAttributeConditionRemainsAccessibleToSubclasses
).- public function testProtectedMoveNodeRemainAccessibleToSubclasses(): void + public function testProtectedMoveNodeRemainsAccessibleToSubclasses(): void
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
tests/NestedSetsBehaviorTest.php
(1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: terabytesoftw
PR: yii2-extensions/nested-sets-behavior#13
File: src/NestedSetsBehavior.php:145-145
Timestamp: 2025-06-29T11:22:41.839Z
Learning: The user terabytesoftw prefers to keep PRs focused and small, implementing enhancements in separate dedicated PRs rather than bundling multiple changes together.
⏰ Context from checks skipped due to timeout of 90000ms (6)
- GitHub Check: phpunit / PHP 8.2-windows-latest
- GitHub Check: phpunit / PHP 8.1-windows-latest
- GitHub Check: phpunit / PHP 8.4-windows-latest
- GitHub Check: phpunit / PHP 8.3-windows-latest
- GitHub Check: phpunit-compatibility / PHP 8.2-windows-latest
- GitHub Check: phpunit / PHP 8.2-windows-latest
🔇 Additional comments (1)
tests/NestedSetsBehaviorTest.php (1)
2210-2245
: Well-structured test following established patterns.The test implementation correctly follows the same pattern used by other protected method accessibility tests in this file. It properly:
- Sets up the test environment with appropriate node relationships
- Uses the extendable behavior to access the protected method
- Verifies that the method remains accessible for subclass customization
- Maintains consistency with the PR objective
The test logic and assertions are appropriate for verifying the accessibility of the protected
moveNode
method.
… for `moveNode` in subclasses of `NestedSetsBehavior`.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds a new test to verify that subclasses of NestedSetsBehavior can access the protected moveNode method.
- Adds testProtectedMoveNodeRemainsAccessibleToSubclasses in the NestedSetsBehaviorTest.
- Verifies that the correct behavior subclass (ExtendableNestedSetsBehavior) is used and that moveNode is callable via an exposed method.
Summary by CodeRabbit