Skip to content

Commit dbc1682

Browse files
committed
test with ä
1 parent 3e83e00 commit dbc1682

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

tests/FunctionTest.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,16 @@ public function testSupportResources()
3535

3636
public function testResourcesWithStrangeNames()
3737
{
38-
$resource = fopen(__DIR__.'/Resources/httplug.png', 'r');
38+
$originalLocale = setlocale(LC_ALL, "0");
39+
setlocale(LC_ALL, 'C');
3940

41+
$resource = fopen(__DIR__.'/Resources/httplug.png', 'r');
4042
$builder = new MultipartStreamBuilder();
41-
$builder->addResource('image', $resource, ['filename'=>'foo/bar/хлопотäκόσμε.png']);
43+
$builder->addResource('image', $resource, ['filename'=> 'äa.png']);
4244

4345
$multipartStream = (string) $builder->build();
44-
$this->assertTrue(false !== strpos($multipartStream, 'Content-Disposition: form-data; name="image"; filename="хлопотäκόσμε.png"'));
46+
$this->assertTrue(false !== mb_strpos($multipartStream, 'Content-Disposition: form-data; name="image"; filename="äa.png"'));
47+
setlocale(LC_ALL, $originalLocale);
4548
}
4649

4750
public function testHeaders()

0 commit comments

Comments
 (0)