Skip to content

Commit 579df76

Browse files
authored
Merge pull request #132 from magento-commerce/MCLOUD-11526
MCLOUD-11526: Added Support for PHP 8.3
2 parents aec6b4b + d14a1a9 commit 579df76

40 files changed

+770
-67
lines changed

composer.json

Lines changed: 19 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -15,34 +15,34 @@
1515
"ext-PDO": "*",
1616
"ext-json": "*",
1717
"ext-sockets": "*",
18-
"colinmollenhour/credis": "^1.6.0",
19-
"composer/composer": "^1.4 || ^2.0",
18+
"colinmollenhour/credis": "^1.6.0 || ^1.13",
19+
"composer/composer": "^1.4 || ^2.0 || !=2.2.16",
2020
"composer/semver": "@stable",
21-
"graylog2/gelf-php": "^1.4.2",
22-
"guzzlehttp/guzzle": "^6.3||^7.3",
21+
"graylog2/gelf-php": "^1.4.2 || ^2.0.1",
22+
"guzzlehttp/guzzle": "^6.3||^7.3 || ^7.5",
2323
"illuminate/config": "^5.5||^8.77",
2424
"magento/magento-cloud-components": "^1.0.8",
2525
"magento/magento-cloud-docker": "^1.0.0",
2626
"magento/magento-cloud-patches": "^1.0.20",
2727
"magento/quality-patches": "^1.1.0",
28-
"monolog/monolog": "^1.25 || ^2.3",
28+
"monolog/monolog": "^1.25 || ^2.3 || ^2.7",
2929
"nesbot/carbon": "^1.0 || ^2.0",
3030
"psr/container": "^1.0",
31-
"psr/log": "^1.0",
32-
"symfony/config": "^4.4 || ^5.1",
33-
"symfony/console": "^2.8 || ^4.0 || ^5.1",
34-
"symfony/dependency-injection": "^3.3 || ^4.3 || ^5.1",
35-
"symfony/process": "^2.1 || ^4.1 || ^5.1",
36-
"symfony/serializer": "^2.8 || ^3.3 || ^4.0",
37-
"symfony/yaml": "^3.3 || ^4.0 || ^5.1"
31+
"psr/log": "^1.0 || ^2.0 || ^3.0",
32+
"symfony/config": "^4.4 || ^5.1 || ^5.4 || ^6.4",
33+
"symfony/console": "^2.8 || ^4.0 || ^5.1 || ^5.4 || ^6.4",
34+
"symfony/dependency-injection": "^3.3 || ^4.3 || ^5.1 || ^5.4 || ^6.4",
35+
"symfony/process": "^2.1 || ^4.1 || ^5.1 || ^5.4 || ^6.4",
36+
"symfony/serializer": "^2.8 || ^3.3 || ^4.0 || ^5.4 || ^6.4",
37+
"symfony/yaml": "^3.3 || ^4.0 || ^5.1 || ^5.4 || ^6.4"
3838
},
3939
"require-dev": {
40-
"codeception/codeception": "^4.1",
41-
"codeception/module-asserts": "^1.2",
42-
"codeception/module-db": "^1.0",
43-
"codeception/module-phpbrowser": "^1.0",
44-
"codeception/module-rest": "^1.2",
45-
"consolidation/robo": "^1.2",
40+
"codeception/codeception": "^5.1",
41+
"codeception/module-asserts": "^1.2 || ^3.0",
42+
"codeception/module-db": "^1.0 || ^3.0",
43+
"codeception/module-phpbrowser": "^1.0 || ^3.0",
44+
"codeception/module-rest": "^1.2 || ^3.0",
45+
"consolidation/robo": "^1.2 || ^3.0",
4646
"php-mock/php-mock-phpunit": "^2.0",
4747
"phpmd/phpmd": "@stable",
4848
"phpstan/phpstan": "^0.12",
@@ -100,10 +100,5 @@
100100
"funkjedi/composer-include-files": true
101101
}
102102
},
103-
"prefer-stable": true,
104-
"extra": {
105-
"include_files": [
106-
"vendor/codeception/phpunit-wrapper/src/phpunit7-interfaces.php"
107-
]
108-
}
103+
"prefer-stable": true
109104
}

src/Application.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function getContainer(): ContainerInterface
4848
/**
4949
* @inheritdoc
5050
*/
51-
protected function getDefaultCommands()
51+
protected function getDefaultCommands(): array
5252
{
5353
return array_merge(parent::getDefaultCommands(), [
5454
$this->container->create(Command\Build::class),
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Functional\Acceptance;
9+
10+
use CliTester;
11+
use Magento\MagentoCloud\Test\Functional\Acceptance\AcceptanceCest;
12+
use Robo\Exception\TaskException;
13+
use Codeception\Example;
14+
use Magento\CloudDocker\Test\Functional\Codeception\Docker;
15+
16+
/**
17+
* @inheritDoc
18+
*
19+
* @group php82
20+
*/
21+
class Acceptance82Cest extends AcceptanceCest
22+
{
23+
/**
24+
* @var string
25+
*/
26+
protected $magentoCloudTemplate = '2.4.6';
27+
}

src/Test/Functional/Acceptance/AcceptanceCest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@
2020
* 3. Test config dump
2121
* 4. Test content presence
2222
*
23-
* @group php82
23+
* @group php83
2424
*/
2525
class AcceptanceCest extends AbstractCest
2626
{
2727
/**
2828
* @var string
2929
*/
30-
protected $magentoCloudTemplate = '2.4.6';
30+
protected $magentoCloudTemplate = '2.4.7-beta-test';
3131

3232
/**
3333
* @param CliTester $I
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\MagentoCloud\Test\Functional\Acceptance;
9+
10+
/**
11+
* This test runs on the latest version of PHP
12+
* @group php82
13+
*/
14+
class AdminCredential82Cest extends AdminCredentialCest
15+
{
16+
/**
17+
* @var string
18+
*/
19+
protected $magentoCloudTemplate = '2.4.6';
20+
}

src/Test/Functional/Acceptance/AdminCredentialCest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99

1010
/**
1111
* This test runs on the latest version of PHP
12-
* @group php82
12+
* @group php83
1313
*/
1414
class AdminCredentialCest extends AbstractCest
1515
{
1616
/**
1717
* @var string
1818
*/
19-
protected $magentoCloudTemplate = '2.4.6';
19+
protected $magentoCloudTemplate = '2.4.7-beta-test';
2020

2121
/**
2222
* @param \CliTester $I
Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\MagentoCloud\Test\Functional\Acceptance;
9+
10+
use CliTester;
11+
use Codeception\Example;
12+
use Exception;
13+
use Robo\Exception\TaskException;
14+
15+
/**
16+
* Checks database backup functionality
17+
* @group php82
18+
*/
19+
class BackupDbCest extends AbstractCest
20+
{
21+
/**
22+
* @var array
23+
*/
24+
private $expectedLogs = [
25+
'INFO: Starting backup.',
26+
'NOTICE: Enabling Maintenance mode',
27+
'INFO: Trying to kill running cron jobs and consumers processes',
28+
'INFO: Running Magento cron and consumers processes were not found.',
29+
'INFO: Waiting for lock on db dump.',
30+
'NOTICE: Maintenance mode is disabled.',
31+
'INFO: Backup completed.'
32+
];
33+
34+
/**
35+
* @var array
36+
*/
37+
private $envMagento = ['stage' => ['global' => ['SCD_ON_DEMAND' => true]]];
38+
39+
/**
40+
* {@inheritDoc}
41+
* @param CliTester $I
42+
*/
43+
public function _before(CliTester $I): void
44+
{
45+
// Do nothing
46+
}
47+
48+
/**
49+
* @param CliTester $I
50+
* @param Example $data
51+
* @throws Exception
52+
* @dataProvider dataProviderMagentoCloudVersions
53+
*/
54+
public function testBackUpDb(CliTester $I, Example $data): void
55+
{
56+
57+
$this->prepareWorkplace($I, $data['version']);
58+
59+
// Part of test without 'SplitDB' architecture
60+
$this->partRunDbDumpWithoutSplitDbArch($I);
61+
62+
$I->stopEnvironment(true);
63+
}
64+
65+
/**
66+
* @return array
67+
*/
68+
protected function dataProviderMagentoCloudVersions(): array
69+
{
70+
return [
71+
['version' => '2.4.6'],
72+
];
73+
}
74+
75+
/**
76+
* Part of test without 'SplitDB' architecture
77+
*
78+
* @param CliTester $I
79+
* @throws TaskException
80+
*/
81+
private function partRunDbDumpWithoutSplitDbArch(CliTester $I)
82+
{
83+
$I->writeEnvMagentoYaml($this->envMagento);
84+
$I->generateDockerCompose('--mode=production');
85+
86+
// Running database dump command with invalid database label
87+
$I->runDockerComposeCommand('run build cloud-build');
88+
89+
// Restore app/etc after build phase
90+
$I->runDockerComposeCommand('run build bash -c "cp -r /app/init/app/etc /app/app"');
91+
92+
$I->runDockerComposeCommand('run deploy ece-command db-dump incorrectName');
93+
$I->seeInOutput(
94+
'CRITICAL: Incorrect the database names: [ incorrectName ].'
95+
. ' Available database names: [ main quote sales ]'
96+
);
97+
98+
// Running database dump command with unavailable database label
99+
$I->runDockerComposeCommand('run deploy cloud-deploy');
100+
101+
$I->runDockerComposeCommand('run deploy ece-command db-dump -n quote');
102+
$I->seeInOutput(
103+
'CRITICAL: Environment does not have connection `checkout` associated with database `quote`'
104+
);
105+
106+
$I->runDockerComposeCommand('run deploy ece-command db-dump -n sales');
107+
$I->seeInOutput(
108+
'CRITICAL: Environment does not have connection `sales` associated with database `sales`'
109+
);
110+
111+
$I->runDockerComposeCommand('run deploy ece-command db-dump -n quote sales');
112+
$I->seeInOutput(
113+
'CRITICAL: Environment does not have connection `checkout` associated with database `quote`'
114+
);
115+
116+
// Running database dump command without database label (by default)
117+
$I->runDockerComposeCommand('run deploy ece-command db-dump -n');
118+
$I->seeInOutput(array_merge(
119+
$this->expectedLogs,
120+
[
121+
'INFO: Start creation DB dump for main database...',
122+
'INFO: Finished DB dump for main database, it can be found here: /app/var/dump-main',
123+
]
124+
));
125+
$I->doNotSeeInOutput(['quote', 'sales']);
126+
}
127+
}

src/Test/Functional/Acceptance/BackupDbCest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
/**
1616
* Checks database backup functionality
17-
* @group php82
17+
* @group php83
1818
*/
1919
class BackupDbCest extends AbstractCest
2020
{
@@ -68,7 +68,7 @@ public function testBackUpDb(CliTester $I, Example $data): void
6868
protected function dataProviderMagentoCloudVersions(): array
6969
{
7070
return [
71-
['version' => '2.4.6'],
71+
['version' => '2.4.7-beta-test'],
7272
];
7373
}
7474

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\MagentoCloud\Test\Functional\Acceptance;
9+
10+
/**
11+
* This test runs on the latest version of PHP
12+
*
13+
* @group php82
14+
*/
15+
class Cron82Cest extends CronCest
16+
{
17+
/**
18+
* @return array
19+
*/
20+
protected function cronDataProvider(): array
21+
{
22+
return [
23+
[
24+
'version' => '2.4.6',
25+
'variables' => [
26+
'MAGENTO_CLOUD_VARIABLES' => [
27+
'ADMIN_EMAIL' => 'admin@example.com',
28+
'ADMIN_LOCALE' => 'fr_FR'
29+
],
30+
],
31+
],
32+
];
33+
}
34+
}

src/Test/Functional/Acceptance/CronCest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
/**
1111
* This test runs on the latest version of PHP
1212
*
13-
* @group php82
13+
* @group php83
1414
*/
1515
class CronCest extends AbstractCest
1616
{
@@ -138,7 +138,7 @@ protected function cronDataProvider(): array
138138
{
139139
return [
140140
[
141-
'version' => '2.4.6',
141+
'version' => '2.4.7-beta-test',
142142
'variables' => [
143143
'MAGENTO_CLOUD_VARIABLES' => [
144144
'ADMIN_EMAIL' => 'admin@example.com',
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\MagentoCloud\Test\Functional\Acceptance;
9+
10+
/**
11+
* Test for cron:unlock.
12+
*
13+
* @group php82
14+
*/
15+
class CronUnlock82Cest extends CronUnlockCest
16+
{
17+
/**
18+
* @var string
19+
*/
20+
protected $magentoCloudTemplate = '2.4.6';
21+
}

src/Test/Functional/Acceptance/CronUnlockCest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@
1010
/**
1111
* Test for cron:unlock.
1212
*
13-
* @group php82
13+
* @group php83
1414
*/
1515
class CronUnlockCest extends AbstractCest
1616
{
1717
/**
1818
* @var string
1919
*/
20-
protected $magentoCloudTemplate = '2.4.6';
20+
protected $magentoCloudTemplate = '2.4.7-beta-test';
2121

2222
/**
2323
* @param \CliTester $I

0 commit comments

Comments
 (0)