|
| 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 php82 |
| 12 | + */ |
| 13 | +class AcceptanceCest extends AbstractCest |
| 14 | +{ |
| 15 | + /** |
| 16 | + * @param \CliTester $I |
| 17 | + */ |
| 18 | + public function _before(\CliTester $I): void |
| 19 | + { |
| 20 | + parent::_before($I); |
| 21 | + } |
| 22 | + |
| 23 | + /** |
| 24 | + * @param \CliTester $I |
| 25 | + * @param \Codeception\Example $data |
| 26 | + * @throws \Robo\Exception\TaskException |
| 27 | + * @dataProvider patchesDataProvider |
| 28 | + */ |
| 29 | + public function testPatches(\CliTester $I, \Codeception\Example $data): void |
| 30 | + { |
| 31 | + $this->prepareTemplate($I, $data['templateVersion'], $data['magentoVersion'] ?? null); |
| 32 | + $I->copyFileToWorkDir('files/patches/.apply_quality_patches.env.yaml', '.magento.env.yaml'); |
| 33 | + $I->generateDockerCompose(sprintf( |
| 34 | + '--mode=production --env-vars="%s"', |
| 35 | + $this->convertEnvFromArrayToJson(['MAGENTO_CLOUD_PROJECT' => 'travis-testing']) |
| 36 | + )); |
| 37 | + $I->assertTrue($I->runDockerComposeCommand('run build cloud-build')); |
| 38 | + $I->assertTrue($I->startEnvironment()); |
| 39 | + $I->assertTrue($I->runDockerComposeCommand('run deploy cloud-deploy')); |
| 40 | + $I->assertTrue($I->runDockerComposeCommand('run deploy cloud-post-deploy')); |
| 41 | + $I->amOnPage('/'); |
| 42 | + $I->see('Home page'); |
| 43 | + $I->see('CMS homepage content goes here.'); |
| 44 | + } |
| 45 | + |
| 46 | + /** |
| 47 | + * @return array |
| 48 | + */ |
| 49 | + protected function patchesDataProvider(): array |
| 50 | + { |
| 51 | + return [ |
| 52 | + ['templateVersion' => '2.4.6', 'magentoVersion' => '2.4.6'], |
| 53 | + ['templateVersion' => '2.4.6', 'magentoVersion' => '2.4.6-p1'], |
| 54 | + ['templateVersion' => '2.4.7-beta', 'magentoVersion' => null], |
| 55 | + ]; |
| 56 | + } |
| 57 | +} |
0 commit comments