From 59b9f156a9a8c2a63e0a8ec32477a02e4c342db8 Mon Sep 17 00:00:00 2001 From: Jakub Zalas Date: Sun, 6 Mar 2016 16:14:09 +0000 Subject: [PATCH] [HttpFoundation] Add a dependency on the mbstring polyfill --- composer.json | 1 + .../HttpFoundation/Tests/BinaryFileResponseTest.php | 8 +++++++- .../Component/HttpFoundation/Tests/Fixtures/föö.html | 0 src/Symfony/Component/HttpFoundation/composer.json | 3 ++- 4 files changed, 10 insertions(+), 2 deletions(-) delete mode 100644 src/Symfony/Component/HttpFoundation/Tests/Fixtures/föö.html diff --git a/composer.json b/composer.json index 39ff413e00..b200035f08 100644 --- a/composer.json +++ b/composer.json @@ -20,6 +20,7 @@ "doctrine/common": "~2.4", "paragonie/random_compat": "~1.0", "symfony/polyfill-apcu": "~1.1", + "symfony/polyfill-mbstring": "~1.1", "twig/twig": "~1.23|~2.0", "psr/log": "~1.0" }, diff --git a/src/Symfony/Component/HttpFoundation/Tests/BinaryFileResponseTest.php b/src/Symfony/Component/HttpFoundation/Tests/BinaryFileResponseTest.php index ac6c3288ae..4c055ff8a1 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/BinaryFileResponseTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/BinaryFileResponseTest.php @@ -36,7 +36,13 @@ class BinaryFileResponseTest extends ResponseTestCase public function testConstructWithNonAsciiFilename() { - new BinaryFileResponse(__DIR__.'/Fixtures/föö.html', 200, array(), true, 'attachment'); + touch(sys_get_temp_dir().'/fööö.html'); + + $response = new BinaryFileResponse(sys_get_temp_dir().'/fööö.html', 200, array(), true, 'attachment'); + + @unlink(sys_get_temp_dir().'/fööö.html'); + + $this->assertSame('fööö.html', $response->getFile()->getFilename()); } /** diff --git a/src/Symfony/Component/HttpFoundation/Tests/Fixtures/föö.html b/src/Symfony/Component/HttpFoundation/Tests/Fixtures/föö.html deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/src/Symfony/Component/HttpFoundation/composer.json b/src/Symfony/Component/HttpFoundation/composer.json index 8fa1a00ec9..c9cbfd02aa 100644 --- a/src/Symfony/Component/HttpFoundation/composer.json +++ b/src/Symfony/Component/HttpFoundation/composer.json @@ -16,7 +16,8 @@ } ], "require": { - "php": ">=5.3.3" + "php": ">=5.3.3", + "symfony/polyfill-mbstring": "~1.1" }, "autoload": { "psr-0": { "Symfony\\Component\\HttpFoundation\\": "" },