X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=vendor%2Fcomposer%2Finstallers%2Ftests%2FComposer%2FInstallers%2FTest%2FCakePHPInstallerTest.php;fp=vendor%2Fcomposer%2Finstallers%2Ftests%2FComposer%2FInstallers%2FTest%2FCakePHPInstallerTest.php;h=0000000000000000000000000000000000000000;hb=0bf8d09d2542548982e81a441b1f16e75873a04f;hp=46b02769f72facbb69bc279a96900d700a48e9b7;hpb=74df008bdbb3a11eeea356744f39b802369bda3c;p=yaffs-website diff --git a/vendor/composer/installers/tests/Composer/Installers/Test/CakePHPInstallerTest.php b/vendor/composer/installers/tests/Composer/Installers/Test/CakePHPInstallerTest.php deleted file mode 100644 index 46b02769f..000000000 --- a/vendor/composer/installers/tests/Composer/Installers/Test/CakePHPInstallerTest.php +++ /dev/null @@ -1,114 +0,0 @@ -package = new Package('CamelCased', '1.0', '1.0'); - $this->io = $this->getMock('Composer\IO\PackageInterface'); - $this->composer = new Composer(); - $this->composer->setConfig(new Config(false)); - } - - /** - * testInflectPackageVars - * - * @return void - */ - public function testInflectPackageVars() - { - $installer = new CakePHPInstaller($this->package, $this->composer); - $result = $installer->inflectPackageVars(array('name' => 'CamelCased')); - $this->assertEquals($result, array('name' => 'CamelCased')); - - $installer = new CakePHPInstaller($this->package, $this->composer); - $result = $installer->inflectPackageVars(array('name' => 'with-dash')); - $this->assertEquals($result, array('name' => 'WithDash')); - - $installer = new CakePHPInstaller($this->package, $this->composer); - $result = $installer->inflectPackageVars(array('name' => 'with_underscore')); - $this->assertEquals($result, array('name' => 'WithUnderscore')); - - $installer = new CakePHPInstaller($this->package, $this->composer); - $result = $installer->inflectPackageVars(array('name' => 'cake/acl')); - $this->assertEquals($result, array('name' => 'Cake/Acl')); - - $installer = new CakePHPInstaller($this->package, $this->composer); - $result = $installer->inflectPackageVars(array('name' => 'cake/debug-kit')); - $this->assertEquals($result, array('name' => 'Cake/DebugKit')); - } - - /** - * Test getLocations returning appropriate values based on CakePHP version - * - */ - public function testGetLocations() { - $package = new RootPackage('CamelCased', '1.0', '1.0'); - $composer = $this->composer; - $rm = new RepositoryManager( - $this->getMock('Composer\IO\IOInterface'), - $this->getMock('Composer\Config') - ); - $composer->setRepositoryManager($rm); - $installer = new CakePHPInstaller($package, $composer); - - // 2.0 < cakephp < 3.0 - $this->setCakephpVersion($rm, '2.0.0'); - $result = $installer->getLocations(); - $this->assertContains('Plugin/', $result['plugin']); - - $this->setCakephpVersion($rm, '2.5.9'); - $result = $installer->getLocations(); - $this->assertContains('Plugin/', $result['plugin']); - - $this->setCakephpVersion($rm, '~2.5'); - $result = $installer->getLocations(); - $this->assertContains('Plugin/', $result['plugin']); - - // special handling for 2.x versions when 3.x is still in development - $this->setCakephpVersion($rm, 'dev-master'); - $result = $installer->getLocations(); - $this->assertContains('Plugin/', $result['plugin']); - - $this->setCakephpVersion($rm, '>=2.5'); - $result = $installer->getLocations(); - $this->assertContains('Plugin/', $result['plugin']); - - // cakephp >= 3.0 - $this->setCakephpVersion($rm, '3.0.*-dev'); - $result = $installer->getLocations(); - $this->assertContains('vendor/{$vendor}/{$name}/', $result['plugin']); - - $this->setCakephpVersion($rm, '~8.8'); - $result = $installer->getLocations(); - $this->assertContains('vendor/{$vendor}/{$name}/', $result['plugin']); - } - - protected function setCakephpVersion($rm, $version) { - $parser = new VersionParser(); - list(, $version) = explode(' ', $parser->parseConstraints($version)); - $installed = new InstalledArrayRepository(); - $package = new Package('cakephp/cakephp', $version, $version); - $installed->addPackage($package); - $rm->setLocalRepository($installed); - } - -}