Skip to content

Commit 1de0137

Browse files
authored
MCLOUD-6634: Add Magento 2.4.0 and PHP 7.4 support for FT magento-cloud-components (#38)
1 parent 6ca70e3 commit 1de0137

File tree

5 files changed

+58
-19
lines changed

5 files changed

+58
-19
lines changed

.travis.yml

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,6 @@ services:
1111
- docker
1212

1313
language: php
14-
php:
15-
- '7.1'
16-
- '7.2'
17-
- '7.3'
18-
19-
env:
20-
- TEST_SUITE=functional
2114

2215
stages:
2316
- static-unit
@@ -38,6 +31,21 @@ jobs:
3831
php: '7.3'
3932
env:
4033
- TEST_SUITE=static-unit
34+
- stage: test
35+
php: '7.1'
36+
env:
37+
- TEST_SUITE=functional
38+
- php: '7.2'
39+
env:
40+
- TEST_SUITE=functional
41+
- php: '7.3'
42+
env:
43+
- TEST_SUITE=functional
44+
- php: '7.4'
45+
dist: bionic
46+
env:
47+
- TEST_SUITE=functional
48+
4149

4250
install:
4351
- composer config github-oauth.github.com ${GITHUB_TOKEN}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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\CloudComponents\Test\Functional\Acceptance;
9+
10+
/**
11+
* @group php73
12+
*/
13+
class Acceptance73Cest extends AcceptanceCest
14+
{
15+
/**
16+
* @return array
17+
*/
18+
protected function patchesDataProvider(): array
19+
{
20+
return [
21+
['magentoVersion' => '2.3.3'],
22+
['magentoVersion' => '2.3.5'],
23+
];
24+
}
25+
}

Test/Functional/Acceptance/AcceptanceCest.php

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
namespace Magento\CloudComponents\Test\Functional\Acceptance;
99

1010
/**
11-
* @group php73
11+
* @group php74
1212
*/
1313
class AcceptanceCest
1414
{
@@ -49,7 +49,7 @@ protected function prepareTemplate(\CliTester $I, string $magentoVersion): void
4949
public function testPatches(\CliTester $I, \Codeception\Example $data): void
5050
{
5151
$this->prepareTemplate($I, $data['magentoVersion']);
52-
$this->removeESIfExists($I);
52+
$this->removeESIfExists($I, $data['magentoVersion']);
5353
$I->runEceDockerCommand('build:compose --mode=production');
5454
$I->runDockerComposeCommand('run build cloud-build');
5555
$I->startEnvironment();
@@ -62,18 +62,21 @@ public function testPatches(\CliTester $I, \Codeception\Example $data): void
6262

6363
/**
6464
* @param \CliTester $I
65+
* @param string $magentoVersion
6566
*/
66-
protected function removeESIfExists(\CliTester $I): void
67+
protected function removeESIfExists(\CliTester $I, string $magentoVersion): void
6768
{
68-
$services = $I->readServicesYaml();
69+
if ($magentoVersion !== 'master' && version_compare($magentoVersion, '2.4.0', '<')) {
70+
$services = $I->readServicesYaml();
6971

70-
if (isset($services['elasticsearch'])) {
71-
unset($services['elasticsearch']);
72-
$I->writeServicesYaml($services);
72+
if (isset($services['elasticsearch'])) {
73+
unset($services['elasticsearch']);
74+
$I->writeServicesYaml($services);
7375

74-
$app = $I->readAppMagentoYaml();
75-
unset($app['relationships']['elasticsearch']);
76-
$I->writeAppMagentoYaml($app);
76+
$app = $I->readAppMagentoYaml();
77+
unset($app['relationships']['elasticsearch']);
78+
$I->writeAppMagentoYaml($app);
79+
}
7780
}
7881
}
7982

@@ -83,7 +86,7 @@ protected function removeESIfExists(\CliTester $I): void
8386
protected function patchesDataProvider(): array
8487
{
8588
return [
86-
['magentoVersion' => '2.3.3'],
89+
['magentoVersion' => '2.4.0'],
8790
['magentoVersion' => 'master'],
8891
];
8992
}

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"consolidation/robo": "^1.2",
2020
"phpmd/phpmd": "@stable",
2121
"phpstan/phpstan": "^0.11",
22-
"phpunit/phpunit": "^6.2",
22+
"phpunit/phpunit": "^7.2",
2323
"squizlabs/php_codesniffer": "^3.0"
2424
},
2525
"config": {

tests/travis/functional.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,7 @@ case $TRAVIS_PHP_VERSION in
1616
7.3)
1717
./vendor/bin/codecept run -g php73 --steps
1818
;;
19+
7.4)
20+
./vendor/bin/codecept run -g php74 --steps
21+
;;
1922
esac

0 commit comments

Comments
 (0)