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

fix: Remove unnecessary test failing in Laravel 11.23 and later #1593

Conversation

KentarouTakeda
Copy link
Contributor

@KentarouTakeda KentarouTakeda commented Oct 15, 2024

Summary

Fixed test failures in Laravel 11.23 and later. The cause is the following changes on the laravel/framework side:

However, the output that this test asserts is not currently output anywhere in Helper. Therefore, I simply removed the test.

This test failure occurs at laravel=11.*, stability=prefer-stable, and blocks #1591, #1592.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • Existing tests have been adapted and/or new tests have been added

Detail

  1. The failing test targets the with() method of the Illuminate\Database\Eloquent\Builder class. The pull request on the laravel/framework side mentioned above was also a fix to this DocBlock.
  2. A method named with() also exists in the Illuminate/Database/Eloquent/Model class:
    https://github.com/laravel/framework/blob/231091c19945f058c576005907a5518fcc7a2bb1/src/Illuminate/Database/Eloquent/Model.php#L698-L704
  3. In this case, the with() from the Model side is used, as it is evaluated first.
  4. The resolved Model::with() is not emitted by design because it is a method on a base class:
    // Only add the methods to the output when the root is not the same as the class.

@KentarouTakeda
Copy link
Contributor Author

Sorry, I realized I made a mistake.

with() is certainly not output, but withOnly() directly below it is output, and it breaks in the same way as the test failure.

I would like to try to correct it.

@KentarouTakeda KentarouTakeda deleted the remove-unnecessary-failing-test branch October 15, 2024 23:22
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.

1 participant