updated core and modules

This commit is contained in:
Bachir Soussi Chiadmi
2017-09-09 16:27:51 +02:00
parent 027aa99b32
commit 41863f872c
7810 changed files with 318922 additions and 83631 deletions
@@ -8,7 +8,7 @@ use Composer\Composer;
class AsgardInstallerTest extends \PHPUnit_Framework_TestCase
{
/**
* @var OctoberInstaller
* @var AsgardInstaller
*/
private $installer;
@@ -26,14 +26,20 @@ class AsgardInstallerTest extends \PHPUnit_Framework_TestCase
public function testInflectPackageVars($type, $name, $expected)
{
$this->assertEquals(
$this->installer->inflectPackageVars(array('name' => $name, 'type' => $type)),
array('name' => $expected, 'type' => $type)
array('name' => $expected, 'type' => $type),
$this->installer->inflectPackageVars(array('name' => $name, 'type' => $type))
);
}
public function packageNameInflectionProvider()
{
return array(
// Should keep module name StudlyCase
array(
'asgard-module',
'user-profile',
'UserProfile'
),
array(
'asgard-module',
'asgard-module',
@@ -44,11 +50,17 @@ class AsgardInstallerTest extends \PHPUnit_Framework_TestCase
'blog',
'Blog'
),
// tests that exactly one '-module' is cut off
array(
'asgard-module',
'some-module-module',
'SomeModule',
),
// tests that exactly one '-theme' is cut off
array(
'asgard-theme',
'some-theme-theme',
'Some-theme',
'SomeTheme',
),
// tests that names without '-theme' suffix stay valid
array(
@@ -56,6 +68,12 @@ class AsgardInstallerTest extends \PHPUnit_Framework_TestCase
'someothertheme',
'Someothertheme',
),
// Should keep theme name StudlyCase
array(
'asgard-theme',
'adminlte-advanced',
'AdminlteAdvanced'
),
);
}
}
@@ -0,0 +1,76 @@
<?php
namespace Composer\Installers\Test;
use Composer\Installers\BitrixInstaller;
use Composer\Package\PackageInterface;
use Composer\Package\Package;
use Composer\Composer;
/**
* Tests for the BitrixInstaller Class
*
* @coversDefaultClass Composer\Installers\BitrixInstaller
*/
class BitrixInstallerTest extends TestCase
{
/** @var BitrixInstaller */
private $installer;
/** @var Composer */
private $composer;
/**
* Sets up the fixture, for example, instantiate the class-under-test.
*
* This method is called before a test is executed.
*/
final function setUp()
{
$this->composer = new Composer();
}
/**
* @param string $vars
* @param string $expectedVars
*
* @covers ::inflectPackageVars
*
* @dataProvider provideExpectedInflectionResults
*/
final public function testInflectPackageVars($vars, $expectedVars)
{
$this->installer = new BitrixInstaller(
new Package($vars['name'], '4.2', '4.2'),
$this->composer
);
$actual = $this->installer->inflectPackageVars($vars);
$this->assertEquals($actual, $expectedVars);
}
/**
* Provides various parameters for packages and the expected result after inflection
*
* @return array
*/
final public function provideExpectedInflectionResults()
{
return array(
//check bitrix-dir is correct
array(
array('name' => 'Nyan/Cat'),
array('name' => 'Nyan/Cat', 'bitrix_dir' => 'bitrix')
),
array(
array('name' => 'Nyan/Cat', 'bitrix_dir' => 'bitrix'),
array('name' => 'Nyan/Cat', 'bitrix_dir' => 'bitrix')
),
array(
array('name' => 'Nyan/Cat', 'bitrix_dir' => 'local'),
array('name' => 'Nyan/Cat', 'bitrix_dir' => 'local')
),
);
}
}
@@ -100,7 +100,7 @@ class CakePHPInstallerTest extends TestCase
$this->setCakephpVersion($rm, '~8.8');
$result = $installer->getLocations();
$this->assertEquals('vendor/{$vendor}/{$name}/', $result['plugin']);
$this->assertContains('vendor/{$vendor}/{$name}/', $result['plugin']);
}
protected function setCakephpVersion($rm, $version) {
@@ -0,0 +1,83 @@
<?php
namespace Composer\Installers\Test;
use Composer\Installers\CraftInstaller;
/**
* Tests for the CraftInstaller Class
*
* @coversDefaultClass Composer\Installers\CraftInstaller
*/
class CraftInstallerTest extends TestCase
{
/** @var CraftInstaller */
private $installer;
/**
* Sets up the fixture, for example, instantiate the class-under-test.
*
* This method is called before a test is executed.
*/
final public function setup()
{
$this->installer = new CraftInstaller();
}
/**
* @param string $packageName
* @param string $expectedName
*
* @covers ::inflectPackageVars
*
* @dataProvider provideExpectedInflectionResults
*/
final public function testInflectPackageVars($packageName, $expectedName)
{
$installer = $this->installer;
$vars = array('name' => $packageName);
$expected = array('name' => $expectedName);
$actual = $installer->inflectPackageVars($vars);
$this->assertEquals($actual, $expected);
}
/**
* Provides various names for packages and the expected result after inflection
*
* @return array
*/
final public function provideExpectedInflectionResults()
{
return array(
// lowercase
array('foo', 'foo'),
array('craftfoo', 'craftfoo'),
array('fooplugin', 'fooplugin'),
array('craftfooplugin', 'craftfooplugin'),
// lowercase - dash
array('craft-foo', 'foo'),
array('foo-plugin', 'foo'),
array('craft-foo-plugin', 'foo'),
// lowercase - underscore
array('craft_foo', 'craft_foo'),
array('foo_plugin', 'foo_plugin'),
array('craft_foo_plugin', 'craft_foo_plugin'),
// CamelCase
array('Foo', 'Foo'),
array('CraftFoo', 'CraftFoo'),
array('FooPlugin', 'FooPlugin'),
array('CraftFooPlugin', 'CraftFooPlugin'),
// CamelCase - Dash
array('Craft-Foo', 'Foo'),
array('Foo-Plugin', 'Foo'),
array('Craft-Foo-Plugin', 'Foo'),
// CamelCase - underscore
array('Craft_Foo', 'Craft_Foo'),
array('Foo_Plugin', 'Foo_Plugin'),
array('Craft_Foo_Plugin', 'Craft_Foo_Plugin'),
);
}
}
@@ -89,15 +89,18 @@ class InstallerTest extends TestCase
array('annotatecms-module', true),
array('annotatecms-component', true),
array('annotatecms-service', true),
array('attogram-module', true),
array('bitrix-module', true),
array('bitrix-component', true),
array('bitrix-theme', true),
array('bonefish-package', true),
array('cakephp', false),
array('cakephp-', false),
array('cakephp-app', false),
array('cakephp-plugin', true),
array('chef-cookbook', true),
array('chef-role', true),
array('cockpit-module', true),
array('codeigniter-app', false),
array('codeigniter-library', true),
array('codeigniter-third-party', true),
@@ -109,10 +112,15 @@ class InstallerTest extends TestCase
array('craft-plugin', true),
array('croogo-plugin', true),
array('croogo-theme', true),
array('decibel-app', true),
array('dokuwiki-plugin', true),
array('dokuwiki-template', true),
array('drupal-module', true),
array('dolibarr-module', true),
array('ee3-theme', true),
array('ee3-addon', true),
array('ee2-theme', true),
array('ee2-addon', true),
array('elgg-plugin', true),
array('fuel-module', true),
array('fuel-package', true),
@@ -120,6 +128,9 @@ class InstallerTest extends TestCase
array('fuelphp-component', true),
array('hurad-plugin', true),
array('hurad-theme', true),
array('imagecms-template', true),
array('imagecms-module', true),
array('imagecms-library', true),
array('joomla-library', true),
array('kirby-plugin', true),
array('kohana-module', true),
@@ -142,17 +153,23 @@ class InstallerTest extends TestCase
array('piwik-plugin', true),
array('phpbb-extension', true),
array('pimcore-plugin', true),
array('plentymarkets-plugin', true),
array('ppi-module', true),
array('prestashop-module', true),
array('prestashop-theme', true),
array('puppet-module', true),
array('radphp-bundle', true),
array('redaxo-addon', true),
array('redaxo-bestyle-plugin', true),
array('reindex-theme', true),
array('reindex-plugin', true),
array('roundcube-plugin', true),
array('shopware-backend-plugin', true),
array('shopware-core-plugin', true),
array('shopware-frontend-plugin', true),
array('shopware-theme', true),
array('shopware-plugin', true),
array('shopware-frontend-theme', true),
array('silverstripe-module', true),
array('silverstripe-theme', true),
array('smf-module', true),
@@ -166,13 +183,21 @@ class InstallerTest extends TestCase
array('tusk-asset', true),
array('typo3-flow-plugin', true),
array('typo3-cms-extension', true),
array('vanilla-plugin', true),
array('vanilla-theme', true),
array('whmcs-gateway', true),
array('wolfcms-plugin', true),
array('wordpress-plugin', true),
array('wordpress-core', false),
array('yawik-module', true),
array('zend-library', true),
array('zikula-module', true),
array('zikula-theme', true),
array('kodicms-plugin', true),
array('kodicms-media', true),
array('phifty-bundle', true),
array('phifty-library', true),
array('phifty-framework', true),
);
}
@@ -202,12 +227,18 @@ class InstallerTest extends TestCase
array('annotatecms-module', 'addons/modules/my_module/', 'vysinsky/my_module'),
array('annotatecms-component', 'addons/components/my_component/', 'vysinsky/my_component'),
array('annotatecms-service', 'addons/services/my_service/', 'vysinsky/my_service'),
array('bitrix-module', 'local/modules/my_module/', 'author/my_module'),
array('bitrix-component', 'local/components/my_component/', 'author/my_component'),
array('bitrix-theme', 'local/templates/my_theme/', 'author/my_theme'),
array('attogram-module', 'modules/my_module/', 'author/my_module'),
array('bitrix-module', 'bitrix/modules/my_module/', 'author/my_module'),
array('bitrix-component', 'bitrix/components/my_component/', 'author/my_component'),
array('bitrix-theme', 'bitrix/templates/my_theme/', 'author/my_theme'),
array('bitrix-d7-module', 'bitrix/modules/author.my_module/', 'author/my_module'),
array('bitrix-d7-component', 'bitrix/components/author/my_component/', 'author/my_component'),
array('bitrix-d7-template', 'bitrix/templates/author_my_template/', 'author/my_template'),
array('bonefish-package', 'Packages/bonefish/package/', 'bonefish/package'),
array('cakephp-plugin', 'Plugin/Ftp/', 'shama/ftp'),
array('chef-cookbook', 'Chef/mre/my_cookbook/', 'mre/my_cookbook'),
array('chef-role', 'Chef/roles/my_role/', 'mre/my_role'),
array('cockpit-module', 'cockpit/modules/addons/My_module/', 'piotr-cz/cockpit-my_module'),
array('codeigniter-library', 'application/libraries/my_package/', 'shama/my_package'),
array('codeigniter-module', 'application/modules/my_package/', 'shama/my_package'),
array('concrete5-block', 'blocks/concrete5_block/', 'remo/concrete5_block'),
@@ -217,6 +248,7 @@ class InstallerTest extends TestCase
array('craft-plugin', 'craft/plugins/my_plugin/', 'mdcpepper/my_plugin'),
array('croogo-plugin', 'Plugin/Sitemaps/', 'fahad19/sitemaps'),
array('croogo-theme', 'View/Themed/Readable/', 'rchavik/readable'),
array('decibel-app', 'app/someapp/', 'author/someapp'),
array('dokuwiki-plugin', 'lib/plugins/someplugin/', 'author/someplugin'),
array('dokuwiki-template', 'lib/tpl/sometemplate/', 'author/sometemplate'),
array('dolibarr-module', 'htdocs/custom/my_module/', 'shama/my_module'),
@@ -225,12 +257,19 @@ class InstallerTest extends TestCase
array('drupal-profile', 'profiles/my_module/', 'shama/my_module'),
array('drupal-drush', 'drush/my_module/', 'shama/my_module'),
array('elgg-plugin', 'mod/sample_plugin/', 'test/sample_plugin'),
array('ee3-addon', 'system/user/addons/ee_theme/', 'author/ee_theme'),
array('ee3-theme', 'themes/user/ee_package/', 'author/ee_package'),
array('ee2-addon', 'system/expressionengine/third_party/ee_theme/', 'author/ee_theme'),
array('ee2-theme', 'themes/third_party/ee_package/', 'author/ee_package'),
array('fuel-module', 'fuel/app/modules/module/', 'fuel/module'),
array('fuel-package', 'fuel/packages/orm/', 'fuel/orm'),
array('fuel-theme', 'fuel/app/themes/theme/', 'fuel/theme'),
array('fuelphp-component', 'components/demo/', 'fuelphp/demo'),
array('hurad-plugin', 'plugins/Akismet/', 'atkrad/akismet'),
array('hurad-theme', 'plugins/Hurad2013/', 'atkrad/Hurad2013'),
array('imagecms-template', 'templates/my_template/', 'shama/my_template'),
array('imagecms-module', 'application/modules/my_module/', 'shama/my_module'),
array('imagecms-library', 'application/libraries/my_library/', 'shama/my_library'),
array('joomla-plugin', 'plugins/my_plugin/', 'shama/my_plugin'),
array('kirby-plugin', 'site/plugins/my_plugin/', 'shama/my_plugin'),
array('kohana-module', 'modules/my_package/', 'shama/my_package'),
@@ -262,16 +301,22 @@ class InstallerTest extends TestCase
array('phpbb-style', 'styles/foo/', 'test/foo'),
array('phpbb-language', 'language/foo/', 'test/foo'),
array('pimcore-plugin', 'plugins/MyPlugin/', 'ubikz/my_plugin'),
array('plentymarkets-plugin', 'HelloWorld/', 'plugin-hello-world'),
array('ppi-module', 'modules/foo/', 'test/foo'),
array('puppet-module', 'modules/puppet-name/', 'puppet/puppet-name'),
array('radphp-bundle', 'src/Migration/', 'atkrad/migration'),
array('redaxo-addon', 'redaxo/include/addons/my_plugin/', 'shama/my_plugin'),
array('redaxo-bestyle-plugin', 'redaxo/include/addons/be_style/plugins/my_plugin/', 'shama/my_plugin'),
array('reindex-theme', 'themes/my_module/', 'author/my_module'),
array('reindex-plugin', 'plugins/my_module/', 'author/my_module'),
array('roundcube-plugin', 'plugins/base/', 'test/base'),
array('roundcube-plugin', 'plugins/replace_dash/', 'test/replace-dash'),
array('shopware-backend-plugin', 'engine/Shopware/Plugins/Local/Backend/ShamaMyBackendPlugin/', 'shama/my-backend-plugin'),
array('shopware-core-plugin', 'engine/Shopware/Plugins/Local/Core/ShamaMyCorePlugin/', 'shama/my-core-plugin'),
array('shopware-frontend-plugin', 'engine/Shopware/Plugins/Local/Frontend/ShamaMyFrontendPlugin/', 'shama/my-frontend-plugin'),
array('shopware-theme', 'templates/my_theme/', 'shama/my-theme'),
array('shopware-frontend-theme', 'themes/Frontend/ShamaMyFrontendTheme/', 'shama/my-frontend-theme'),
array('shopware-plugin', 'custom/plugins/ShamaMyPlugin/', 'shama/my-plugin'),
array('silverstripe-module', 'my_module/', 'shama/my_module'),
array('silverstripe-module', 'sapphire/', 'silverstripe/framework', '2.4.0'),
array('silverstripe-module', 'framework/', 'silverstripe/framework', '3.0.0'),
@@ -290,6 +335,8 @@ class InstallerTest extends TestCase
array('typo3-flow-package', 'Packages/Application/my_package/', 'shama/my_package'),
array('typo3-flow-build', 'Build/my_package/', 'shama/my_package'),
array('typo3-cms-extension', 'typo3conf/ext/my_extension/', 'shama/my_extension'),
array('vanilla-plugin', 'plugins/my_plugin/', 'shama/my_plugin'),
array('vanilla-theme', 'themes/my_theme/', 'shama/my_theme'),
array('whmcs-gateway', 'modules/gateways/gateway_name/', 'vendor/gateway_name'),
array('wolfcms-plugin', 'wolf/plugins/my_plugin/', 'shama/my_plugin'),
array('wordpress-plugin', 'wp-content/plugins/my_plugin/', 'shama/my_plugin'),
@@ -297,6 +344,12 @@ class InstallerTest extends TestCase
array('zend-extra', 'extras/library/zend_test/', 'shama/zend_test'),
array('zikula-module', 'modules/my-test_module/', 'my/test_module'),
array('zikula-theme', 'themes/my-test_theme/', 'my/test_theme'),
array('kodicms-media', 'cms/media/vendor/my_media/', 'shama/my_media'),
array('kodicms-plugin', 'cms/plugins/my_plugin/', 'shama/my_plugin'),
array('phifty-bundle', 'bundles/core/', 'shama/core'),
array('phifty-library', 'libraries/my-lib/', 'shama/my-lib'),
array('phifty-framework', 'frameworks/my-framework/', 'shama/my-framework'),
array('yawik-module', 'module/MyModule/', 'shama/my_module'),
);
}
@@ -374,6 +427,27 @@ class InstallerTest extends TestCase
$this->assertEquals('my/custom/path/my_plugin/', $result);
}
/**
* testVendorPath
*/
public function testVendorPath()
{
$installer = new Installer($this->io, $this->composer);
$package = new Package('penyaskito/my_module', '1.0.0', '1.0.0');
$package->setType('drupal-module');
$consumerPackage = new RootPackage('drupal/drupal', '1.0.0', '1.0.0');
$this->composer->setPackage($consumerPackage);
$consumerPackage->setExtra(array(
'installer-paths' => array(
'modules/custom/{$name}/' => array(
'vendor:penyaskito'
),
),
));
$result = $installer->getInstallPath($package);
$this->assertEquals('modules/custom/my_module/', $result);
}
/**
* testNoVendorName
*/
@@ -0,0 +1,64 @@
<?php
namespace Composer\Installers\Test;
use Composer\Composer;
use Composer\Installers\YawikInstaller;
use Composer\Package\Package;
use Composer\Package\PackageInterface;
/**
* Class YawikInstallerTest
*
* @package Composer\Installers\Test
*/
class YawikInstallerTest extends TestCase
{
/**
* @varComposer
*/
private $composer;
/**
* @var PackageInterface
*/
private $io;
/**
* @var Package
*/
private $package;
/**
* setUp
*
* @return void
*/
public function setUp()
{
$this->package = new Package('YawikCompanyRegistration', '1.0', '1.0');
$this->io = $this->getMock('Composer\IO\PackageInterface');
$this->composer = new Composer();
}
/**
* testInflectPackageVars
*
* @dataProvider packageNameProvider
* @return void
*/
public function testInflectPackageVars($input)
{
$installer = new YawikInstaller($this->package, $this->composer);
$result = $installer->inflectPackageVars(array('name' => $input));
$this->assertEquals($result, array('name' => 'YawikCompanyRegistration'));
}
public function packageNameProvider()
{
return array(
array('yawik-company-registration'),
array('yawik_company_registration'),
array('YawikCompanyRegistration')
);
}
}