Skip to content

Commit cf76731

Browse files
authored
Merge pull request #153 from magento-commerce/develop
MCLOUD-13940: Cloud tools August 2025 release
2 parents 0b67038 + 7f46bdf commit cf76731

File tree

5 files changed

+115
-9
lines changed

5 files changed

+115
-9
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "magento/magento-cloud-patches",
33
"description": "Provides critical fixes for Magento 2 Enterprise Edition",
44
"type": "magento2-component",
5-
"version": "1.1.9",
5+
"version": "1.1.10",
66
"license": "OSL-3.0",
77
"repositories": {
88
"repo.magento.com": {
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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\CloudPatches\Test\Functional\Acceptance;
9+
10+
/**
11+
* @group php84
12+
*/
13+
class Acceptance84Cest extends AcceptanceCest
14+
{
15+
/**
16+
* @return array
17+
*/
18+
protected function patchesDataProvider(): array
19+
{
20+
return [
21+
['templateVersion' => '2.4.8', 'magentoVersion' => '2.4.8'],
22+
];
23+
}
24+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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\CloudPatches\Test\Functional\Acceptance;
9+
10+
/**
11+
* @group php83
12+
*/
13+
class PatchApplier83Cest extends PatchApplierCest
14+
{
15+
/**
16+
* @return array
17+
*/
18+
protected function patchesDataProvider(): array
19+
{
20+
return [
21+
['templateVersion' => '2.4.7', 'magentoVersion' => '2.4.7'],
22+
];
23+
}
24+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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\CloudPatches\Test\Functional\Acceptance;
9+
10+
/**
11+
* @group php84
12+
*/
13+
class PatchApplier84Cest extends PatchApplierCest
14+
{
15+
/**
16+
* @return array
17+
*/
18+
protected function patchesDataProvider(): array
19+
{
20+
return [
21+
['templateVersion' => '2.4.8', 'magentoVersion' => '2.4.8'],
22+
];
23+
}
24+
}

src/Test/Functional/Acceptance/PatchApplierCest.php

Lines changed: 42 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,28 +10,43 @@
1010
use Magento\CloudDocker\Test\Functional\Codeception\Docker;
1111

1212
/**
13-
* @group php83
13+
* Abstract PatchApplierCest
14+
*
15+
* @abstract
1416
*/
15-
class PatchApplierCest extends AbstractCest
17+
abstract class PatchApplierCest extends AbstractCest
1618
{
1719
/**
18-
* @param \CliTester $I
20+
* Prepares the test environment before each test.
21+
*
22+
* @param \CliTester $I The CLI tester instance.
23+
* @throws \Robo\Exception\TaskException
1924
*/
2025
public function _before(\CliTester $I): void
2126
{
2227
parent::_before($I);
23-
24-
$this->prepareTemplate($I, '2.4.7');
25-
$I->copyFileToWorkDir('files/debug_logging/.magento.env.yaml', '.magento.env.yaml');
2628
}
2729

2830
/**
31+
* Tests applying an existing patch to a target file.
32+
*
2933
* @param \CliTester $I
34+
* @param \Codeception\Example $data The example data for the test.
35+
* Expected structure:
36+
* [
37+
* 'templateVersion' => string,
38+
* 'magentoVersion' => string|null (optional)
39+
* ]
3040
* @throws \Robo\Exception\TaskException
41+
* @dataProvider patchesDataProvider
3142
*/
32-
public function testApplyingPatch(\CliTester $I): void
43+
public function testApplyingPatch(\CliTester $I, \Codeception\Example $data): void
3344
{
45+
$this->prepareTemplate($I, $data['templateVersion'], $data['magentoVersion'] ?? null);
46+
3447
$I->generateDockerCompose('--mode=production');
48+
49+
$I->copyFileToWorkDir('files/debug_logging/.magento.env.yaml', '.magento.env.yaml');
3550
$I->copyFileToWorkDir('files/patches/target_file.md', 'target_file.md');
3651
$I->copyFileToWorkDir('files/patches/patch.patch', 'm2-hotfixes/patch.patch');
3752

@@ -47,12 +62,25 @@ public function testApplyingPatch(\CliTester $I): void
4762
}
4863

4964
/**
65+
* Tests that an existing patch is not applied again.
66+
*
5067
* @param \CliTester $I
68+
* @param \Codeception\Example $data The example data for the test.
69+
* Expected structure:
70+
* [
71+
* 'templateVersion' => string,
72+
* 'magentoVersion' => string|null (optional)
73+
* ]
5174
* @throws \Robo\Exception\TaskException
75+
* @dataProvider patchesDataProvider
5276
*/
53-
public function testApplyingExistingPatch(\CliTester $I): void
77+
public function testApplyingExistingPatch(\CliTester $I, \Codeception\Example $data): void
5478
{
79+
$this->prepareTemplate($I, $data['templateVersion'], $data['magentoVersion'] ?? null);
80+
5581
$I->generateDockerCompose('--mode=production');
82+
83+
$I->copyFileToWorkDir('files/debug_logging/.magento.env.yaml', '.magento.env.yaml');
5684
$I->copyFileToWorkDir('files/patches/target_file_applied_patch.md', 'target_file.md');
5785
$I->copyFileToWorkDir('files/patches/patch.patch', 'm2-hotfixes/patch.patch');
5886

@@ -68,4 +96,10 @@ public function testApplyingExistingPatch(\CliTester $I): void
6896
$I->grabFileContent('/init/var/log/cloud.log', Docker::BUILD_CONTAINER)
6997
);
7098
}
99+
100+
/**
101+
* Returns the data provider for patches.
102+
* @return array
103+
*/
104+
abstract protected function patchesDataProvider(): array;
71105
}

0 commit comments

Comments
 (0)