1
0
Fork 0

solve edge case for `composer remove vendor/pkg`

pull/3721/head
Rob Bast 2015-02-09 17:21:20 +01:00
parent 07c644ac22
commit fb54429941
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('{