summaryrefslogtreecommitdiff
path: root/tests/phpunit/includes/libs/composer/ComposerLockTest.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2015-06-04 07:31:04 +0200
committerPierre Schmitz <pierre@archlinux.de>2015-06-04 07:58:39 +0200
commitf6d65e533c62f6deb21342d4901ece24497b433e (patch)
treef28adf0362d14bcd448f7b65a7aaf38650f923aa /tests/phpunit/includes/libs/composer/ComposerLockTest.php
parentc27b2e832fe25651ef2410fae85b41072aae7519 (diff)
Update to MediaWiki 1.25.1
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 );
+ }
+
+}