summaryrefslogtreecommitdiff
path: root/tests/phpunit/includes/libs/composer/ComposerLockTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/phpunit/includes/libs/composer/ComposerLockTest.php')
-rw-r--r--tests/phpunit/includes/libs/composer/ComposerLockTest.php62
1 files changed, 62 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 00000000..b5fd5f6e
--- /dev/null
+++ b/tests/phpunit/includes/libs/composer/ComposerLockTest.php
@@ -0,0 +1,62 @@
+<?php
+
+class ComposerLockTest extends MediaWikiTestCase {
+
+ private $lock;
+
+ public function setUp() {
+ parent::setUp();
+ global $IP;
+ $this->lock = "$IP/tests/phpunit/data/composer/composer.lock";
+ }
+
+ /**
+ * @covers ComposerLock::getHash
+ */
+ public function testGetHash() {
+ $lock = new ComposerLock( $this->lock );
+ $this->assertEquals( 'a3bb80b0ac4c4a31e52574d48c032923', $lock->getHash() );
+ }
+
+ /**
+ * @covers ComposerLock::getInstalledDependencies
+ */
+ public function testGetInstalledDependencies() {
+ $lock = new ComposerLock( $this->lock );
+ $this->assertArrayEquals( array(
+ 'wikimedia/cdb' => array(
+ 'version' => '1.0.1',
+ 'type' => 'library',
+ ),
+ 'cssjanus/cssjanus' => array(
+ 'version' => '1.1.1',
+ 'type' => 'library',
+ ),
+ 'leafo/lessphp' => array(
+ 'version' => '0.5.0',
+ 'type' => 'library',
+ ),
+ 'psr/log' => array(
+ 'version' => '1.0.0',
+ 'type' => 'library',
+ ),
+ 'oojs/oojs-ui' => array(
+ 'version' => '0.6.0',
+ 'type' => 'library',
+ ),
+ 'composer/installers' => array(
+ 'version' => '1.0.19',
+ 'type' => 'composer-installer',
+ ),
+ 'mediawiki/translate' => array(
+ 'version' => '2014.12',
+ 'type' => 'mediawiki-extension',
+ ),
+ 'mediawiki/universal-language-selector' => array(
+ 'version' => '2014.12',
+ 'type' => 'mediawiki-extension',
+ ),
+ ), $lock->getInstalledDependencies(), false, true );
+ }
+
+}