-
-
Notifications
You must be signed in to change notification settings - Fork 0
test: Ensure leaves()
and parents()
methods include ORDER BY
for deterministic results.
#51
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
…r deterministic results.
WalkthroughTwo new test methods were added to the Changes
Sequence Diagram(s)sequenceDiagram
participant Test as NestedSetsBehaviorTest
participant DB as Database
participant Tree as Tree Model
Test->>DB: Create root and child nodes with manual lft/rgt/depth
Test->>Tree: Call leaves()/parents() method
Tree->>DB: Query nodes with ORDER BY lft
DB-->>Tree: Return ordered nodes
Tree-->>Test: Return nodes
Test->>Test: Assert order and type of nodes
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. 🔧 PHPStan (2.1.15)Note: Using configuration file /phpstan.neon. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🧰 Additional context used🧠 Learnings (1)📓 Common learnings
⏰ Context from checks skipped due to timeout of 90000ms (8)
🔇 Additional comments (2)
✨ 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 #51 +/- ##
===========================================
Coverage 100.00% 100.00%
Complexity 130 130
===========================================
Files 4 4
Lines 525 525
===========================================
Hits 525 525 ☔ 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 tests to enforce that the leaves()
and parents()
query methods include an ORDER BY
clause on the lft
column for deterministic ordering.
- Introduces a test verifying
leaves()
SQL containsORDER BY
and returns leaves in left-order. - Introduces a test verifying
parents()
SQL containsORDER BY
and returns ancestors in left-order.
Comments suppressed due to low confidence (2)
tests/NestedSetsBehaviorTest.php:2734
- The message refers to the 'left' attribute but the test checks for '
lft
'. For clarity, update the message to reference 'lft
' explicitly.
"'leaves()' query should order by 'left' attribute for consistent ordering.",
tests/NestedSetsBehaviorTest.php:2803
- The message refers to the 'left' attribute but the test checks for '
lft
'. It should mention 'lft
' to match the assertion.
"'parents()' query should order by 'left' attribute for consistent ordering.",
leaves()
and parents()
methods include ORDER BY
for deterministic results.
Summary by CodeRabbit