Skip to content
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

[12.x] Add test for after method in LazyCollection #54978

Conversation

mohammadrasoulasghari
Copy link
Contributor

@mohammadrasoulasghari mohammadrasoulasghari commented Mar 11, 2025

Add test for LazyCollection::after method ✅

In this PR, I've added a test for the after method in the LazyCollection class, There was no test for this method before.

The test verifies the correct behavior of this method in three key scenarios:

  • ▪️ Finding the next item using non-strict comparison
  • ▪️ Finding the next item using strict comparison
  • ▪️ Finding the next item using a callback function

While reviewing the LazyCollection code, I noticed that the after method lacked test coverage. Adding this test helps improve code reliability and ensures that any future changes to the collection functionality won't inadvertently break the after method's expected behavior. 🧪

This commit adds a test for the LazyCollection after() method covering
three key scenarios:
- Finding the next item with non-strict comparison
- Finding the next item with strict comparison
- Finding the next item using a callback function
@mohammadrasoulasghari mohammadrasoulasghari force-pushed the test/lazy-collection-after-method branch from 7969fb7 to 29e90e1 Compare March 11, 2025 18:20
@mohammadrasoulasghari mohammadrasoulasghari changed the title test: Add comprehensive test for LazyCollection::after method [12.x] Add test coverage for LazyCollection::after method Mar 11, 2025
@mohammadrasoulasghari mohammadrasoulasghari changed the title [12.x] Add test coverage for LazyCollection::after method [12.x] Add test for after method in LazyCollection Mar 11, 2025
@taylorotwell taylorotwell merged commit 67bf0cd into laravel:12.x Mar 12, 2025
39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants