1
0
Fork 0

Fix removal of missing keys

pull/2897/head
Jordi Boggiano 2014-04-10 15:55:05 +02:00
parent a023c7929a
commit d742ffca4f
2 changed files with 23 additions and 0 deletions

View File

@ -222,6 +222,8 @@ class JsonManipulator
}
}
}
} else {
$childrenClean = $children;
}
// no child data left, $name was the only key in

View File

@ -347,6 +347,27 @@ class JsonManipulatorTest extends \PHPUnit_Framework_TestCase
}
}
}
'
),
'works on undefined ones' => array(
'{
"repositories": {
"main": {
"foo": "bar",
"bar": "baz"
}
}
}',
'removenotthere',
true,
'{
"repositories": {
"main": {
"foo": "bar",
"bar": "baz"
}
}
}
'
),
'works on empty repos' => array(