From e701715723998c921d49e1a637fc236a83e2004c Mon Sep 17 00:00:00 2001 From: Bohdan Korablov Date: Fri, 22 Oct 2021 11:20:14 -0500 Subject: [PATCH 1/6] ACMP-1459: Make ece-tools compatible with php 8.0/8.1 --- composer.json | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 6e61edc..1aa0f36 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,7 @@ } }, "require": { - "php": "^7.0", + "php": "^7.0 || ^8.0", "ext-json": "*", "composer/composer": "@stable", "composer/semver": "@stable", @@ -25,7 +25,11 @@ "magento/quality-patches": "^1.1.0" }, "require-dev": { - "codeception/codeception": "^2.5.3", + "codeception/codeception": "^4.1", + "codeception/module-asserts": "^1.2", + "codeception/module-db": "^1.0", + "codeception/module-phpbrowser": "^1.0", + "codeception/module-rest": "^1.2", "consolidation/robo": "^1.2", "phpmd/phpmd": "@stable", "phpunit/phpunit": "^7.2", From 14f7ef1aae7463ee3ece5d39c372bdbd4ca3a35f Mon Sep 17 00:00:00 2001 From: Bohdan Korablov Date: Thu, 28 Oct 2021 14:16:29 -0500 Subject: [PATCH 2/6] ACMP-1459: Make ece-tools compatible with php 8.0/8.1 --- composer.json | 2 +- src/Test/Unit/Command/ApplyTest.php | 2 +- src/Test/Unit/Command/Ece/ApplyTest.php | 2 +- src/Test/Unit/Command/Ece/RevertTest.php | 2 +- .../Unit/Command/Process/Action/ApplyOptionalActionTest.php | 2 +- .../Unit/Command/Process/Action/ConfirmRequiredActionTest.php | 2 +- .../Command/Process/Action/ProcessDeprecatedActionTest.php | 2 +- src/Test/Unit/Command/Process/Action/RevertActionTest.php | 2 +- .../Unit/Command/Process/Action/ReviewAppliedActionTest.php | 2 +- src/Test/Unit/Command/Process/ApplyLocalTest.php | 2 +- src/Test/Unit/Command/Process/ApplyOptionalTest.php | 2 +- src/Test/Unit/Command/Process/ApplyRequiredTest.php | 2 +- src/Test/Unit/Command/Process/Ece/ApplyOptionalTest.php | 2 +- src/Test/Unit/Command/Process/Ece/RevertTest.php | 2 +- src/Test/Unit/Command/Process/RendererTest.php | 2 +- src/Test/Unit/Command/Process/RevertTest.php | 2 +- src/Test/Unit/Command/Process/ShowStatusTest.php | 2 +- src/Test/Unit/Command/RevertTest.php | 2 +- src/Test/Unit/Command/StatusTest.php | 2 +- src/Test/Unit/Composer/MagentoVersionTest.php | 2 +- src/Test/Unit/Environment/ConfigReaderTest.php | 2 +- src/Test/Unit/Environment/ConfigTest.php | 2 +- src/Test/Unit/Filesystem/DirectoryListTest.php | 2 +- src/Test/Unit/Filesystem/FileListTest.php | 2 +- src/Test/Unit/Patch/AggregatedPatchFactoryTest.php | 2 +- src/Test/Unit/Patch/AggregatorTest.php | 2 +- src/Test/Unit/Patch/ApplierTest.php | 2 +- src/Test/Unit/Patch/Collector/CloudCollectorTest.php | 2 +- src/Test/Unit/Patch/Collector/LocalCollectorTest.php | 2 +- src/Test/Unit/Patch/Collector/QualityCollectorTest.php | 2 +- src/Test/Unit/Patch/Conflict/AnalyzerTest.php | 2 +- src/Test/Unit/Patch/Conflict/ApplyCheckerTest.php | 2 +- src/Test/Unit/Patch/Conflict/ProcessorTest.php | 2 +- src/Test/Unit/Patch/FilterFactoryTest.php | 2 +- src/Test/Unit/Patch/GitConverterTest.php | 2 +- src/Test/Unit/Patch/PatchBuilderTest.php | 2 +- src/Test/Unit/Patch/Pool/OptionalPoolTest.php | 2 +- src/Test/Unit/Patch/RevertValidatorTest.php | 2 +- src/Test/Unit/Patch/RollbackProcessorTest.php | 2 +- src/Test/Unit/Patch/SourceProviderTest.php | 2 +- src/Test/Unit/Patch/Status/LocalResolverTest.php | 2 +- src/Test/Unit/Patch/Status/OptionalResolverTest.php | 2 +- src/Test/Unit/Shell/Command/PatchDriverTest.php | 4 ++-- 43 files changed, 44 insertions(+), 44 deletions(-) diff --git a/composer.json b/composer.json index 1aa0f36..4731530 100644 --- a/composer.json +++ b/composer.json @@ -32,7 +32,7 @@ "codeception/module-rest": "^1.2", "consolidation/robo": "^1.2", "phpmd/phpmd": "@stable", - "phpunit/phpunit": "^7.2", + "phpunit/phpunit": "^7.2 || ^9.5", "squizlabs/php_codesniffer": "^3.0" }, "bin": [ diff --git a/src/Test/Unit/Command/ApplyTest.php b/src/Test/Unit/Command/ApplyTest.php index b88db0d..58e8f42 100644 --- a/src/Test/Unit/Command/ApplyTest.php +++ b/src/Test/Unit/Command/ApplyTest.php @@ -46,7 +46,7 @@ class ApplyTest extends TestCase /** * @inheritDoc */ - protected function setUp() + protected function setUp(): void { $this->applyOptional = $this->createMock(ApplyOptional::class); $this->logger = $this->getMockForAbstractClass(LoggerInterface::class); diff --git a/src/Test/Unit/Command/Ece/ApplyTest.php b/src/Test/Unit/Command/Ece/ApplyTest.php index 8b9906c..eafba6e 100644 --- a/src/Test/Unit/Command/Ece/ApplyTest.php +++ b/src/Test/Unit/Command/Ece/ApplyTest.php @@ -58,7 +58,7 @@ class ApplyTest extends TestCase /** * @inheritDoc */ - protected function setUp() + protected function setUp(): void { $this->applyLocal = $this->createMock(ApplyLocal::class); $this->applyOptionalEce = $this->createMock(ApplyOptional::class); diff --git a/src/Test/Unit/Command/Ece/RevertTest.php b/src/Test/Unit/Command/Ece/RevertTest.php index 55f9075..573ab13 100644 --- a/src/Test/Unit/Command/Ece/RevertTest.php +++ b/src/Test/Unit/Command/Ece/RevertTest.php @@ -41,7 +41,7 @@ class RevertTest extends TestCase /** * @inheritDoc */ - protected function setUp() + protected function setUp(): void { $this->revertEce = $this->createMock(RevertProcess::class); $this->logger = $this->getMockForAbstractClass(LoggerInterface::class); diff --git a/src/Test/Unit/Command/Process/Action/ApplyOptionalActionTest.php b/src/Test/Unit/Command/Process/Action/ApplyOptionalActionTest.php index c543a2d..eb0c62f 100644 --- a/src/Test/Unit/Command/Process/Action/ApplyOptionalActionTest.php +++ b/src/Test/Unit/Command/Process/Action/ApplyOptionalActionTest.php @@ -65,7 +65,7 @@ class ApplyOptionalActionTest extends TestCase /** * @inheritdoc */ - protected function setUp() + protected function setUp(): void { $this->applier = $this->createMock(Applier::class); $this->logger = $this->getMockForAbstractClass(LoggerInterface::class); diff --git a/src/Test/Unit/Command/Process/Action/ConfirmRequiredActionTest.php b/src/Test/Unit/Command/Process/Action/ConfirmRequiredActionTest.php index 1424faf..2d374ca 100644 --- a/src/Test/Unit/Command/Process/Action/ConfirmRequiredActionTest.php +++ b/src/Test/Unit/Command/Process/Action/ConfirmRequiredActionTest.php @@ -54,7 +54,7 @@ class ConfirmRequiredActionTest extends TestCase /** * @inheritdoc */ - protected function setUp() + protected function setUp(): void { $this->statusPool = $this->createMock(StatusPool::class); $this->optionalPool = $this->createMock(OptionalPool::class); diff --git a/src/Test/Unit/Command/Process/Action/ProcessDeprecatedActionTest.php b/src/Test/Unit/Command/Process/Action/ProcessDeprecatedActionTest.php index 50dd537..441a072 100644 --- a/src/Test/Unit/Command/Process/Action/ProcessDeprecatedActionTest.php +++ b/src/Test/Unit/Command/Process/Action/ProcessDeprecatedActionTest.php @@ -65,7 +65,7 @@ class ProcessDeprecatedActionTest extends TestCase /** * @inheritdoc */ - protected function setUp() + protected function setUp(): void { $this->optionalPool = $this->createMock(OptionalPool::class); $this->statusPool = $this->createMock(StatusPool::class); diff --git a/src/Test/Unit/Command/Process/Action/RevertActionTest.php b/src/Test/Unit/Command/Process/Action/RevertActionTest.php index 9ef6b34..b8f515e 100644 --- a/src/Test/Unit/Command/Process/Action/RevertActionTest.php +++ b/src/Test/Unit/Command/Process/Action/RevertActionTest.php @@ -60,7 +60,7 @@ class RevertActionTest extends TestCase /** * @inheritdoc */ - protected function setUp() + protected function setUp(): void { $this->applier = $this->createMock(Applier::class); $this->revertValidator = $this->createMock(RevertValidator::class); diff --git a/src/Test/Unit/Command/Process/Action/ReviewAppliedActionTest.php b/src/Test/Unit/Command/Process/Action/ReviewAppliedActionTest.php index c5224b3..b793c37 100644 --- a/src/Test/Unit/Command/Process/Action/ReviewAppliedActionTest.php +++ b/src/Test/Unit/Command/Process/Action/ReviewAppliedActionTest.php @@ -52,7 +52,7 @@ class ReviewAppliedActionTest extends TestCase /** * @inheritdoc */ - protected function setUp() + protected function setUp(): void { $this->logger = $this->getMockForAbstractClass(LoggerInterface::class); $this->statusPool = $this->createMock(StatusPool::class); diff --git a/src/Test/Unit/Command/Process/ApplyLocalTest.php b/src/Test/Unit/Command/Process/ApplyLocalTest.php index b9f7e85..d221269 100644 --- a/src/Test/Unit/Command/Process/ApplyLocalTest.php +++ b/src/Test/Unit/Command/Process/ApplyLocalTest.php @@ -59,7 +59,7 @@ class ApplyLocalTest extends TestCase /** * @inheritdoc */ - protected function setUp() + protected function setUp(): void { $this->applier = $this->createMock(Applier::class); $this->logger = $this->getMockForAbstractClass(LoggerInterface::class); diff --git a/src/Test/Unit/Command/Process/ApplyOptionalTest.php b/src/Test/Unit/Command/Process/ApplyOptionalTest.php index a32b68c..0b94730 100644 --- a/src/Test/Unit/Command/Process/ApplyOptionalTest.php +++ b/src/Test/Unit/Command/Process/ApplyOptionalTest.php @@ -46,7 +46,7 @@ class ApplyOptionalTest extends TestCase /** * @inheritdoc */ - protected function setUp() + protected function setUp(): void { $this->filterFactory = $this->createMock(FilterFactory::class); $this->actionPool = $this->createMock(ActionPool::class); diff --git a/src/Test/Unit/Command/Process/ApplyRequiredTest.php b/src/Test/Unit/Command/Process/ApplyRequiredTest.php index 9675f5c..45b794a 100644 --- a/src/Test/Unit/Command/Process/ApplyRequiredTest.php +++ b/src/Test/Unit/Command/Process/ApplyRequiredTest.php @@ -59,7 +59,7 @@ class ApplyRequiredTest extends TestCase /** * @inheritdoc */ - protected function setUp() + protected function setUp(): void { $this->applier = $this->createMock(Applier::class); $this->logger = $this->getMockForAbstractClass(LoggerInterface::class); diff --git a/src/Test/Unit/Command/Process/Ece/ApplyOptionalTest.php b/src/Test/Unit/Command/Process/Ece/ApplyOptionalTest.php index f269a98..4f547b8 100644 --- a/src/Test/Unit/Command/Process/Ece/ApplyOptionalTest.php +++ b/src/Test/Unit/Command/Process/Ece/ApplyOptionalTest.php @@ -51,7 +51,7 @@ class ApplyOptionalTest extends TestCase /** * @inheritdoc */ - protected function setUp() + protected function setUp(): void { $this->filterFactory = $this->createMock(FilterFactory::class); $this->actionPool = $this->createMock(ActionPool::class); diff --git a/src/Test/Unit/Command/Process/Ece/RevertTest.php b/src/Test/Unit/Command/Process/Ece/RevertTest.php index 1197ba2..cbba07a 100644 --- a/src/Test/Unit/Command/Process/Ece/RevertTest.php +++ b/src/Test/Unit/Command/Process/Ece/RevertTest.php @@ -65,7 +65,7 @@ class RevertTest extends TestCase /** * @inheritdoc */ - protected function setUp() + protected function setUp(): void { $this->revertAction = $this->createMock(RevertAction::class); $this->logger = $this->getMockForAbstractClass(LoggerInterface::class); diff --git a/src/Test/Unit/Command/Process/RendererTest.php b/src/Test/Unit/Command/Process/RendererTest.php index 6a944b4..b7b1f66 100644 --- a/src/Test/Unit/Command/Process/RendererTest.php +++ b/src/Test/Unit/Command/Process/RendererTest.php @@ -43,7 +43,7 @@ class RendererTest extends TestCase /** * @inheritdoc */ - protected function setUp() + protected function setUp(): void { /** @var StatusPool|MockObject $statusPool */ $statusPool = $this->createMock(StatusPool::class); diff --git a/src/Test/Unit/Command/Process/RevertTest.php b/src/Test/Unit/Command/Process/RevertTest.php index 37bb7a5..d2d00a4 100644 --- a/src/Test/Unit/Command/Process/RevertTest.php +++ b/src/Test/Unit/Command/Process/RevertTest.php @@ -46,7 +46,7 @@ class RevertTest extends TestCase /** * @inheritdoc */ - protected function setUp() + protected function setUp(): void { $this->filterFactory = $this->createMock(FilterFactory::class); $this->revertAction = $this->createMock(RevertAction::class); diff --git a/src/Test/Unit/Command/Process/ShowStatusTest.php b/src/Test/Unit/Command/Process/ShowStatusTest.php index 15fa3f2..bafd697 100644 --- a/src/Test/Unit/Command/Process/ShowStatusTest.php +++ b/src/Test/Unit/Command/Process/ShowStatusTest.php @@ -78,7 +78,7 @@ class ShowStatusTest extends TestCase /** * @inheritdoc */ - protected function setUp() + protected function setUp(): void { $this->aggregator = $this->createMock(Aggregator::class); $this->optionalPool = $this->createMock(OptionalPool::class); diff --git a/src/Test/Unit/Command/RevertTest.php b/src/Test/Unit/Command/RevertTest.php index f732ea8..6494abf 100644 --- a/src/Test/Unit/Command/RevertTest.php +++ b/src/Test/Unit/Command/RevertTest.php @@ -41,7 +41,7 @@ class RevertTest extends TestCase /** * @inheritDoc */ - protected function setUp() + protected function setUp(): void { $this->revert = $this->createMock(RevertProcess::class); $this->logger = $this->getMockForAbstractClass(LoggerInterface::class); diff --git a/src/Test/Unit/Command/StatusTest.php b/src/Test/Unit/Command/StatusTest.php index 31094ac..7cd7eec 100644 --- a/src/Test/Unit/Command/StatusTest.php +++ b/src/Test/Unit/Command/StatusTest.php @@ -42,7 +42,7 @@ class StatusTest extends TestCase /** * @inheritDoc */ - protected function setUp() + protected function setUp(): void { $this->showStatus = $this->createMock(ShowStatus::class); $this->logger = $this->getMockForAbstractClass(LoggerInterface::class); diff --git a/src/Test/Unit/Composer/MagentoVersionTest.php b/src/Test/Unit/Composer/MagentoVersionTest.php index 615b679..1481b7d 100644 --- a/src/Test/Unit/Composer/MagentoVersionTest.php +++ b/src/Test/Unit/Composer/MagentoVersionTest.php @@ -41,7 +41,7 @@ class MagentoVersionTest extends TestCase /** * @inheritDoc */ - protected function setUp() + protected function setUp(): void { $this->repository = $this->getMockForAbstractClass(WritableRepositoryInterface::class); $this->rootPackage = $this->getMockForAbstractClass(RootPackageInterface::class); diff --git a/src/Test/Unit/Environment/ConfigReaderTest.php b/src/Test/Unit/Environment/ConfigReaderTest.php index ddd0f5a..04ffcbf 100644 --- a/src/Test/Unit/Environment/ConfigReaderTest.php +++ b/src/Test/Unit/Environment/ConfigReaderTest.php @@ -37,7 +37,7 @@ class ConfigReaderTest extends TestCase /** * @inheritdoc */ - protected function setUp() + protected function setUp(): void { $this->fileList = $this->createMock(FileList::class); $this->filesystem = $this->createPartialMock(Filesystem::class, ['exists']); diff --git a/src/Test/Unit/Environment/ConfigTest.php b/src/Test/Unit/Environment/ConfigTest.php index 79d3329..fdc8455 100644 --- a/src/Test/Unit/Environment/ConfigTest.php +++ b/src/Test/Unit/Environment/ConfigTest.php @@ -30,7 +30,7 @@ class ConfigTest extends TestCase /** * @inheritDoc */ - protected function setUp() + protected function setUp(): void { $this->configReader = $this->createMock(ConfigReader::class); diff --git a/src/Test/Unit/Filesystem/DirectoryListTest.php b/src/Test/Unit/Filesystem/DirectoryListTest.php index c2ee383..7df929f 100644 --- a/src/Test/Unit/Filesystem/DirectoryListTest.php +++ b/src/Test/Unit/Filesystem/DirectoryListTest.php @@ -33,7 +33,7 @@ class DirectoryListTest extends TestCase /** * @inheritDoc */ - protected function setUp() + protected function setUp(): void { $this->directoryList = new DirectoryList( $this->root, diff --git a/src/Test/Unit/Filesystem/FileListTest.php b/src/Test/Unit/Filesystem/FileListTest.php index f0f019a..b8db304 100644 --- a/src/Test/Unit/Filesystem/FileListTest.php +++ b/src/Test/Unit/Filesystem/FileListTest.php @@ -29,7 +29,7 @@ class FileListTest extends TestCase /** * @inheritDoc */ - protected function setUp() + protected function setUp(): void { $this->directoryListMock = $this->createMock(DirectoryList::class); diff --git a/src/Test/Unit/Patch/AggregatedPatchFactoryTest.php b/src/Test/Unit/Patch/AggregatedPatchFactoryTest.php index fa1b856..d509f6c 100644 --- a/src/Test/Unit/Patch/AggregatedPatchFactoryTest.php +++ b/src/Test/Unit/Patch/AggregatedPatchFactoryTest.php @@ -26,7 +26,7 @@ class AggregatedPatchFactoryTest extends TestCase /** * @inheritDoc */ - protected function setUp() + protected function setUp(): void { $this->aggregatedPatchFactory = new AggregatedPatchFactory(); } diff --git a/src/Test/Unit/Patch/AggregatorTest.php b/src/Test/Unit/Patch/AggregatorTest.php index 5427dca..b438c51 100644 --- a/src/Test/Unit/Patch/AggregatorTest.php +++ b/src/Test/Unit/Patch/AggregatorTest.php @@ -31,7 +31,7 @@ class AggregatorTest extends TestCase /** * @inheritDoc */ - protected function setUp() + protected function setUp(): void { $this->aggregatedPatchFactory = $this->createMock(AggregatedPatchFactory::class); $this->aggregator = new Aggregator($this->aggregatedPatchFactory); diff --git a/src/Test/Unit/Patch/ApplierTest.php b/src/Test/Unit/Patch/ApplierTest.php index 89452b6..fa3330b 100644 --- a/src/Test/Unit/Patch/ApplierTest.php +++ b/src/Test/Unit/Patch/ApplierTest.php @@ -51,7 +51,7 @@ class ApplierTest extends TestCase /** * @inheritDoc */ - protected function setUp() + protected function setUp(): void { $this->patchCommand = $this->createMock(PatchCommandInterface::class); $this->gitConverter = $this->createMock(GitConverter::class); diff --git a/src/Test/Unit/Patch/Collector/CloudCollectorTest.php b/src/Test/Unit/Patch/Collector/CloudCollectorTest.php index b83df61..b0a3ff2 100644 --- a/src/Test/Unit/Patch/Collector/CloudCollectorTest.php +++ b/src/Test/Unit/Patch/Collector/CloudCollectorTest.php @@ -61,7 +61,7 @@ class CloudCollectorTest extends TestCase /** * @inheritDoc */ - protected function setUp() + protected function setUp(): void { $this->sourceProvider = $this->createMock(SourceProvider::class); $this->package = $this->createMock(Package::class); diff --git a/src/Test/Unit/Patch/Collector/LocalCollectorTest.php b/src/Test/Unit/Patch/Collector/LocalCollectorTest.php index 972436d..7787d08 100644 --- a/src/Test/Unit/Patch/Collector/LocalCollectorTest.php +++ b/src/Test/Unit/Patch/Collector/LocalCollectorTest.php @@ -38,7 +38,7 @@ class LocalCollectorTest extends TestCase /** * @inheritDoc */ - protected function setUp() + protected function setUp(): void { $this->patchBuilder = $this->createMock(PatchBuilder::class); $this->sourceProvider = $this->createMock(SourceProvider::class); diff --git a/src/Test/Unit/Patch/Collector/QualityCollectorTest.php b/src/Test/Unit/Patch/Collector/QualityCollectorTest.php index 19f6d67..9cf82dc 100644 --- a/src/Test/Unit/Patch/Collector/QualityCollectorTest.php +++ b/src/Test/Unit/Patch/Collector/QualityCollectorTest.php @@ -59,7 +59,7 @@ class QualityCollectorTest extends TestCase /** * @inheritDoc */ - protected function setUp() + protected function setUp(): void { $this->package = $this->createMock(Package::class); $this->qualityPackage = $this->createMock(QualityPackage::class); diff --git a/src/Test/Unit/Patch/Conflict/AnalyzerTest.php b/src/Test/Unit/Patch/Conflict/AnalyzerTest.php index d8f0bc0..b3c00ff 100644 --- a/src/Test/Unit/Patch/Conflict/AnalyzerTest.php +++ b/src/Test/Unit/Patch/Conflict/AnalyzerTest.php @@ -49,7 +49,7 @@ class AnalyzerTest extends TestCase /** * @inheritDoc */ - protected function setUp() + protected function setUp(): void { $this->optionalPool = $this->createMock(OptionalPool::class); $this->config = $this->createMock(Config::class); diff --git a/src/Test/Unit/Patch/Conflict/ApplyCheckerTest.php b/src/Test/Unit/Patch/Conflict/ApplyCheckerTest.php index f59d651..fcbecae 100644 --- a/src/Test/Unit/Patch/Conflict/ApplyCheckerTest.php +++ b/src/Test/Unit/Patch/Conflict/ApplyCheckerTest.php @@ -43,7 +43,7 @@ class ApplyCheckerTest extends TestCase /** * @inheritDoc */ - protected function setUp() + protected function setUp(): void { $this->optionalPool = $this->createMock(OptionalPool::class); $this->filesystem = $this->createMock(Filesystem::class); diff --git a/src/Test/Unit/Patch/Conflict/ProcessorTest.php b/src/Test/Unit/Patch/Conflict/ProcessorTest.php index c37631f..20dacd0 100644 --- a/src/Test/Unit/Patch/Conflict/ProcessorTest.php +++ b/src/Test/Unit/Patch/Conflict/ProcessorTest.php @@ -51,7 +51,7 @@ class ProcessorTest extends TestCase /** * @inheritDoc */ - protected function setUp() + protected function setUp(): void { $this->renderer = $this->createMock(Renderer::class); $this->logger = $this->getMockForAbstractClass(LoggerInterface::class); diff --git a/src/Test/Unit/Patch/FilterFactoryTest.php b/src/Test/Unit/Patch/FilterFactoryTest.php index db9f2bd..dbe63fe 100644 --- a/src/Test/Unit/Patch/FilterFactoryTest.php +++ b/src/Test/Unit/Patch/FilterFactoryTest.php @@ -23,7 +23,7 @@ class FilterFactoryTest extends TestCase /** * @inheritDoc */ - protected function setUp() + protected function setUp(): void { $this->filterFactory = new FilterFactory(); } diff --git a/src/Test/Unit/Patch/GitConverterTest.php b/src/Test/Unit/Patch/GitConverterTest.php index a250edf..bbeeda5 100644 --- a/src/Test/Unit/Patch/GitConverterTest.php +++ b/src/Test/Unit/Patch/GitConverterTest.php @@ -23,7 +23,7 @@ class GitConverterTest extends TestCase /** * @inheritDoc */ - protected function setUp() + protected function setUp(): void { $this->gitConverter = new GitConverter(); } diff --git a/src/Test/Unit/Patch/PatchBuilderTest.php b/src/Test/Unit/Patch/PatchBuilderTest.php index de7abbe..908f88d 100644 --- a/src/Test/Unit/Patch/PatchBuilderTest.php +++ b/src/Test/Unit/Patch/PatchBuilderTest.php @@ -35,7 +35,7 @@ class PatchBuilderTest extends TestCase /** * @inheritDoc */ - protected function setUp() + protected function setUp(): void { $this->filesystem = $this->createMock(Filesystem::class); diff --git a/src/Test/Unit/Patch/Pool/OptionalPoolTest.php b/src/Test/Unit/Patch/Pool/OptionalPoolTest.php index 6137097..9796426 100644 --- a/src/Test/Unit/Patch/Pool/OptionalPoolTest.php +++ b/src/Test/Unit/Patch/Pool/OptionalPoolTest.php @@ -37,7 +37,7 @@ class OptionalPoolTest extends TestCase /** * @inheritDoc */ - protected function setUp() + protected function setUp(): void { $this->cloudCollector = $this->createMock(CloudCollector::class); $this->qualityCollector = $this->createMock(SupportCollector::class); diff --git a/src/Test/Unit/Patch/RevertValidatorTest.php b/src/Test/Unit/Patch/RevertValidatorTest.php index f39dc7f..7c2e6ec 100644 --- a/src/Test/Unit/Patch/RevertValidatorTest.php +++ b/src/Test/Unit/Patch/RevertValidatorTest.php @@ -37,7 +37,7 @@ class RevertValidatorTest extends TestCase /** * @inheritDoc */ - protected function setUp() + protected function setUp(): void { $this->optionalPool = $this->createMock(OptionalPool::class); $this->statusPool = $this->createMock(StatusPool::class); diff --git a/src/Test/Unit/Patch/RollbackProcessorTest.php b/src/Test/Unit/Patch/RollbackProcessorTest.php index 60a8cfd..7b185b4 100644 --- a/src/Test/Unit/Patch/RollbackProcessorTest.php +++ b/src/Test/Unit/Patch/RollbackProcessorTest.php @@ -37,7 +37,7 @@ class RollbackProcessorTest extends TestCase /** * @inheritDoc */ - protected function setUp() + protected function setUp(): void { $this->applier = $this->createMock(Applier::class); $this->logger = $this->getMockForAbstractClass(LoggerInterface::class); diff --git a/src/Test/Unit/Patch/SourceProviderTest.php b/src/Test/Unit/Patch/SourceProviderTest.php index 15f065a..f4de6d1 100644 --- a/src/Test/Unit/Patch/SourceProviderTest.php +++ b/src/Test/Unit/Patch/SourceProviderTest.php @@ -51,7 +51,7 @@ class SourceProviderTest extends TestCase /** * @inheritDoc */ - protected function setUp() + protected function setUp(): void { $this->filelist = $this->createMock(FileList::class); $this->directoryList = $this->createMock(DirectoryList::class); diff --git a/src/Test/Unit/Patch/Status/LocalResolverTest.php b/src/Test/Unit/Patch/Status/LocalResolverTest.php index cf0c824..3dabaa7 100644 --- a/src/Test/Unit/Patch/Status/LocalResolverTest.php +++ b/src/Test/Unit/Patch/Status/LocalResolverTest.php @@ -47,7 +47,7 @@ class LocalResolverTest extends TestCase /** * @inheritDoc */ - protected function setUp() + protected function setUp(): void { $this->filesystem = $this->createMock(Filesystem::class); $this->applier = $this->createMock(Applier::class); diff --git a/src/Test/Unit/Patch/Status/OptionalResolverTest.php b/src/Test/Unit/Patch/Status/OptionalResolverTest.php index 9789bd2..a8902b4 100644 --- a/src/Test/Unit/Patch/Status/OptionalResolverTest.php +++ b/src/Test/Unit/Patch/Status/OptionalResolverTest.php @@ -54,7 +54,7 @@ class OptionalResolverTest extends TestCase /** * @inheritDoc */ - protected function setUp() + protected function setUp(): void { $this->filesystem = $this->createMock(Filesystem::class); $this->applier = $this->createMock(Applier::class); diff --git a/src/Test/Unit/Shell/Command/PatchDriverTest.php b/src/Test/Unit/Shell/Command/PatchDriverTest.php index d1462d5..02ac4ae 100644 --- a/src/Test/Unit/Shell/Command/PatchDriverTest.php +++ b/src/Test/Unit/Shell/Command/PatchDriverTest.php @@ -34,7 +34,7 @@ class PatchDriverTest extends TestCase /** * @inheritDoc */ - protected function setUp() + protected function setUp(): void { $this->baseDir = dirname(__DIR__, 5) . '/tests/unit/'; $this->cwd = $this->baseDir . 'var/'; @@ -58,7 +58,7 @@ function (array $cmd, string $input = null) { /** * @inheritDoc */ - protected function tearDown() + protected function tearDown(): void { foreach (glob($this->cwd . '*') as $file) { if (is_file($file)) { From 4c7cc3cdbd50ab5774b184aae2194f53e7aaadbe Mon Sep 17 00:00:00 2001 From: Bohdan Korablov Date: Wed, 10 Nov 2021 11:16:15 -0600 Subject: [PATCH 3/6] ACMP-1459: Make ece-tools compatible with php 8.0/8.1 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 4731530..2fc90c5 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "magento/magento-cloud-patches", "description": "Provides critical fixes for Magento 2 Enterprise Edition", "type": "magento2-component", - "version": "1.0.13", + "version": "1.0.14", "license": "OSL-3.0", "repositories": { "repo.magento.com": { From 0cae24f721b0b657d142dd3012ab392e57616253 Mon Sep 17 00:00:00 2001 From: Bohdan Korablov Date: Wed, 12 Jan 2022 11:14:00 -0600 Subject: [PATCH 4/6] ACMP-1459: Make ece-tools compatible with php 8.0/8.1 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 2fc90c5..97c3d02 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,7 @@ } }, "require": { - "php": "^7.0 || ^8.0", + "php": "^7.2 || ^8.0", "ext-json": "*", "composer/composer": "@stable", "composer/semver": "@stable", From 1c6e7948a5dc764a850d2a73c0a0903f38b45ecf Mon Sep 17 00:00:00 2001 From: Bohdan Korablov Date: Fri, 11 Feb 2022 18:01:38 -0600 Subject: [PATCH 5/6] ACMP-1459: Make ece-tools compatible with php 8.0/8.1 --- composer.json | 2 +- .../Functional/Acceptance/AbstractCest.php | 28 ++++++++-------- .../Acceptance/Acceptance74CeCest.php | 19 +++++++++++ .../Acceptance/Acceptance74Cest.php | 32 +++++++++++++++++++ .../Acceptance/AcceptanceCeCest.php | 2 +- .../Functional/Acceptance/AcceptanceCest.php | 13 ++------ .../Acceptance/PatchApplierCest.php | 4 +-- 7 files changed, 70 insertions(+), 30 deletions(-) create mode 100644 src/Test/Functional/Acceptance/Acceptance74CeCest.php create mode 100644 src/Test/Functional/Acceptance/Acceptance74Cest.php diff --git a/composer.json b/composer.json index 97c3d02..c58b708 100644 --- a/composer.json +++ b/composer.json @@ -32,7 +32,7 @@ "codeception/module-rest": "^1.2", "consolidation/robo": "^1.2", "phpmd/phpmd": "@stable", - "phpunit/phpunit": "^7.2 || ^9.5", + "phpunit/phpunit": "^8.5 || ^9.5", "squizlabs/php_codesniffer": "^3.0" }, "bin": [ diff --git a/src/Test/Functional/Acceptance/AbstractCest.php b/src/Test/Functional/Acceptance/AbstractCest.php index e893f87..d3374bb 100644 --- a/src/Test/Functional/Acceptance/AbstractCest.php +++ b/src/Test/Functional/Acceptance/AbstractCest.php @@ -37,28 +37,26 @@ protected function prepareTemplate(\CliTester $I, string $templateVersion, strin $I->createArtifactsDir(); $I->createArtifactCurrentTestedCode('patches', '1.0.99'); $I->addArtifactsRepoToComposer(); + $I->addDependencyToComposer('magento/magento-cloud-patches', '1.0.99'); + $I->addEceDockerGitRepoToComposer(); $I->addQualityPatchesGitRepoToComposer(); $I->addEceToolsGitRepoToComposer(); $I->addCloudComponentsGitRepoToComposer(); - $I->addDependencyToComposer('magento/magento-cloud-patches', '1.0.99'); - $I->addDependencyToComposer( - 'magento/magento-cloud-docker', - $I->getDependencyVersion('magento/magento-cloud-docker') - ); - $I->addDependencyToComposer( - 'magento/quality-patches', - $I->getDependencyVersion('magento/quality-patches') - ); - $I->addDependencyToComposer( + $dependencies = [ + 'magento/magento-cloud-docker', 'magento/magento-cloud-components', - $I->getDependencyVersion('magento/magento-cloud-components') - ); - $I->addDependencyToComposer( + 'magento/quality-patches', 'magento/ece-tools', - $I->getDependencyVersion('magento/ece-tools') - ); + ]; + + foreach ($dependencies as $dependency) { + $I->assertTrue( + $I->addDependencyToComposer($dependency, $I->getDependencyVersion($dependency)), + 'Can not add dependency ' . $dependency + ); + } if ($this->edition === 'CE' || $magentoVersion) { $version = $magentoVersion ?: $this->getVersionRangeForMagento($I); diff --git a/src/Test/Functional/Acceptance/Acceptance74CeCest.php b/src/Test/Functional/Acceptance/Acceptance74CeCest.php new file mode 100644 index 0000000..48751af --- /dev/null +++ b/src/Test/Functional/Acceptance/Acceptance74CeCest.php @@ -0,0 +1,19 @@ + '2.4.0', 'magentoVersion' => '2.4.0'], + ['templateVersion' => '2.4.0', 'magentoVersion' => '2.4.0-p1'], + ['templateVersion' => '2.4.1', 'magentoVersion' => '2.4.1'], + ['templateVersion' => '2.4.1', 'magentoVersion' => '2.4.1-p1'], + ['templateVersion' => '2.4.2', 'magentoVersion' => '2.4.2'], + ['templateVersion' => '2.4.2', 'magentoVersion' => '2.4.2-p1'], + ['templateVersion' => '2.4.2', 'magentoVersion' => '2.4.2-p2'], + ['templateVersion' => '2.4.3', 'magentoVersion' => '2.4.3'], + ['templateVersion' => '2.4.3', 'magentoVersion' => '2.4.3-p1'], + ]; + } +} diff --git a/src/Test/Functional/Acceptance/AcceptanceCeCest.php b/src/Test/Functional/Acceptance/AcceptanceCeCest.php index dd234d4..c3d98f2 100644 --- a/src/Test/Functional/Acceptance/AcceptanceCeCest.php +++ b/src/Test/Functional/Acceptance/AcceptanceCeCest.php @@ -8,7 +8,7 @@ namespace Magento\CloudPatches\Test\Functional\Acceptance; /** - * @group php74ce + * @group php81ce */ class AcceptanceCeCest extends AcceptanceCest { diff --git a/src/Test/Functional/Acceptance/AcceptanceCest.php b/src/Test/Functional/Acceptance/AcceptanceCest.php index 5093808..5728a52 100644 --- a/src/Test/Functional/Acceptance/AcceptanceCest.php +++ b/src/Test/Functional/Acceptance/AcceptanceCest.php @@ -8,7 +8,7 @@ namespace Magento\CloudPatches\Test\Functional\Acceptance; /** - * @group php74 + * @group php81 */ class AcceptanceCest extends AbstractCest { @@ -49,16 +49,7 @@ public function testPatches(\CliTester $I, \Codeception\Example $data): void protected function patchesDataProvider(): array { return [ - ['templateVersion' => '2.4.0', 'magentoVersion' => '2.4.0'], - ['templateVersion' => '2.4.0', 'magentoVersion' => '2.4.0-p1'], - ['templateVersion' => '2.4.1', 'magentoVersion' => '2.4.1'], - ['templateVersion' => '2.4.1', 'magentoVersion' => '2.4.1-p1'], - ['templateVersion' => '2.4.2', 'magentoVersion' => '2.4.2'], - ['templateVersion' => '2.4.2', 'magentoVersion' => '2.4.2-p1'], - ['templateVersion' => '2.4.2', 'magentoVersion' => '2.4.2-p2'], - ['templateVersion' => '2.4.3', 'magentoVersion' => '2.4.3'], - ['templateVersion' => '2.4.3', 'magentoVersion' => '2.4.3-p1'], - ['templateVersion' => 'master'], + ['templateVersion' => '2.4.4'], ]; } } diff --git a/src/Test/Functional/Acceptance/PatchApplierCest.php b/src/Test/Functional/Acceptance/PatchApplierCest.php index d3c7b68..e6343c9 100644 --- a/src/Test/Functional/Acceptance/PatchApplierCest.php +++ b/src/Test/Functional/Acceptance/PatchApplierCest.php @@ -10,7 +10,7 @@ use Magento\CloudDocker\Test\Functional\Codeception\Docker; /** - * @group php74 + * @group php81 */ class PatchApplierCest extends AbstractCest { @@ -21,7 +21,7 @@ public function _before(\CliTester $I): void { parent::_before($I); - $this->prepareTemplate($I, 'master'); + $this->prepareTemplate($I, '2.4.4'); $I->copyFileToWorkDir('files/debug_logging/.magento.env.yaml', '.magento.env.yaml'); } From f069b94301c46c7e0cec45410512d195eaef45dc Mon Sep 17 00:00:00 2001 From: Bohdan Korablov Date: Mon, 14 Feb 2022 10:01:34 -0600 Subject: [PATCH 6/6] Bump version --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index c58b708..92c2ff7 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "magento/magento-cloud-patches", "description": "Provides critical fixes for Magento 2 Enterprise Edition", "type": "magento2-component", - "version": "1.0.14", + "version": "1.0.15", "license": "OSL-3.0", "repositories": { "repo.magento.com": {