-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Test does not complete when using ob_start and fpassthru #5546
Comments
I cannot reproduce this:
|
yes it works on PHP 8,2.x and PHPUnit 10.4.1
I have the test blocked as shown above |
using your settings I have the following PHPUnit Started (PHPUnit 10.4.1 using PHP 8.3.0RC4 (cli) on Linux)
Test Runner Configured
Bootstrap Finished (/app/vendor/autoload.php)
Test Suite Loaded (1 test)
Test Runner Triggered Warning (No code coverage driver available)
Event Facade Sealed
Test Runner Started
Test Suite Sorted
Test Runner Execution Started (1 test)
Test Suite Started (League\Csv\BugTest, 1 test)
Test Preparation Started (League\Csv\BugTest::testOutputDoesNotStripBOM)
Test Prepared (League\Csv\BugTest::testOutputDoesNotStripBOM)
Assertion Succeeded (Constraint: contains "��" [Encoding detection failed](length: 2), Value: '��john,doe,john.doe@example.com\n
jane,doe,jane.doe@example.com\n
')
So the test passes but the result is never returned Assertion Succeeded (Constraint: is true, Value: true)
Test Passed (Issue5546Test::testOutputDoesNotStripBOM)
Test Finished (Issue5546Test::testOutputDoesNotStripBOM)
Test Suite Finished (Issue5546Test, 1 test)
Test Suite Finished (CLI Arguments, 1 test)
Test Runner Execution Finished
Test Runner Finished
PHPUnit Finished (Shell Exit Code: 0) ☝🏾 The following never happened |
I read "This test works with all versions of PHP8.1 until the recent PHP8.3.0RC4 in PHPUnit" as "including the recent PHP8.3.0RC4". I am also confused by "Test also work with PHPUnit 10.3.1". You have two variables in your report: PHP version and PHPUnit version. I am not sure whether you mean "With PHPUnit 10.4.1 it does not work on PHP 8.3.0RC4 but with PHPUnit 10.3.1 the test does work on PHP 8.3.0RC4". Please be more specific, thanks. |
Sorry for the confusion. To recap
I hope this clarify the report. |
The first commit (found using At first glance, I do not see how this change could lead to the behavior we see. |
The changes made in 969d64d cause the following line of code to be executed:
With PHP 8.3, When I change the line to |
@alexdowad I see that you worked on |
The |
@sebastianbergmann I was able to reproduce the bug with the following code following your research final class BugTest extends TestCase
{
#[Test]
public function it_shows_bug(): void
{
$result = "\xEF\xBB\xBF";
self::assertStringContainsString("\xEF\xBB\xBF", $result);
}
} I do not know if it matters but the sequence is the BOM sequence for On 3val the following call fails too https://3v4l.org/H8l7c/rfc#vgit.master var_dump(mb_detect_encoding("\xEF\xBB\xBF", null, true)); So indeed seems to be an issue with |
At this point I think that this is an issue with |
I have reported this bug for PHP and will now close this ticket. |
Dear @sebastianbergmann, thanks very much for investigating this problem. Do you have a link for the bug ticket in php-src? |
Ah, I found it. |
Sorry for the delay. I have just opened a PR to fix this bug: php/php-src#12541 |
The fix has landed on the PHP-8.3 and master branches of php-src. It will be incorporated in the next PHP releases in the 8.3 and 8.4 series. |
Summary
The test works:
Current behaviour
The test never ends nor report any failure.
How to reproduce
Expected behavior
Works in PHP8.1+ with PHPUnit 10.4.0 the test ends and pass successfully
The text was updated successfully, but these errors were encountered: