mirror of
https://github.com/composer/composer
synced 2025-05-10 09:02:59 +00:00
Merge branch '1.5'
This commit is contained in:
commit
dae575c197
2 changed files with 35 additions and 0 deletions
|
@ -2331,4 +2331,34 @@ class JsonManipulatorTest extends \PHPUnit_Framework_TestCase
|
|||
}
|
||||
', $manipulator->getContents());
|
||||
}
|
||||
|
||||
public function testRemoveMainKeyAtEndOfFile()
|
||||
{
|
||||
$manipulator = new JsonManipulator('{
|
||||
"require": {
|
||||
"package/a": "*"
|
||||
}
|
||||
}
|
||||
');
|
||||
$this->assertTrue($manipulator->addMainKey('homepage', 'http...'));
|
||||
$this->assertTrue($manipulator->addMainKey('license', 'mit'));
|
||||
$this->assertEquals('{
|
||||
"require": {
|
||||
"package/a": "*"
|
||||
},
|
||||
"homepage": "http...",
|
||||
"license": "mit"
|
||||
}
|
||||
', $manipulator->getContents());
|
||||
|
||||
$this->assertTrue($manipulator->removeMainKey('homepage'));
|
||||
$this->assertTrue($manipulator->removeMainKey('license'));
|
||||
$this->assertEquals('{
|
||||
"require": {
|
||||
"package/a": "*"
|
||||
}
|
||||
}
|
||||
', $manipulator->getContents());
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue