From 47320ce2d2f1b3a3c4f1595bf40f5fda90423c6d Mon Sep 17 00:00:00 2001 From: morgan Date: Thu, 5 Dec 2024 17:45:33 +0100 Subject: [PATCH] Update CheckRequirements Command --- classes/Commands/CheckRequirementsCommand.php | 2 +- tests/fixtures/checksum-compare/8.1.0.xml | 8 + .../8.1.0/adminTest/.htaccess | 1 + .../checksum-compare/8.1.0/app/AppKernel.php | 11 +- .../8.1.0/themes/classic/config/theme.yml | 3 +- .../translations/default/AdminActions.xlf | 1559 +++++++++++++++++ tests/unit/Xml/ChecksumCompareTest.php | 2 +- 7 files changed, 1577 insertions(+), 9 deletions(-) create mode 100644 tests/fixtures/checksum-compare/8.1.0/translations/default/AdminActions.xlf diff --git a/classes/Commands/CheckRequirementsCommand.php b/classes/Commands/CheckRequirementsCommand.php index 25a67da49..589306794 100644 --- a/classes/Commands/CheckRequirementsCommand.php +++ b/classes/Commands/CheckRequirementsCommand.php @@ -178,7 +178,7 @@ private function processRequirementWarnings(): void default: if (isset($wording['list'])) { foreach ($wording['list'] as $item) { - $this->output->writeln(' ' . $item); + $this->output->writeln("\t" . $item); } } } diff --git a/tests/fixtures/checksum-compare/8.1.0.xml b/tests/fixtures/checksum-compare/8.1.0.xml index 91657e734..01f0441c0 100644 --- a/tests/fixtures/checksum-compare/8.1.0.xml +++ b/tests/fixtures/checksum-compare/8.1.0.xml @@ -8,6 +8,9 @@ 37d3976fc4877231fa652567e4e02cd4 + + b0175575517b2a31c3ee8cd55c5b50 + @@ -15,6 +18,11 @@ + + + ab259a1e9a4517fe5085897fe659eec9 + + 784dcbb3afa380d571da3664821f45bd diff --git a/tests/fixtures/checksum-compare/8.1.0/adminTest/.htaccess b/tests/fixtures/checksum-compare/8.1.0/adminTest/.htaccess index 19e999fda..fcb89b5cb 100644 --- a/tests/fixtures/checksum-compare/8.1.0/adminTest/.htaccess +++ b/tests/fixtures/checksum-compare/8.1.0/adminTest/.htaccess @@ -5,6 +5,7 @@ # to each configured DirectoryIndex file (e.g. index.php, index.html, index.pl). DirectoryIndex index.php +// TOTO # By default, Apache does not evaluate symbolic links if you did not enable this # feature in your server configuration. Uncomment the following line if you diff --git a/tests/fixtures/checksum-compare/8.1.0/app/AppKernel.php b/tests/fixtures/checksum-compare/8.1.0/app/AppKernel.php index f5f36676d..d0f254f59 100644 --- a/tests/fixtures/checksum-compare/8.1.0/app/AppKernel.php +++ b/tests/fixtures/checksum-compare/8.1.0/app/AppKernel.php @@ -53,7 +53,7 @@ class AppKernel extends Kernel */ public function registerBundles() { - $bundles = [ + $bundles = array( new Symfony\Bundle\FrameworkBundle\FrameworkBundle(), new Symfony\Bundle\SecurityBundle\SecurityBundle(), new Symfony\Bundle\TwigBundle\TwigBundle(), @@ -68,9 +68,9 @@ public function registerBundles() new TranslationToolsBundle(), new League\Tactician\Bundle\TacticianBundle(), new FOS\JsRoutingBundle\FOSJsRoutingBundle(), - ]; + ); - if (in_array($this->getEnvironment(), ['dev', 'test'], true)) { + if (in_array($this->getEnvironment(), array('dev', 'test'), true)) { $bundles[] = new Symfony\Bundle\DebugBundle\DebugBundle(); $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle(); } @@ -101,7 +101,7 @@ public function boot() * Perform a lock on a file before cache clear is performed, this lock will be unlocked once the cache has been cleared. * Until then any other process will have to wait until the file is unlocked. * - * @return bool returns boolean indicating if the lock file was successfully locked + * @return bool Returns boolean indicating if the lock file was successfully locked. */ public function locksCacheClear(): bool { @@ -117,7 +117,6 @@ public function locksCacheClear(): bool if (false === $clearCacheLocked) { // Clear cache is already locked by another process, so we simply return fclose($lockStream); - return false; } @@ -171,7 +170,7 @@ protected function getKernelParameters() return array_merge( $kernelParameters, - ['kernel.active_modules' => $this->getActiveModules()] + array('kernel.active_modules' => $this->getActiveModules()) ); } diff --git a/tests/fixtures/checksum-compare/8.1.0/themes/classic/config/theme.yml b/tests/fixtures/checksum-compare/8.1.0/themes/classic/config/theme.yml index 6cf73bae6..ebf4521f7 100644 --- a/tests/fixtures/checksum-compare/8.1.0/themes/classic/config/theme.yml +++ b/tests/fixtures/checksum-compare/8.1.0/themes/classic/config/theme.yml @@ -1,3 +1,5 @@ +TOTO + name: classic display_name: Classic version: 2.1.1 @@ -6,7 +8,6 @@ author: email: "contact@prestashop.com" url: "https://www.prestashop-project.org" - meta: compatibility: from: 8.1.0 diff --git a/tests/fixtures/checksum-compare/8.1.0/translations/default/AdminActions.xlf b/tests/fixtures/checksum-compare/8.1.0/translations/default/AdminActions.xlf new file mode 100644 index 000000000..844f27d49 --- /dev/null +++ b/tests/fixtures/checksum-compare/8.1.0/translations/default/AdminActions.xlf @@ -0,0 +1,1559 @@ + + + + + + + Edit + Edit + Line: 521 + + + Uninstall + Uninstall + Line: 583 + + + Configure + Configure + Line: 579 + + + + + + + Choose a file + Choose a file + Line: 52 + + + + + + + Validate + Validate + Line: 33 + + + Delete + Delete + Line: 32 + + + + + + + Generate + Generate + Line: 83 + + + + + + + Choose + Choose + Line: 38 + + + + + + + Select all + Select all + Line: 37 + + + Unselect all + Unselect all + Line: 42 + + + Display + Display + Line: 63 + + + + + + + -- Choose -- + -- Choose -- + Line: 38 + + + + + + + View + View + Line: 85 + + + + + + + Import + Import + Line: 141 + + + Save + Save + Line: 86 + + + + + + + Back to + Back to + Line: 168 + + + Cancel + Cancel + Line: 134 + + + + + + + Disable + Disable + Line: 67 + + + Translate + Translate + Line: 86 + + + + + + + Search + Search + Line: 92 + + + + + + + Print out + Print out + Line: 43 + + + + + + + Preview + Preview + Line: 77 + + + + + + + Remove + Remove + Line: 51 + + + Add + Add + Line: 41 + + + + + + + Reset + Reset + Line: 79 + + + + + + + Save and stay + Save and stay + Line: 105 + + + + + + + and stay + and stay + Line: 120 + + + + + + + Choose language: + Choose language: + Line: 77 + + + + + + + Apply + Apply + Line: 99 + + + + + + + See more + See more + Line: 84 + + + Hide warning + Hide warning + Line: 85 + + + + + + + Close + Close + Line: 40 + + + + + + + Add current page to Quick Access + Add current page to Quick Access + Line: 64 + + + + + + + Install + Install + Line: 4386 + + + Edit: %s + Edit: %s + Line: 1646 + + + + + + + Check All + Check All + Line: 153 + + + Uncheck All + Uncheck All + Line: 154 + + + Find a category + Find a category + Line: 155 + + + + + + + Collapse all + Collapse all + Line: 381 + + + Expand all + Expand all + Line: 388 + + + Check all + Check all + Line: 399 + + + Uncheck all + Uncheck all + Line: 406 + + + + + + + Finish + Finish + Line: 157 + + + + + + + Delete selected items? + Delete selected items? + Line: 48 + + + + + + + Delete selected + Delete selected + Line: 85 + + + + + + + Add new menu + Add new menu + Line: 103 + + + Show or hide menu. + Show or hide menu. + Line: 187 + + + Enable selection + Enable selection + Line: 314 + + + Disable selection + Disable selection + Line: 318 + + + + + + + Refresh + Refresh + Line: 39 + + + + + + + Continue + Continue + Line: 43 + + + + + + + Sort + Sort + Line: 251 + + + Sort order + Sort order + Line: 268 + + + + + + + Display email address + Display email address + Line: 148 + + + + + + + Export .CSV file + Export .CSV file + Line: 1191 + + + + + + + Add new + Add new + Line: 28 + + + + + + + Search post code + Search post code + Line: 215 + + + Search city + Search city + Line: 225 + + + Search address + Search address + Line: 205 + + + + + + + Search file name + Search file name + Line: 183 + + + Search file size + Search file size + Line: 193 + + + + + + + Search value + Search value + Line: 230 + + + Search color + Search color + Line: 264 + + + + + + + Search position + Search position + Line: 245 + + + + + + + Search ISO code + Search ISO code + Line: 169 + + + Search country + Search country + Line: 159 + + + Search call prefix + Search call prefix + Line: 179 + + + Search zones + Search zones + Line: 189 + + + Export to SQL manager + Export to SQL manager + Line: 254 + + + + + + + Search language + Search language + Line: 262 + + + Search employee + Search employee + Line: 280 + + + + + + + Search first name + Search first name + Line: 178 + + + Search last name + Search last name + Line: 188 + + + Search email + Search email + Line: 198 + + + + + + + Search code + Search code + Line: 219 + + + Search date format + Search date format + Line: 239 + + + + + + + Search order ID + Search order ID + Line: 141 + + + + + + + Search reference + Search reference + Line: 144 + + + + + + + Search description + Search description + Line: 149 + + + + + + + Search total + Search total + Line: 330 + + + Search payment + Search payment + Line: 339 + + + Search company + Search company + Line: 387 + + + + + + + Search message + Search message + Line: 152 + + + + + + + Search template + Search template + Line: 231 + + + + + + + Duplicate product + Duplicate product + Line: 478 + + + Activating %total% products + Activating %total% products + Line: 706 + + + Activating %done% / %total% products + Activating %done% / %total% products + Line: 707 + + + Deactivating %total% products + Deactivating %total% products + Line: 715 + + + Deactivating %done% / %total% products + Deactivating %done% / %total% products + Line: 716 + + + Duplicating %total% products + Duplicating %total% products + Line: 724 + + + Duplicating %done% / %total% products + Duplicating %done% / %total% products + Line: 725 + + + Deleting %total% products + Deleting %total% products + Line: 733 + + + Deleting %done% / %total% products + Deleting %done% / %total% products + Line: 734 + + + Stop processing + Stop processing + Line: 779 + + + %error_count% errors occurred. You can download the logs for future reference. + %error_count% errors occurred. You can download the logs for future reference. + Line: 780 + + + Back to processing + Back to processing + Line: 781 + + + Download error log + Download error log + Line: 782 + + + View %error_count% error logs + View %error_count% error logs + Line: 783 + + + Delete from store + Delete from store + Line: 336 + + + Delete from group + Delete from group + Line: 410 + + + Enable for group + Enable for group + Line: 411 + + + Disable for group + Disable for group + Line: 412 + + + Duplicate group + Duplicate group + Line: 413 + + + Enable on all stores + Enable on all stores + Line: 421 + + + Disable on all stores + Disable on all stores + Line: 422 + + + Duplicate all stores + Duplicate all stores + Line: 423 + + + Activate selection for current store + Activate selection for current store + Line: 667 + + + Deactivate selection for current store + Deactivate selection for current store + Line: 668 + + + Duplicate selection for current store + Duplicate selection for current store + Line: 669 + + + Delete selection for current store + Delete selection for current store + Line: 670 + + + Activate selection for group + Activate selection for group + Line: 685 + + + Deactivate selection for group + Deactivate selection for group + Line: 686 + + + Duplicate selection for group + Duplicate selection for group + Line: 687 + + + Delete selection for group + Delete selection for group + Line: 688 + + + Activate selection for all stores + Activate selection for all stores + Line: 695 + + + Deactivate selection for all stores + Deactivate selection for all stores + Line: 696 + + + Duplicate selection for all stores + Duplicate selection for all stores + Line: 697 + + + Delete selection for all stores + Delete selection for all stores + Line: 698 + + + + + + + Search ID + Search ID + Line: 153 + + + Search name + Search name + Line: 163 + + + + + + + Search key + Search key + Line: 147 + + + + + + + Search zone + Search zone + Line: 143 + + + + + + + Add new authorized app + Add new authorized app + Line: 97 + + + Add new API access + Add new API access + Line: 104 + + + + + + + New product + New product + Line: 386 + + + + + + + Add tag + Add tag + Line: 183 + + + + + + + Order by + Order by + Line: 115 + + + + + + + View customer details + View customer details + Line: 74 + + + View order details + View order details + Line: 83 + + + + + + + Delete from all stores + Delete from all stores + Line: 142 + + + + + + + Duplicate for current store + Duplicate for current store + Line: 119 + + + + + + + Replace selection + Replace selection + Line: 108 + + + Close window + Close window + Line: 120 + + + Close (esc) + Close (esc) + Line: 121 + + + Toggle Fullscreen + Toggle Fullscreen + Line: 123 + + + Zoom in/out + Zoom in/out + Line: 124 + + + Previous (arrow left) + Previous (arrow left) + Line: 125 + + + Next (arrow right) + Next (arrow right) + Line: 126 + + + Download image + Download image + Line: 127 + + + Zoom on selection + Zoom on selection + Line: 128 + + + + + + + [1]Manage default settings[/1] + [1]Manage default settings[/1] + Line: 86 + + + + + + + Search customer + Search customer + Line: 142 + + + + + + + All carriers + All carriers + Line: 121 + + + Only selected carriers + Only selected carriers + Line: 122 + + + + + + + Change password... + Change password... + Line: 72 + + + + + + + Confirm + Confirm + Line: 36 + + + + + + + Browse + Browse + Line: 37 + + + Go + Go + Line: 42 + + + + + + + Download + Download + Line: 31 + + + + + + + Back to list + Back to list + Line: 48 + + + + + + + Use + Use + Line: 78 + + + + + + + Change + Change + Line: 104 + + + + + + + Read more + Read more + Line: 95 + + + + + + + Enable + Enable + Line: 85 + + + + + + + Load + Load + Line: 55 + + + + + + + All + All + Line: 71 + + + + + + + Export + Export + Line: 37 +Comment: Recommended modules will be attached to here. + + + + + + + Edit: %name% + Edit: %name% + Line: 27 + + + + + + + Learn more + Learn more + Line: 37 + + + + + + + Edit: %value% + Edit: %value% + Line: 28 + + + + + + + Enable debug mode + Enable debug mode + Line: 64 + + + Back to previous page + Back to previous page + Line: 68 + + + Learn more about debug mode + Learn more about debug mode + Line: 74 + + + + + + + Save and preview + Save and preview + Line: 58 + + + + + + + Generate emails + Generate emails + Line: 91 + + + + + + + Back to configuration + Back to configuration + Line: 112 + + + + + + + Translate emails + Translate emails + Line: 53 + + + + + + + Choose layouts + Choose layouts + Line: 35 + + + + + + + Show + Show + Line: 59 + + + + + + + Update + Update + Line: 51 + + + + + + + Restore + Restore + Line: 48 + + + + + + + Copy + Copy + Line: 86 + + + + + + + Modify + Modify + Line: 58 + + + + + + + Try again + Try again + Line: 72 + + + + + + + See less + See less + Line: 30 + + + + + + + Go to maintenance page + Go to maintenance page + Line: 41 + + + Upgrade + Upgrade + Line: 42 + + + Upgrade anyway + Upgrade anyway + Line: 43 + + + + + + + Configure URL + Configure URL + Line: 110 + + + + + + + Delete selection + Delete selection + Line: 121 + + + Filter by categories + Filter by categories + Line: 35 + + + Activate selection + Activate selection + Line: 96 + + + Deactivate selection + Deactivate selection + Line: 100 + + + Duplicate selection + Duplicate selection + Line: 110 + + + Unselect + Unselect + Line: 67 + + + Clear filter + Clear filter + Line: 78 + + + + + + + Show SQL query + Show SQL query + Line: 45 + + + + + + + Reorder + Reorder + Line: 189 + + + + + Line: 190 + + + Rearrange + Rearrange + Line: 188 + + + + + + + Export to SQL Manager + Export to SQL Manager + Line: 217 + + + + + + + Duplicate + Duplicate + Line: 131 + + + + + + + Create + Create + Line: 76 + + + + + + + Delete this file + Delete this file + Line: 108 + + + + + + + Save image settings + Save image settings + Line: 43 + + + + + + + Close and refresh + Close and refresh + Line: 40 + + + + + + + Filter by: + Filter by: + Line: 109 + + + Clear filter|Clear %filtersNb% filters + Clear filter|Clear %filtersNb% filters + Line: 80 + + + Discard + Discard + Line: 124 + + + Clear filter|Clear {filtersNb} filters + Clear filter|Clear {filtersNb} filters + Line: 110 + + + + + + + Select results on this page (%combinations_number%) + Select results on this page (%combinations_number%) + Line: 75 + + + Select all results (%combinations_number%) + Select all results (%combinations_number%) + Line: 85 + + + + + + + Save and publish + Save and publish + Line: 101 + + + + + + + Send + Send + Line: 60 + + + + + + + Shipping + Shipping + Line: 27 + + + + + + + Select + Select + Line: 56 + + + + + + + Select another address + Select another address + Line: 186 + + + View full details + View full details + Line: 51 + + + Edit existing address + Edit existing address + Line: 177 + + + + + + + View pack content + View pack content + Line: 176 + + + + + + + Expand + Expand + Line: 37 + + + Collapse + Collapse + Line: 32 + + + + + + + Download file + Download file + Line: 1026 + + + Add my IP + Add my IP + Line: 85 + + + Choose file(s) + Choose file(s) + Line: 1020 + + + + + + + Sort by + Sort by + Line: 85 + + + Check / Uncheck all + Check / Uncheck all + Line: 293 + + + + + + + Confirm this action + Confirm this action + Line: 41 + + + + diff --git a/tests/unit/Xml/ChecksumCompareTest.php b/tests/unit/Xml/ChecksumCompareTest.php index 25297a7a4..b961223b5 100644 --- a/tests/unit/Xml/ChecksumCompareTest.php +++ b/tests/unit/Xml/ChecksumCompareTest.php @@ -94,7 +94,7 @@ public function testGetTamperedFilesOnShop() $expected = [ 'mail' => ['missing' => [], 'altered' => []], - 'translation' => ['missing' => [], 'altered' => []], + 'translation' => ['missing' => [], 'altered' => ['translations/default/AdminActions.xlf']], 'core' => ['missing' => ['admin/init.php'], 'altered' => ['admin/.htaccess']], 'themes' => ['missing' => [], 'altered' => ['themes/classic/config/theme.yml']], ];