-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
[BrowserKit] [HttpKernel] StreamedResponse is not working with BrowserKit after Symfony is upgraded to 6.1 #46445
Comments
Thank you @HtunHtunHtet for creating this bug report! This indeed looks like a bug. I reproduced the bug in the "symfony-6.1" branch of https://github.com/HtunHtunHtet/bug_app. Status: Reviewed |
I think i got a similar problem regarding a test for a StreamedResponse: working test with symfony 6.0
What (know) works for me with symfony 6.1:
|
If it's currently still unclear why this is happening: |
Hey, thanks for your report! |
Could I get an answer? If I do not hear anything I will assume this issue is resolved or abandoned. Please get back to me <3 |
@carsonbot, the issue is still relevant. See also linked issue |
I still see the issue in Symfony 6.3. |
Anyone up to give this a try? |
The self::$client = self::loggedIn();
self::$client->request('GET', '/export');
$content = self::$client->getInternalResponse()->getContent();
self::assertResponseIsSuccessful();
self::assertResponseHasHeader('Content-Disposition', 'attachment; filename=users.csv');
self::assertStringStartsWith('xxx;yyy', $content); |
Hey, thanks for your report! |
Friendly ping? Should this still be open? I will close if I don't hear anything. |
Is there any pull request to fix that bug? If not, I think it should be fixed before closing, the bug is easily reproducible. |
@DaDeather #51396 did not fix this specific issue, the test still fails. |
Symfony version(s) affected
6.1
Description
Symfony\Component\HttpFoundation\StreamedResponse
is not working in tests (BrowserKit) after Symfony is upgraded to 6.1 - the output is not rendered.How to reproduce
When asserting that following
StreamedResponse
using BrowserKit produces'test'
output:the test is passing on Symfony 6.0 (see reproducer app: https://github.com/HtunHtunHtet/bug_app/tree/main) but starts to fail after upgrading to 6.1-RC1 (see: https://github.com/HtunHtunHtet/bug_app/tree/symfony-6.1) as the output is empty:
Below information is the output of the PHPUnit test.
Only the tests are affected as navigating to the controller page returns a correct response.
Possible Solution
No response
Additional Context
It might be related to recent
StreamedResponseListener
deprecation: #45476The text was updated successfully, but these errors were encountered: