Skip to content

Commit 688c5fa

Browse files
authored
Merge pull request #223 from magento-commerce/ACP2E-4400
ACP2E-4400: Add support of php 8.5 in Quality Patches
2 parents b02aa38 + aa5ac27 commit 688c5fa

15 files changed

+40
-157
lines changed

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
}
1212
},
1313
"require": {
14-
"php": "^8.0",
14+
"php": "^8.1",
1515
"ext-json": "*",
1616
"magento/magento-cloud-patches": "^1.0.11"
1717
},
@@ -22,7 +22,7 @@
2222
"codeception/module-phpbrowser": "^1.0 || ^3.0",
2323
"codeception/module-rest": "^1.2 || ^3.0",
2424
"consolidation/robo": "^1.2 || ^2.0 || ^3.0",
25-
"phpunit/phpunit": "^10",
25+
"phpunit/phpunit": "^10.0 || ^12.0",
2626
"composer/semver": "@stable",
2727
"phpmd/phpmd": "@stable",
2828
"squizlabs/php_codesniffer": "^3.0"

src/Info.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class Info
2424
*
2525
* @return string
2626
*/
27-
public function getPatchesDirectory()
27+
public function getPatchesDirectory(): string
2828
{
2929
return __DIR__ . '/../patches';
3030
}
@@ -34,7 +34,7 @@ public function getPatchesDirectory()
3434
*
3535
* @return string
3636
*/
37-
public function getSupportPatchesConfig()
37+
public function getSupportPatchesConfig(): string
3838
{
3939
return __DIR__ . '/../support-patches.json';
4040
}
@@ -44,7 +44,7 @@ public function getSupportPatchesConfig()
4444
*
4545
* @return string
4646
*/
47-
public function getCommunityPatchesConfig()
47+
public function getCommunityPatchesConfig(): string
4848
{
4949
return __DIR__ . '/../community-patches.json';
5050
}
@@ -54,7 +54,7 @@ public function getCommunityPatchesConfig()
5454
*
5555
* @return string
5656
*/
57-
public function getCategoriesConfig()
57+
public function getCategoriesConfig(): string
5858
{
5959
return __DIR__ . '/../config/patch-categories.json';
6060
}
@@ -64,7 +64,7 @@ public function getCategoriesConfig()
6464
*
6565
* @return string
6666
*/
67-
public function getTestsDirectory()
67+
public function getTestsDirectory(): string
6868
{
6969
return __DIR__ . '/../tests';
7070
}

src/Test/Functional/Acceptance/AbstractCest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ public function _before(\CliTester $I): void
193193
* @param string $magentoVersion
194194
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
195195
*/
196-
protected function prepareTemplate(\CliTester $I, string $templateVersion, string $magentoVersion = null): void
196+
protected function prepareTemplate(\CliTester $I, string $templateVersion, ?string $magentoVersion = null): void
197197
{
198198
$I->cloneTemplateToWorkDir($templateVersion);
199199
$I->createAuthJson();

src/Test/Functional/Acceptance/B2Bx237Cest.php

Lines changed: 0 additions & 36 deletions
This file was deleted.

src/Test/Functional/Acceptance/B2Bx240x243Cest.php

Lines changed: 0 additions & 43 deletions
This file was deleted.

src/Test/Functional/Acceptance/B2Bx248Cest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
use Magento\QualityPatches\Test\Functional\Acceptance\AbstractCest;
1919

2020
/**
21-
* @group php83
21+
* @group php84
2222
*/
2323
class B2Bx248Cest extends AbstractCest
2424
{

src/Test/Functional/Acceptance/CEx237Cest.php renamed to src/Test/Functional/Acceptance/B2Bx249Cest.php

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,22 @@
1313
*/
1414
declare(strict_types=1);
1515

16-
namespace Magento\QualityPatches\Test\Functional\Acceptance;
16+
namespace Functional\Acceptance;
17+
18+
use Magento\QualityPatches\Test\Functional\Acceptance\AbstractCest;
1719

1820
/**
19-
* @group php74ce
21+
* @group php85
2022
*/
21-
class CEx237Cest extends B2Bx237Cest
23+
class B2Bx249Cest extends AbstractCest
2224
{
2325
/**
24-
* @var string
26+
* @return array
2527
*/
26-
protected $edition = 'CE';
28+
protected function patchesDataProvider(): array
29+
{
30+
return [
31+
['templateVersion' => '2.4.9-beta1', 'magentoVersion' => '2.4.9-alpha3'],
32+
];
33+
}
2734
}

src/Test/Functional/Acceptance/CEx240x243Cest.php

Lines changed: 0 additions & 44 deletions
This file was deleted.

src/Test/Integrity/Testsuite/CircularDependencyTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
use Magento\QualityPatches\Test\Integrity\Lib\CircularDependency;
1919
use Magento\QualityPatches\Test\Integrity\Lib\Config;
20+
use PHPUnit\Framework\Attributes\DoesNotPerformAssertions;
2021
use PHPUnit\Framework\TestCase;
2122

2223
/**
@@ -39,9 +40,8 @@ protected function setUp(): void
3940

4041
/**
4142
* Check patch configuration structure for circular dependencies.
42-
*
43-
* @doesNotPerformAssertions
4443
*/
44+
#[DoesNotPerformAssertions]
4545
public function testCircularDependencies()
4646
{
4747
$dependencies = $this->getConfigDependencies();

src/Test/Integrity/Testsuite/ConfigStructureTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
use Magento\QualityPatches\Info;
1919
use Magento\QualityPatches\Test\Integrity\Lib\Config;
20+
use PHPUnit\Framework\Attributes\DoesNotPerformAssertions;
2021
use PHPUnit\Framework\TestCase;
2122

2223
/**
@@ -87,9 +88,8 @@ protected function setUp(): void
8788

8889
/**
8990
* Validates patch configuration structure.
90-
*
91-
* @doesNotPerformAssertions
9291
*/
92+
#[DoesNotPerformAssertions]
9393
public function testConfigStructure()
9494
{
9595
try {
@@ -351,7 +351,7 @@ private function validateMetadata(array $metadata): array
351351
{
352352
$errors = [];
353353
foreach ($metadata as $key => $node) {
354-
if (in_array((string)$key, ['and', 'or'])) {
354+
if (in_array((string) $key, ['and', 'or'])) {
355355
$errors = array_merge_recursive($errors, $this->validateMetadata($node));
356356
} else {
357357
if (!isset($node['type'])) {

0 commit comments

Comments
 (0)