From 092dec95962c25749875ad99ff977c8456c8963b Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Mon, 10 Oct 2016 18:02:00 +0200 Subject: [PATCH] Add failing test for #5771 --- .../Test/Json/JsonManipulatorTest.php | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/tests/Composer/Test/Json/JsonManipulatorTest.php b/tests/Composer/Test/Json/JsonManipulatorTest.php index 7ee9eec73..2202ceb16 100644 --- a/tests/Composer/Test/Json/JsonManipulatorTest.php +++ b/tests/Composer/Test/Json/JsonManipulatorTest.php @@ -1691,6 +1691,47 @@ class JsonManipulatorTest extends \PHPUnit_Framework_TestCase ', $manipulator->getContents()); } + public function testAddExtraWithPackage() + { + //$this->markTestSkipped(); + $manipulator = new JsonManipulator('{ + "repositories": [ + { + "type": "package", + "package": { + "authors": [], + "extra": { + "package-xml": "package.xml" + } + } + } + ], + "extra": { + "auto-append-gitignore": true + } +}'); + + $this->assertTrue($manipulator->addProperty('extra.foo-bar', true)); + $this->assertEquals('{ + "repositories": [ + { + "type": "package", + "package": { + "authors": [], + "extra": { + "package-xml": "package.xml" + } + } + } + ], + "extra": { + "auto-append-gitignore": true, + "foo-bar": true + } +} +', $manipulator->getContents()); + } + public function testAddRepositoryCanInitializeEmptyRepositories() { $manipulator = new JsonManipulator('{