3 class ComposerJsonTest
extends PHPUnit\Framework\TestCase
{
7 public function setUp() {
9 $this->json
= __DIR__
. "/../../../data/composer/composer.json";
10 $this->json2
= __DIR__
. "/../../../data/composer/new-composer.json";
14 * @covers ComposerJson::__construct
15 * @covers ComposerJson::getRequiredDependencies
17 public function testGetRequiredDependencies() {
18 $json = new ComposerJson( $this->json
);
19 $this->assertEquals( [
21 'cssjanus/cssjanus' => '1.1.1',
22 'leafo/lessphp' => '0.5.0',
24 ], $json->getRequiredDependencies() );
27 public static function provideNormalizeVersion() {
29 [ 'v1.0.0', '1.0.0' ],
35 * @dataProvider provideNormalizeVersion
36 * @covers ComposerJson::normalizeVersion
38 public function testNormalizeVersion( $input, $expected ) {
39 $this->assertEquals( $expected, ComposerJson
::normalizeVersion( $input ) );