You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In this PR #47928 the logic behind the run command was changed in the Artisan command.
This update caused my tests to fail.
Currently I have the following test using Pest.
artisan(UserAddCommand::class, ['email' => '[email protected]'])
->expectsQuestion('What is the name of the new user?', 'Bob Bauer')
->expectsQuestion('What is the password of the new user?', 'secret123')
->expectsOutputToContain('User created successfully!')
->assertOk();
This worked fine before the update, but afterwards I am getting the error:
Output does not contain "User created successfully."
The actual console command prints stuff like this using Termwind:
render(
<<<HTML
<div class="py-1">
<div class="px-1 bg-green-600 font-bold">Success</div>
<em class="ml-1 text-green-600">
User created successfully.
</em>
</div>
HTML
);
This only happens if more than one test is being executed. One test itself is fine, but as soon as two tests are presend the second one will fail!
Reverting the change in the Command.php class makes my tests green again.
Steps To Reproduce
Copy the code snippets from above into a fresh laravel install < 10.17.1
Run the tests and see that everything is green
Update to laravel >= 10.17.1
Tests will fail
The text was updated successfully, but these errors were encountered:
Hey there. I have to say that console output isn't covered by our BC promise. It can totally happen that the text changes during minor or patch releases.
I do see you assert on User created successfully! and the error says User created successfully. (notice the exclamation mark difference).
If it's only the matter of changing the exclamation mark I'd just update your tests. Sorry you got caught with this.
Laravel Version
PHP Version
8.2.8
Database Driver & Version
No response
Description
Hello,
In this PR #47928 the logic behind the
run
command was changed in the Artisan command.This update caused my tests to fail.
Currently I have the following test using Pest.
This worked fine before the update, but afterwards I am getting the error:
The actual console command prints stuff like this using Termwind:
This only happens if more than one test is being executed. One test itself is fine, but as soon as two tests are presend the second one will fail!
Reverting the change in the
Command.php
class makes my tests green again.Steps To Reproduce
The text was updated successfully, but these errors were encountered: