1
0
Fork 0

Merge remote-tracking branch 'alcohol/fix-remove-package-edge-case'

pull/3724/head
Jordi Boggiano 2015-02-09 18:01:34 +00:00
commit 39b3a19cf7
1 changed files with 38 additions and 0 deletions

View File

@ -595,6 +595,44 @@ class JsonManipulatorTest extends \PHPUnit_Framework_TestCase
); );
} }
public function testRemoveSubNodeFromRequire()
{
$manipulator = new JsonManipulator('{
"repositories": [
{
"package": {
"require": {
"this/should-not-end-up-in-root-require": "~2.0"
}
}
}
],
"require": {
"package/a": "*",
"package/b": "*",
"package/c": "*"
}
}');
$this->assertTrue($manipulator->removeSubNode('require', 'package/c'));
$this->assertEquals('{
"repositories": [
{
"package": {
"require": {
"this/should-not-end-up-in-root-require": "~2.0"
}
}
}
],
"require": {
"package/a": "*",
"package/b": "*"
}
}
', $manipulator->getContents());
}
public function testAddRepositoryCanInitializeEmptyRepositories() public function testAddRepositoryCanInitializeEmptyRepositories()
{ {
$manipulator = new JsonManipulator('{ $manipulator = new JsonManipulator('{