Skip to content

Commit a0a9459

Browse files
committed
Merge remote-tracking branch 'ogresCE/MAGETWO-37710-composer-readiness-check' into PR_Branch
2 parents 11c5544 + 44c7795 commit a0a9459

File tree

17 files changed

+18192
-259
lines changed

17 files changed

+18192
-259
lines changed
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
<?php
2+
/**
3+
* Copyright © 2015 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace Magento\Setup\Model;
8+
9+
/**
10+
* Tests Magento\Setup\Model\ComposerInformation
11+
*/
12+
class ComposerInformationTest extends \PHPUnit_Framework_TestCase
13+
{
14+
/**
15+
* @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Framework\Filesystem\Directory\Read
16+
*/
17+
private $directoryReadMock;
18+
19+
/**
20+
* @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Framework\Filesystem
21+
*/
22+
private $filesystemMock;
23+
24+
/**
25+
* @var \PHPUnit_Framework_MockObject_MockObject|\Composer\IO\BufferIO
26+
*/
27+
private $ioMock;
28+
29+
public function setUp()
30+
{
31+
$this->directoryReadMock = $this->getMock('Magento\Framework\Filesystem\Directory\Read', [], [], '', false);
32+
$this->filesystemMock = $this->getMock('Magento\Framework\Filesystem', [], [], '', false);
33+
$this->filesystemMock
34+
->expects($this->any())
35+
->method('getDirectoryRead')
36+
->will($this->returnValue($this->directoryReadMock));
37+
$this->ioMock = $this->getMock('Composer\IO\BufferIO', [], [], '', false);
38+
}
39+
40+
/**
41+
* Setup DirectoryReadMock to use a specified directory for reading composer files
42+
*
43+
* @param $composerDir string Directory under _files that contains composer files
44+
*/
45+
private function setupDirectoryMock($composerDir)
46+
{
47+
$valueMap = [
48+
['vendor_path.php', null, __DIR__ . '/_files/vendor_path.php'],
49+
[null, null, __DIR__ . '/_files/' . $composerDir],
50+
];
51+
52+
$this->directoryReadMock
53+
->expects($this->any())
54+
->method('getAbsolutePath')
55+
->will($this->returnValueMap($valueMap));
56+
}
57+
58+
/**
59+
* @param $composerDir string Directory under _files that contains composer files
60+
*
61+
* @dataProvider getRequiredPhpVersionDataProvider
62+
*/
63+
public function testGetRequiredPhpVersion($composerDir)
64+
{
65+
$this->setupDirectoryMock($composerDir);
66+
$composerInfo = new ComposerInformation($this->filesystemMock, $this->ioMock);
67+
$this->assertEquals("~5.5.0|~5.6.0", $composerInfo->getRequiredPhpVersion());
68+
}
69+
70+
/**
71+
* @param $composerDir string Directory under _files that contains composer files
72+
*
73+
* @dataProvider getRequiredPhpVersionDataProvider
74+
*/
75+
public function testGetRequiredExtensions($composerDir)
76+
{
77+
$this->setupDirectoryMock($composerDir);
78+
$composerInfo = new ComposerInformation($this->filesystemMock, $this->ioMock);
79+
$expectedExtensions = ['ctype', 'gd', 'spl', 'dom', 'simplexml', 'mcrypt', 'hash', 'curl', 'iconv', 'intl'];
80+
81+
$actualRequiredExtensions = $composerInfo->getRequiredExtensions();
82+
foreach ($expectedExtensions as $expectedExtension) {
83+
$this->assertContains($expectedExtension, $actualRequiredExtensions);
84+
}
85+
}
86+
87+
/**
88+
* Data provider that returns directories containing different types of composer files.
89+
*
90+
* @return array
91+
*/
92+
public function getRequiredPhpVersionDataProvider()
93+
{
94+
return [
95+
'Skeleton Composer' => ['testSkeleton'],
96+
'Composer.json from git clone' => ['testFromClone'],
97+
'Composer.json from git create project' => ['testFromCreateProject'],
98+
];
99+
}
100+
101+
/**
102+
* @expectedException \Exception
103+
* @expectedExceptionMessage Composer file not found:
104+
*/
105+
public function testNoLock()
106+
{
107+
$this->setupDirectoryMock('notARealDirectory');
108+
new ComposerInformation($this->filesystemMock, $this->ioMock);
109+
}
110+
}
Lines changed: 215 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,215 @@
1+
{
2+
"name": "magento/magento2ce",
3+
"description": "Magento 2 (Community Edition)",
4+
"type": "project",
5+
"version": "0.74.0-beta9",
6+
"license": [
7+
"OSL-3.0",
8+
"AFL-3.0"
9+
],
10+
"require": {
11+
"php": "~5.5.0|~5.6.0",
12+
"zendframework/zend-stdlib": "2.4.0",
13+
"zendframework/zend-code": "2.4.0",
14+
"zendframework/zend-server": "2.4.0",
15+
"zendframework/zend-soap": "2.4.0",
16+
"zendframework/zend-uri": "2.4.0",
17+
"zendframework/zend-validator": "2.4.0",
18+
"zendframework/zend-console": "2.4.0",
19+
"zendframework/zend-modulemanager": "2.4.0",
20+
"zendframework/zend-mvc": "2.4.0",
21+
"zendframework/zend-text": "2.4.0",
22+
"zendframework/zend-i18n": "2.4.0",
23+
"zendframework/zend-eventmanager": "2.4.0",
24+
"zendframework/zend-view": "2.4.0",
25+
"zendframework/zend-servicemanager": "2.4.0",
26+
"zendframework/zend-json": "2.4.0",
27+
"zendframework/zend-config": "2.4.0",
28+
"zendframework/zend-form": "2.4.0",
29+
"zendframework/zend-di": "2.4.0",
30+
"zendframework/zend-serializer": "2.4.0",
31+
"zendframework/zend-log": "2.4.0",
32+
"zendframework/zend-http": "2.4.0",
33+
"magento/zendframework1": "1.12.10",
34+
"composer/composer": "1.0.0-alpha9",
35+
"monolog/monolog": "1.11.0",
36+
"oyejorge/less.php": "1.7.0.3",
37+
"tubalmartin/cssmin": "2.4.8-p4",
38+
"magento/magento-composer-installer": "*",
39+
"symfony/console": "~2.3"
40+
},
41+
"require-dev": {
42+
"phpunit/phpunit": "4.1.0",
43+
"squizlabs/php_codesniffer": "1.5.3",
44+
"phpmd/phpmd": "@stable",
45+
"pdepend/pdepend": "2.0.6",
46+
"lib-libxml": "*",
47+
"ext-ctype": "*",
48+
"ext-gd": "*",
49+
"ext-spl": "*",
50+
"ext-dom": "*",
51+
"ext-simplexml": "*",
52+
"ext-mcrypt": "*",
53+
"ext-hash": "*",
54+
"ext-curl": "*",
55+
"ext-iconv": "*",
56+
"ext-intl": "*",
57+
"sjparkinson/static-review": "~4.1",
58+
"fabpot/php-cs-fixer": "~1.2",
59+
"lusitanian/oauth": "~0.3"
60+
},
61+
"replace": {
62+
"magento/module-admin-notification": "self.version",
63+
"magento/module-authorization": "self.version",
64+
"magento/module-backend": "self.version",
65+
"magento/module-backup": "self.version",
66+
"magento/module-bundle": "self.version",
67+
"magento/module-cache-invalidate": "self.version",
68+
"magento/module-captcha": "self.version",
69+
"magento/module-catalog": "self.version",
70+
"magento/module-catalog-import-export": "self.version",
71+
"magento/module-catalog-inventory": "self.version",
72+
"magento/module-catalog-rule": "self.version",
73+
"magento/module-catalog-search": "self.version",
74+
"magento/module-catalog-url-rewrite": "self.version",
75+
"magento/module-catalog-widget": "self.version",
76+
"magento/module-centinel": "self.version",
77+
"magento/module-checkout": "self.version",
78+
"magento/module-checkout-agreements": "self.version",
79+
"magento/module-cms": "self.version",
80+
"magento/module-cms-url-rewrite": "self.version",
81+
"magento/module-config": "self.version",
82+
"magento/module-configurable-import-export": "self.version",
83+
"magento/module-configurable-product": "self.version",
84+
"magento/module-contact": "self.version",
85+
"magento/module-cookie": "self.version",
86+
"magento/module-cron": "self.version",
87+
"magento/module-currency-symbol": "self.version",
88+
"magento/module-customer": "self.version",
89+
"magento/module-customer-import-export": "self.version",
90+
"magento/module-design-editor": "self.version",
91+
"magento/module-developer": "self.version",
92+
"magento/module-dhl": "self.version",
93+
"magento/module-directory": "self.version",
94+
"magento/module-downloadable": "self.version",
95+
"magento/module-eav": "self.version",
96+
"magento/module-email": "self.version",
97+
"magento/module-fedex": "self.version",
98+
"magento/module-gift-message": "self.version",
99+
"magento/module-google-adwords": "self.version",
100+
"magento/module-google-analytics": "self.version",
101+
"magento/module-google-optimizer": "self.version",
102+
"magento/module-google-shopping": "self.version",
103+
"magento/module-grouped-import-export": "self.version",
104+
"magento/module-grouped-product": "self.version",
105+
"magento/module-import-export": "self.version",
106+
"magento/module-indexer": "self.version",
107+
"magento/module-integration": "self.version",
108+
"magento/module-layered-navigation": "self.version",
109+
"magento/module-log": "self.version",
110+
"magento/module-media-storage": "self.version",
111+
"magento/module-msrp": "self.version",
112+
"magento/module-multishipping": "self.version",
113+
"magento/module-newsletter": "self.version",
114+
"magento/module-offline-payments": "self.version",
115+
"magento/module-offline-shipping": "self.version",
116+
"magento/module-page-cache": "self.version",
117+
"magento/module-payment": "self.version",
118+
"magento/module-persistent": "self.version",
119+
"magento/module-product-alert": "self.version",
120+
"magento/module-quote": "self.version",
121+
"magento/module-reports": "self.version",
122+
"magento/module-require-js": "self.version",
123+
"magento/module-review": "self.version",
124+
"magento/module-rss": "self.version",
125+
"magento/module-rule": "self.version",
126+
"magento/module-sales": "self.version",
127+
"magento/module-sales-rule": "self.version",
128+
"magento/module-sales-sequence": "self.version",
129+
"magento/module-search": "self.version",
130+
"magento/module-sendfriend": "self.version",
131+
"magento/module-shipping": "self.version",
132+
"magento/module-sitemap": "self.version",
133+
"magento/module-store": "self.version",
134+
"magento/module-tax": "self.version",
135+
"magento/module-tax-import-export": "self.version",
136+
"magento/module-theme": "self.version",
137+
"magento/module-translation": "self.version",
138+
"magento/module-ui": "self.version",
139+
"magento/module-ups": "self.version",
140+
"magento/module-url-rewrite": "self.version",
141+
"magento/module-user": "self.version",
142+
"magento/module-usps": "self.version",
143+
"magento/module-variable": "self.version",
144+
"magento/module-version": "self.version",
145+
"magento/module-webapi": "self.version",
146+
"magento/module-weee": "self.version",
147+
"magento/module-widget": "self.version",
148+
"magento/module-wishlist": "self.version",
149+
"magento/theme-adminhtml-backend": "self.version",
150+
"magento/theme-frontend-blank": "self.version",
151+
"magento/theme-frontend-luma": "self.version",
152+
"magento/language-de_de": "self.version",
153+
"magento/language-en_us": "self.version",
154+
"magento/language-es_es": "self.version",
155+
"magento/language-fr_fr": "self.version",
156+
"magento/language-nl_nl": "self.version",
157+
"magento/language-pt_br": "self.version",
158+
"magento/language-zh_cn": "self.version",
159+
"magento/framework": "self.version",
160+
"trentrichardson/jquery-timepicker-addon": "1.4.3",
161+
"colinmollenhour/cache-backend-redis": "dev-master#193d377b7fb2e88595578b282fa01a62d1185abc",
162+
"colinmollenhour/credis": "dev-master#f07bbfd4117294f462f0fb19c49221d350bf396f",
163+
"linkorb/jsmin-php": "1.1.2",
164+
"phpseclib/phpseclib": "0.2.1",
165+
"components/jquery": "1.11.0",
166+
"blueimp/jquery-file-upload": "5.6.14",
167+
"components/jqueryui": "1.10.4",
168+
"twbs/bootstrap": "3.1.0",
169+
"tinymce/tinymce": "3.4.7"
170+
},
171+
"extra": {
172+
"component_paths": {
173+
"trentrichardson/jquery-timepicker-addon": "lib/web/jquery/jquery-ui-timepicker-addon.js",
174+
"colinmollenhour/cache-backend-redis": "lib/internal/Cm/Cache/Backend/Redis.php",
175+
"colinmollenhour/credis": "lib/internal/Credis",
176+
"linkorb/jsmin-php": "lib/internal/JSMin",
177+
"phpseclib/phpseclib": "lib/internal/phpseclib",
178+
"components/jquery": [
179+
"lib/web/jquery.js",
180+
"lib/web/jquery/jquery.min.js",
181+
"lib/web/jquery/jquery-migrate.js",
182+
"lib/web/jquery/jquery-migrate.min.js"
183+
],
184+
"blueimp/jquery-file-upload": "lib/web/jquery/fileUploader",
185+
"components/jqueryui": [
186+
"lib/web/jquery/jquery-ui.js",
187+
"lib/web/jquery/jquery-ui.min.js"
188+
],
189+
"twbs/bootstrap": [
190+
"lib/web/jquery/jquery.tabs.js"
191+
],
192+
"tinymce/tinymce": "lib/web/tiny_mce"
193+
}
194+
},
195+
"config": {
196+
"use-include-path": true
197+
},
198+
"autoload": {
199+
"psr-4": {
200+
"Magento\\Framework\\": "lib/internal/Magento/Framework/",
201+
"Magento\\Setup\\": "setup/src/Magento/Setup/"
202+
}
203+
},
204+
"autoload-dev": {
205+
"psr-4": {
206+
"Magento\\Sniffs\\": "dev/tests/static/framework/Magento/Sniffs/",
207+
"Magento\\Tools\\": "dev/tools/Magento/Tools/",
208+
"Magento\\Tools\\Sanity\\": "dev/build/publication/sanity/Magento/Tools/Sanity/",
209+
"Magento\\TestFramework\\Inspection\\": "dev/tests/static/framework/Magento/TestFramework/Inspection/",
210+
"Magento\\TestFramework\\Utility\\": "dev/tests/static/framework/Magento/TestFramework/Utility/"
211+
}
212+
},
213+
"minimum-stability": "alpha",
214+
"prefer-stable": true
215+
}

0 commit comments

Comments
 (0)