Skip to content

Commit 43fbf14

Browse files
author
Sergii Kovalenko
committed
Merge remote-tracking branch 'origin/MAGETWO-88054' into MAGETWO-88054
2 parents 475098e + 7de715a commit 43fbf14

File tree

29 files changed

+629
-328
lines changed

29 files changed

+629
-328
lines changed

.php_cs.dist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
*/
66

77
/**
8-
* Pre-commit hook installation:
9-
* vendor/bin/static-review.php hook:install dev/tools/Magento/Tools/StaticReview/pre-commit .git/hooks/pre-commit
8+
* PHP Coding Standards fixer configuration
109
*/
10+
1111
$finder = PhpCsFixer\Finder::create()
1212
->name('*.phtml')
1313
->exclude('dev/tests/functional/generated')

composer.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"colinmollenhour/cache-backend-file": "1.4",
3535
"colinmollenhour/cache-backend-redis": "1.10.2",
3636
"colinmollenhour/credis": "1.6",
37-
"colinmollenhour/php-redis-session-abstract": "~1.2.2",
37+
"colinmollenhour/php-redis-session-abstract": "~1.3.8",
3838
"composer/composer": "1.4.1",
3939
"magento/composer": "~1.2.0",
4040
"magento/magento-composer-installer": ">=0.1.11",
@@ -44,12 +44,12 @@
4444
"pelago/emogrifier": "^2.0.0",
4545
"phpseclib/phpseclib": "2.0.*",
4646
"ramsey/uuid": "3.6.1",
47-
"sjparkinson/static-review": "~4.1",
4847
"symfony/console": "~2.3, !=2.7.0",
4948
"symfony/event-dispatcher": "~2.1",
5049
"symfony/process": "~2.1",
5150
"tedivm/jshrink": "~1.1.0",
5251
"tubalmartin/cssmin": "4.1.0",
52+
"webonyx/graphql-php": "^0.11.1",
5353
"zendframework/zend-captcha": "^2.7.1",
5454
"zendframework/zend-code": "^3.1.0",
5555
"zendframework/zend-config": "^2.6.0",
@@ -75,8 +75,7 @@
7575
"zendframework/zend-text": "^2.6.0",
7676
"zendframework/zend-uri": "^2.5.1",
7777
"zendframework/zend-validator": "^2.6.0",
78-
"zendframework/zend-view": "^2.8.1",
79-
"webonyx/graphql-php": "^0.11.1"
78+
"zendframework/zend-view": "^2.8.1"
8079
},
8180
"require-dev": {
8281
"friendsofphp/php-cs-fixer": "~2.1.1",

composer.lock

Lines changed: 8 additions & 111 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
// @codingStandardsIgnoreFile
7+
return ['CREATE TABLE `reference_table` (
8+
`tinyint_ref` tinyint(7) NOT NULL AUTO_INCREMENT ,
9+
`tinyint_without_padding` tinyint(2) NOT NULL DEFAULT 0 ,
10+
`bigint_without_padding` bigint(20) NOT NULL DEFAULT 0 ,
11+
`smallint_without_padding` smallint(5) NOT NULL DEFAULT 0 ,
12+
`integer_without_padding` int(11) NOT NULL DEFAULT 0 ,
13+
`smallint_with_big_padding` smallint(254) NOT NULL DEFAULT 0 ,
14+
`smallint_without_default` smallint(2) NULL ,
15+
`int_without_unsigned` int(2) NULL ,
16+
`int_unsigned` int(2) UNSIGNED NULL ,
17+
`bigint_default_nullable` bigint(2) UNSIGNED NULL DEFAULT 1 ,
18+
`bigint_not_default_not_nullable` bigint(2) UNSIGNED NOT NULL ,
19+
CONSTRAINT PRIMARY KEY (`tinyint_ref`)
20+
) ENGINE=innodb
21+
22+
CREATE TABLE `auto_increment_test` (
23+
`int_auto_increment_with_nullable` int(12) UNSIGNED NOT NULL AUTO_INCREMENT ,
24+
`int_disabled_auto_increment` smallint(12) UNSIGNED NULL DEFAULT 0 ,
25+
CONSTRAINT `unique_null_key` UNIQUE KEY (`int_auto_increment_with_nullable`)
26+
) ENGINE=innodb
27+
28+
CREATE TABLE `test_table` (
29+
`smallint` smallint(3) NOT NULL AUTO_INCREMENT ,
30+
`tinyint` tinyint(7) NULL ,
31+
`bigint` bigint(13) NULL DEFAULT 0 ,
32+
`float` float(12, 4) NULL DEFAULT 0 ,
33+
`double` decimal(14, 6) NULL DEFAULT 11111111.111111 ,
34+
`decimal` decimal(15, 4) NULL DEFAULT 0 ,
35+
`date` date NULL ,
36+
`timestamp` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ,
37+
`datetime` datetime NULL DEFAULT 0 ,
38+
`longtext` longtext NULL ,
39+
`mediumtext` mediumtext NULL ,
40+
`varchar` varchar(254) NULL ,
41+
`mediumblob` mediumblob NULL ,
42+
`blob` blob NULL ,
43+
`boolean` BOOLEAN NULL ,
44+
CONSTRAINT `some_unique_key` UNIQUE KEY (`smallint`,`bigint`),
45+
CONSTRAINT `some_foreign_key` FOREIGN KEY (`tinyint`) REFERENCES `reference_table` (`tinyint_ref`) ON DELETE NO ACTION,
46+
INDEX `speedup_index` (`tinyint`,`bigint`)
47+
) ENGINE=innodb
48+
49+
CREATE TABLE `patch_list` (
50+
`patch_id` int(11) NOT NULL AUTO_INCREMENT COMMENT "Patch Auto Increment",
51+
`patch_name` varchar(1024) NOT NULL COMMENT "Patch Class Name",
52+
CONSTRAINT PRIMARY KEY (`patch_id`)
53+
) ENGINE=innodb COMMENT="List of data/schema patches"
54+
55+
'];
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
// @codingStandardsIgnoreFile
7+
return ['ALTER TABLE `reference_table` MODIFY COLUMN `tinyint_without_padding` tinyint(2) NOT NULL , MODIFY COLUMN `bigint_default_nullable` bigint(2) UNSIGNED NULL DEFAULT 123 , MODIFY COLUMN `bigint_not_default_not_nullable` bigint(20) NOT NULL
8+
9+
ALTER TABLE `auto_increment_test` MODIFY COLUMN `int_auto_increment_with_nullable` int(15) UNSIGNED NULL
10+
11+
ALTER TABLE `test_table` MODIFY COLUMN `float` float(12, 10) NULL DEFAULT 0 , MODIFY COLUMN `double` double(245, 10) NULL , MODIFY COLUMN `timestamp` timestamp NULL DEFAULT CURRENT_TIMESTAMP , MODIFY COLUMN `varchar` varchar(100) NULL , MODIFY COLUMN `boolean` BOOLEAN NULL DEFAULT 1
12+
13+
'];

dev/tests/setup-integration/_files/Magento/TestSetupDeclarationModule4/fixture/safe_data_provider.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,22 @@
55
*/
66
return [
77
[
8-
'page_id' => 1,
8+
'page_id' => '1',
99
'email' => '1@gmail.com',
1010
'title' => 'Title1'
1111
],
1212
[
13-
'page_id' => 2,
13+
'page_id' => '2',
1414
'email' => '2@gmail.com',
1515
'title' => 'Title2'
1616
],
1717
[
18-
'page_id' => 3,
18+
'page_id' => '3',
1919
'email' => '3@gmail.com',
2020
'title' => 'Title3'
2121
],
2222
[
23-
'page_id' => 4,
23+
'page_id' => '4',
2424
'email' => '4@gmail.com',
2525
'title' => 'Title4'
2626
]

dev/tests/setup-integration/framework/Magento/TestFramework/Annotation/CopyModules.php

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -66,21 +66,33 @@ public function endTest(\PHPUnit\Framework\TestCase $test)
6666
{
6767
$annotations = $test->getAnnotations();
6868
//This annotation can be declared only on method level
69-
if (isset($annotations['method']['moduleName'])) {
69+
if (!empty($annotations['method']['moduleName'])) {
7070
foreach ($annotations['method']['moduleName'] as $moduleName) {
7171
$path = MAGENTO_MODULES_PATH .
7272
//Take only module name from Magento_ModuleName
7373
explode("_", $moduleName)[1];
74-
7574
File::rmdirRecursive($path);
75+
$this->unsergisterModuleFromComponentRegistrar($moduleName);
7676
}
77-
78-
$reflection = new \ReflectionClass(ComponentRegistrar::class);
79-
$reflectionProperty = $reflection->getProperty('paths');
80-
$reflectionProperty->setAccessible(true);
81-
$value = $reflectionProperty->getValue();
82-
$value[ComponentRegistrar::MODULE] = [];
83-
$reflectionProperty->setValue($value);
8477
}
8578
}
79+
80+
/**
81+
* Unregister module from component registrar.
82+
* The component registrar uses static private variable and does not provide unregister method,
83+
* however unregister is required to remove registered modules after they are deleted from app/code.
84+
*
85+
* @param $moduleName
86+
*
87+
* @return void
88+
*/
89+
private function unsergisterModuleFromComponentRegistrar($moduleName)
90+
{
91+
$reflection = new \ReflectionClass(ComponentRegistrar::class);
92+
$reflectionProperty = $reflection->getProperty('paths');
93+
$reflectionProperty->setAccessible(true);
94+
$value = $reflectionProperty->getValue();
95+
unset($value[ComponentRegistrar::MODULE][$moduleName]);
96+
$reflectionProperty->setValue($value);
97+
}
8698
}

dev/tests/setup-integration/framework/Magento/TestFramework/Deploy/CliCommand.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public function enableModule($moduleName)
6565
{
6666
$initParams = $this->parametersHolder->getInitParams();
6767
$enableModuleCommand = 'php -f ' . BP . '/bin/magento module:enable ' . $moduleName
68-
. ' -n -vvv --magento-init-params=' . $initParams['magento-init-params'];
68+
. ' -n -vvv --magento-init-params="' . $initParams['magento-init-params'] . '"';
6969
return $this->shell->execute($enableModuleCommand);
7070
}
7171

@@ -78,10 +78,10 @@ public function enableModule($moduleName)
7878
public function upgrade($installParams = [])
7979
{
8080
$initParams = $this->parametersHolder->getInitParams();
81-
$upgradeCommand = 'php -f ' . BP . '/bin/magento setup:upgrade -vvv -n --magento-init-params='
82-
. $initParams['magento-init-params'];
83-
84-
$upgradeCommand .= ' ' . implode(" ", $this->toCliArguments(array_keys($installParams)));
81+
$upgradeCommand = 'php -f ' . BP . '/bin/magento setup:upgrade -vvv -n --magento-init-params="'
82+
. $initParams['magento-init-params'] . '"';
83+
$installParams = $this->toCliArguments($installParams);
84+
$upgradeCommand .= ' ' . implode(" ", array_keys($installParams));
8585

8686
return $this->shell->execute($upgradeCommand, array_values($installParams));
8787
}

dev/tests/setup-integration/framework/Magento/TestFramework/Deploy/ParametersHolder.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,10 @@ private function getCustomDirs()
6363
{
6464
$installDir = TESTS_TEMP_DIR;
6565
$path = DirectoryList::PATH;
66+
$var = "{$installDir}/var";
6667
$customDirs = [
6768
DirectoryList::CONFIG => [$path => "{$installDir}/etc"],
69+
DirectoryList::VAR_DIR => [$path => $var],
6870
];
6971
return $customDirs;
7072
}

dev/tests/setup-integration/testsuite/Magento/Setup/BCMultiModuleTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ public function setUp()
6262
$this->tableData = $objectManager->get(TableData::class);
6363
$this->moduleResource = $objectManager->get(ModuleResource::class);
6464
$this->dbSchemaReader = $objectManager->get(DbSchemaReaderInterface::class);
65-
6665
}
6766

6867
/**

0 commit comments

Comments
 (0)