-
-
Notifications
You must be signed in to change notification settings - Fork 0
test: Add verification for leaves method ordering in NestedSetsQueryBehaviorTest
.
#40
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
WalkthroughThis update refines assertion messages in Changes
Sequence Diagram(s)sequenceDiagram
participant Test as testLeavesMethodRequiresLeftAttributeOrderingForConsistentResults
participant DB as Database
participant Model as NestedSet Model
Test->>Model: Create root node
Test->>Model: Create leaf1, leaf2
Test->>Model: Append leaf1, leaf2 to root
Test->>Model: Fetch leaves (initial order)
Test->>DB: Update lft/rgt values for leaves and root
Test->>Model: Fetch leaves (after update)
Test->>Test: Assert leaves count and order by lft values
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 tests/NestedSetsQueryBehaviorTest.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 (2)
🧰 Additional context used🧠 Learnings (1)📓 Common learnings
🧬 Code Graph Analysis (1)tests/NestedSetsBehaviorTest.php (3)
🪛 PHPMD (2.15.0)tests/NestedSetsBehaviorTest.php791-791: Avoid using static access to class '\yii2\extensions\nestedsets\tests\support\model\MultipleTree' in method 'testReturnTrueAndMatchXmlAfterInsertBeforeDownForTreeAndMultipleTree'. (Clean Code Rules) (StaticAccess) ⏰ Context from checks skipped due to timeout of 90000ms (12)
🔇 Additional comments (3)
✨ 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 #40 +/- ##
===========================================
Coverage 100.00% 100.00%
Complexity 90 90
===========================================
Files 2 2
Lines 470 470
===========================================
Hits 470 470 ☔ 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.
Pull Request Overview
This PR adds a new test to verify that leaves()
results are consistently ordered by the left attribute and normalizes assertion message quoting across two test classes.
- Fixed inconsistent quote escaping in assertion messages.
- Introduced
testLeavesMethodRequiresLeftAttributeOrderingForConsistentResults
inNestedSetsQueryBehaviorTest.php
. - Updated various assertion messages in
NestedSetsBehaviorTest.php
for quoting consistency.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
File | Description |
---|---|
tests/NestedSetsQueryBehaviorTest.php | Cleaned up inner quotes and added a new leaves-order test |
tests/NestedSetsBehaviorTest.php | Normalized quote style in assertion messages |
Comments suppressed due to low confidence (6)
tests/NestedSetsBehaviorTest.php:1722
- Assertion message is grammatically unclear. Consider rephrasing to "Child node depth should be 1 after being appended to the root node." or "... after calling appendTo on the root node."
'Child node depth should be \'1\' after being \'appendTo\' the root node.',
tests/NestedSetsBehaviorTest.php:1756
- Assertion message is grammatically unclear. Consider "Child node left value should be 2 after being appended to the root node." or "... after calling appendTo on the root node."
'Child node left value should be \'2\' after being \'appendTo\' to the root node.',
tests/NestedSetsBehaviorTest.php:1761
- Assertion message is grammatically unclear. Consider "Child node right value should be 3 after being appended to the root node." or "... after calling appendTo on the root node."
'Child node right value should be \'3\' after being \'appendTo\' the root node.',
tests/NestedSetsBehaviorTest.php:1991
- Remove unnecessary quotes around numeric literal. Use "Root node should have left value of 1." for clarity.
'Root node should have left value of \'1\'.',
tests/NestedSetsBehaviorTest.php:1996
- Remove unnecessary quotes around numeric literal. Use "Root node should have right value of 2." for clarity.
'Root node should have right value of \'2\'.',
tests/NestedSetsBehaviorTest.php:2001
- Remove unnecessary quotes around numeric literal. Use "Root node should have depth of 0." for clarity.
'Root node should have depth of \'0\'.',
Summary by CodeRabbit