You are here

public function InstallerTest::testCustomTypePath in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/composer/installers/tests/Composer/Installers/Test/InstallerTest.php \Composer\Installers\Test\InstallerTest::testCustomTypePath()

testCustomTypePath

File

vendor/composer/installers/tests/Composer/Installers/Test/InstallerTest.php, line 359

Class

InstallerTest

Namespace

Composer\Installers\Test

Code

public function testCustomTypePath() {
  $installer = new Installer($this->io, $this->composer);
  $package = new Package('slbmeh/my_plugin', '1.0.0', '1.0.0');
  $package
    ->setType('wordpress-plugin');
  $consumerPackage = new RootPackage('foo/bar', '1.0.0', '1.0.0');
  $this->composer
    ->setPackage($consumerPackage);
  $consumerPackage
    ->setExtra(array(
    'installer-paths' => array(
      'my/custom/path/{$name}/' => array(
        'type:wordpress-plugin',
      ),
    ),
  ));
  $result = $installer
    ->getInstallPath($package);
  $this
    ->assertEquals('my/custom/path/my_plugin/', $result);
}