-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Closed
Labels
type/bugSomething is brokenSomething is brokenversion/10Something affects PHPUnit 10Something affects PHPUnit 10
Description
Q | A |
---|---|
PHPUnit version | 10.4.x |
PHP version | PHP8.3.0RC4 (alpine and github actions) |
Installation Method | Composer |
Summary
The test works:
- with all versions of PHP8.1 until the recent PHP8.3.0RC4 in PHPUnit.
- Outside of PHPUnit the code works as expected.
- Test also work with PHPUnit 10.3.1 (I checked the results of the github action)
Current behaviour
The test never ends nor report any failure.
How to reproduce
public function testOutputDoesNotStripBOM(): void
{
$raw_csv = "\xEF\xBB\xBFjohn,doe,john.doe@example.com\njane,doe,jane.doe@example.com\n";
$stream = fopen('php://temp', 'r+');
fwrite($stream, $raw_csv);
ob_start();
rewind($stream);
echo "\xFE\xFF";
fpassthru($stream);
$result = ob_get_clean();
fclose($stream);
self::assertStringContainsString("\xFE\xFF", $result);
self::assertStringContainsString("\xEF\xBB\xBF", $result);
self::assertTrue(str_starts_with($result, "\xFE\xFF\xEF\xBB\xBF"));
}
Expected behavior
Works in PHP8.1+ with PHPUnit 10.4.0 the test ends and pass successfully
two-plus-two-equals-five
Metadata
Metadata
Assignees
Labels
type/bugSomething is brokenSomething is brokenversion/10Something affects PHPUnit 10Something affects PHPUnit 10