ArrayLoaderTest.php 913 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. /*
  3. * This file is part of Composer.
  4. *
  5. * (c) Nils Adermann <naderman@naderman.de>
  6. * Jordi Boggiano <j.boggiano@seld.be>
  7. *
  8. * For the full copyright and license information, please view the LICENSE
  9. * file that was distributed with this source code.
  10. */
  11. namespace Composer\Test\Package\Loader;
  12. use Composer\Package\Loader\ArrayLoader;
  13. class ArrayLoaderTest extends \PHPUnit_Framework_TestCase
  14. {
  15. public function setUp()
  16. {
  17. $this->loader = new ArrayLoader();
  18. }
  19. public function testSelfVersion()
  20. {
  21. $config = array(
  22. 'name' => 'A',
  23. 'version' => '1.2.3.4',
  24. 'replace' => array(
  25. 'foo' => 'self.version',
  26. ),
  27. );
  28. $package = $this->loader->load($config);
  29. $replaces = $package->getReplaces();
  30. $this->assertEquals('== 1.2.3.4', (string) $replaces[0]->getConstraint());
  31. }
  32. }