diff --git a/.github/.metadata.json b/.github/.metadata.json new file mode 100644 index 0000000..b00139a --- /dev/null +++ b/.github/.metadata.json @@ -0,0 +1,26 @@ +{ + "templateVersion": "0.1", + "product": { + "name": "Magento Cloud Components", + "description": "The Magento Cloud Components module extends Magento Commerce core functionality for sites deployed on the Cloud platform. This module contains cloud-specific functionality for use with the ece-tools package." + }, + "contacts": { + "team": { + "name": "Magic Mountain", + "DL": "Grp-magento-cloud-all", + "slackChannel": "magic_mountain" + } + }, + "ticketTracker": { + "functionalJiraQueue": { + "projectKey": "MCLOUD" + }, + "securityJiraQueue": { + "projectKey": "MAGREQ", + "component": "Magento Cloud Engineering" + } + }, + "staticScan": { + "enable": false + } +} diff --git a/Console/Command/CacheEvict.php b/Console/Command/CacheEvict.php index 1db4911..882a232 100644 --- a/Console/Command/CacheEvict.php +++ b/Console/Command/CacheEvict.php @@ -43,7 +43,7 @@ protected function configure() /** * @inheritDoc */ - public function execute(InputInterface $input, OutputInterface $output) + public function execute(InputInterface $input, OutputInterface $output): void { $output->writeln('Begin scanning of cache keys'); diff --git a/Test/Functional/Acceptance/Acceptance74Cest.php b/Test/Functional/Acceptance/Acceptance74Cest.php new file mode 100644 index 0000000..49112f4 --- /dev/null +++ b/Test/Functional/Acceptance/Acceptance74Cest.php @@ -0,0 +1,25 @@ + '2.4.0'], + ['magentoVersion' => '2.4.3'], + ]; + } +} diff --git a/Test/Functional/Acceptance/AcceptanceCest.php b/Test/Functional/Acceptance/AcceptanceCest.php index 5a0f78b..d7526f2 100644 --- a/Test/Functional/Acceptance/AcceptanceCest.php +++ b/Test/Functional/Acceptance/AcceptanceCest.php @@ -8,7 +8,7 @@ namespace Magento\CloudComponents\Test\Functional\Acceptance; /** - * @group php74 + * @group php81 */ class AcceptanceCest { @@ -31,12 +31,27 @@ protected function prepareTemplate(\CliTester $I, string $magentoVersion): void $I->createArtifactsDir(); $I->createArtifactCurrentTestedCode('components', '1.0.99'); $I->addArtifactsRepoToComposer(); - $I->addEceDockerGitRepoToComposer(); $I->addDependencyToComposer('magento/magento-cloud-components', '1.0.99'); - $I->addDependencyToComposer( + + $I->addEceToolsGitRepoToComposer(); + $I->addEceDockerGitRepoToComposer(); + $I->addCloudPatchesGitRepoToComposer(); + $I->addQualityPatchesGitRepoToComposer(); + + $dependencies = [ + 'magento/ece-tools', 'magento/magento-cloud-docker', - $I->getDependencyVersion('magento/magento-cloud-docker') - ); + 'magento/magento-cloud-patches', + 'magento/quality-patches' + ]; + + foreach ($dependencies as $dependency) { + $I->assertTrue( + $I->addDependencyToComposer($dependency, $I->getDependencyVersion($dependency)), + 'Can not add dependency ' . $dependency + ); + } + $I->composerUpdate(); } @@ -86,8 +101,7 @@ protected function removeESIfExists(\CliTester $I, string $magentoVersion): void protected function patchesDataProvider(): array { return [ - ['magentoVersion' => '2.4.0'], - ['magentoVersion' => 'master'], + ['magentoVersion' => '2.4.4'], ]; } diff --git a/Test/Unit/Model/UrlFinder/EntityTest.php b/Test/Unit/Model/UrlFinder/EntityTest.php index 4297b7b..a2c16be 100644 --- a/Test/Unit/Model/UrlFinder/EntityTest.php +++ b/Test/Unit/Model/UrlFinder/EntityTest.php @@ -40,7 +40,7 @@ class EntityTest extends TestCase /** * @inheritDoc */ - protected function setUp() + protected function setUp(): void { $this->urlFactoryMock = $this->createMock(UrlFactory::class); $this->urlFinderMock = $this->getMockForAbstractClass(UrlFinderInterface::class); diff --git a/Test/Unit/Model/UrlFinderFactoryTest.php b/Test/Unit/Model/UrlFinderFactoryTest.php index 483c28c..7493287 100644 --- a/Test/Unit/Model/UrlFinderFactoryTest.php +++ b/Test/Unit/Model/UrlFinderFactoryTest.php @@ -34,7 +34,7 @@ class UrlFinderFactoryTest extends TestCase /** * @inheritDoc */ - protected function setUp() + protected function setUp(): void { $this->objectManagerMock = $this->getMockForAbstractClass(ObjectManagerInterface::class); diff --git a/Test/Unit/Model/UrlFixerTest.php b/Test/Unit/Model/UrlFixerTest.php index 452510e..c17f428 100644 --- a/Test/Unit/Model/UrlFixerTest.php +++ b/Test/Unit/Model/UrlFixerTest.php @@ -30,9 +30,13 @@ class UrlFixerTest extends TestCase /** * @inheritDoc */ - protected function setUp() + protected function setUp(): void { - $this->storeMock = $this->createPartialMock(Store::class, ['getForceDisableRewrites', 'getConfig']); + $this->storeMock = $this->getMockBuilder(Store::class) + ->disableOriginalConstructor() + ->onlyMethods(['getConfig']) + ->addMethods(['getForceDisableRewrites']) + ->getMock(); $this->urlFixer = new UrlFixer(); } diff --git a/composer.json b/composer.json index 1a22056..d638d0d 100644 --- a/composer.json +++ b/composer.json @@ -2,9 +2,9 @@ "name": "magento/magento-cloud-components", "description": "Cloud Components Module for Magento 2.x", "type": "magento2-module", - "version": "1.0.9", + "version": "1.0.10", "require": { - "php": "^7.1", + "php": "^7.2 || ^8.0", "ext-json": "*", "colinmollenhour/cache-backend-redis": "^1.9", "colinmollenhour/credis": "^1.6" @@ -15,11 +15,15 @@ "magento/module-url-rewrite": "*" }, "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", - "phpstan/phpstan": "^0.11", - "phpunit/phpunit": "^7.2", + "phpstan/phpstan": "^0.12", + "phpunit/phpunit": "^8.5 || ^9.5", "squizlabs/php_codesniffer": "^3.0" }, "config": { @@ -32,9 +36,9 @@ "@phpmd", "@phpunit" ], - "phpstan": "phpstan analyse -c test/static/phpstan.neon", - "phpcs": "phpcs ./ --standard=test/static/phpcs-ruleset.xml -p -n", - "phpmd": "phpmd Console xml test/static/phpmd-ruleset.xml", + "phpstan": "phpstan analyse -c tests/static/phpstan.neon", + "phpcs": "phpcs ./ --standard=tests/static/phpcs-ruleset.xml -p -n", + "phpmd": "phpmd Console xml tests/static/phpmd-ruleset.xml", "phpunit": "phpunit --configuration Test/Unit", "pre-install-cmd": "@install_suggested", "pre-update-cmd": "@install_suggested", diff --git a/tests/static/phpstan.neon b/tests/static/phpstan.neon index bd88537..5bd32f6 100644 --- a/tests/static/phpstan.neon +++ b/tests/static/phpstan.neon @@ -1,11 +1,12 @@ parameters: level: 1 paths: - - Console - - Model + - %currentWorkingDirectory%/Console + - %currentWorkingDirectory%/Model + - %currentWorkingDirectory%/Cron excludes_analyse: - %currentWorkingDirectory%/Test/* + reportUnmatchedIgnoredErrors: false ignoreErrors: - - - message: '#has invalid typehint type#' - path: Model/UrlFinder/Product.php + - message: '#has invalid typehint type#' + path: %currentWorkingDirectory%/Model/UrlFinder/Product.php