Browse Source

add missing testcase

Rob Bast 5 years ago
parent
commit
080b0f27e9
1 changed files with 20 additions and 0 deletions
  1. 20 0
      tests/Composer/Test/Json/JsonManipulatorTest.php

+ 20 - 0
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());
     }
 }