Skip to content

Commit

Permalink
GH-14930: Add test with long filename from custom stream wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
joec4i committed Jul 12, 2024
1 parent af2e539 commit 987ee94
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions ext/standard/tests/streams/gh14930.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
--TEST--
GH-14930: Custom stream wrapper dir_readdir output truncated to 255 characters in PHP 8.3
--FILE--
<?php

class DummyWrapper
{
public $context;

public function dir_opendir($url, $options)
{
return true;
}

public function dir_readdir()
{
return 'very-long-filename-ieNoquiaC6ijeiy9beejaiphoriejo2cheehooGou8uhoh7eh0gefahyuQuohd7eec9auso9eeFah2Maedohsemi1eetoo5fo5biePh5eephai7SiuguipouLeemequ2oope9aigoQu5efak2aLeri9ithaiJ9eew3dianaiHoo1aexaighiitee6geghiequ5nohhiikahwee8ohk2Soip2Aikeithohdeitiedeiku7DiTh2eep3deitiedeiku7DiTh2ee.txt';
}
}

stream_wrapper_register('dummy', DummyWrapper::class);

$dh = opendir('dummy://', stream_context_create());
var_dump(readdir($dh));
?>
--EXPECT--
string(288) "very-long-filename-ieNoquiaC6ijeiy9beejaiphoriejo2cheehooGou8uhoh7eh0gefahyuQuohd7eec9auso9eeFah2Maedohsemi1eetoo5fo5biePh5eephai7SiuguipouLeemequ2oope9aigoQu5efak2aLeri9ithaiJ9eew3dianaiHoo1aexaighiitee6geghiequ5nohhiikahwee8ohk2Soip2Aikeithohdeitiedeiku7DiTh2eep3deitiedeiku7DiTh2ee.txt"

0 comments on commit 987ee94

Please sign in to comment.