From 080b0f27e9ac283345b6080ab0999ac49e3c24ac Mon Sep 17 00:00:00 2001 From: Rob Bast Date: Wed, 8 May 2019 15:58:02 +0200 Subject: [PATCH] add missing testcase --- .../Test/Json/JsonManipulatorTest.php | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests/Composer/Test/Json/JsonManipulatorTest.php b/tests/Composer/Test/Json/JsonManipulatorTest.php index 05de454ca..d8bc7c200 100644 --- a/tests/Composer/Test/Json/JsonManipulatorTest.php +++ b/tests/Composer/Test/Json/JsonManipulatorTest.php @@ -2374,6 +2374,26 @@ class JsonManipulatorTest extends TestCase "package/a": "*" } } +', $manipulator->getContents()); + } + + public function testEscapedUnicodeDoesNotCauseBacktrackLimitErrorGithubIssue8131() + { + $manipulator = new JsonManipulator('{ + "description": "Some U\u00F1icode", + "require": { + "foo/bar": "^1.0" + } +}'); + + $this->assertTrue($manipulator->addLink('require', 'foo/baz', '^1.0')); + $this->assertEquals('{ + "description": "Some U\u00F1icode", + "require": { + "foo/bar": "^1.0", + "foo/baz": "^1.0" + } +} ', $manipulator->getContents()); } }