-
-
Notifications
You must be signed in to change notification settings - Fork 668
PHPUnit to Pest Converter #676
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
|
While Shift converted these methods to functions in the new Pest test, you should review these files to see if these functions may be inlined or extracted to a custom helper.
|
|
⚗️ This Shift is still being refined. Please report any issues or suggestions to shift@laravelshift.com. Your feedback is what helps improve the experience for everyone. |
|
@driesvints the unit and integration tests ran successfully. However, I noticed this is still running BrowserKit. Not sure if Pest supports that. I would guess not. Might be a good time to convert to Dusk or HTTP Tests. 👍 I also noticed Livewire, which may have some of its own steps for Pest integration. |
tests/Feature/AdminTest.php
Outdated
| { | ||
| $user = User::factory()->create(['name' => 'Freek Murze', 'banned_at' => Carbon::now()]); | ||
|
|
||
| $this->put('/admin/users/'.$user->username().'/unban') |
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.
On helpers, the $this->put needs to be replaced by test()->put.
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.
Got it. I'll definitely update this in the Pest Converter.
|
Hey @jasonmccreary 👋 I got all the tests passing locally. Any chance you can give me permission to push to this branch? Thanks! |
|
@joedixon, sorry, I'm not sure what you mean. The "allow maintainers to edit" is enabled. What else is there? |
|
No idea what was going on there @jasonmccreary. Yesterday evening I was getting permissions errors and today all is well in the world. Thanks anyway. |
|
I got the tests passsing @driesvints, but I haven't swapped out any of the BrowserKit tests for HTTP tests. Are you happy if we get this merged and an issue for removing BrowserKit to keep the PR focused? |
|
Thanks all. I make some notes of the manual changes, but I believe some of these have already been tweaked based on some feedback from Freek as well. |
@joedixon Yes definitely! Thanks : )
@jasonmccreary do you think it's useful for you if we did a new run of this shift to see if that fixes everything? |
|
@driesvints, nah, that's okay. I feel I got everything from the additional commits. No need for you guys to rework stuff. 👍 |
driesvints
left a comment
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.
Does the TestCase class still need to be abstract?
Can you send in a separate PR to remove the HttpAssertions trait? The assertForbidden method is now on the Laravel TestResponse class.
|
Thanks a bunch for this @jasonmccreary & @joedixon :) |
This pull request contains changes for migrating your test suite from PHPUnit to Pest automated by the Pest Converter.
Before merging, you need to:
shift-49229branchcomposer updateto install Pest with your dependenciesvendor/bin/pestto verify the conversion