diff options
Diffstat (limited to 'tests/phpunit/includes/libs/composer/ComposerLockTest.php')
-rw-r--r-- | tests/phpunit/includes/libs/composer/ComposerLockTest.php | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/phpunit/includes/libs/composer/ComposerLockTest.php b/tests/phpunit/includes/libs/composer/ComposerLockTest.php new file mode 100644 index 000000000000..5b09cdb8804d --- /dev/null +++ b/tests/phpunit/includes/libs/composer/ComposerLockTest.php @@ -0,0 +1,31 @@ +<?php + +class ComposerLockTest extends MediaWikiTestCase { + + private $lock; + + public function setUp() { + parent::setUp(); + global $IP; + $this->lock = "$IP/tests/phpunit/data/composer/composer.lock"; + } + + public function testGetHash() { + $lock = new ComposerLock( $this->lock ); + $this->assertEquals( 'cc6e7fc565b246cb30b0cac103a2b31e', $lock->getHash() ); + } + + /** + * @covers ComposerLockParser::getInstalledDependencies + */ + public function testGetInstalledDependencies() { + $lock = new ComposerLock( $this->lock ); + $this->assertArrayEquals( array( + 'cdb/cdb' => '1.0.0', + 'cssjanus/cssjanus' => '1.1.1', + 'leafo/lessphp' => '0.5.0', + 'psr/log' => '1.0.0', + ), $lock->getInstalledDependencies(), false, true ); + } + +} |