Skip to content

Commit

Permalink
Fix tests für php 7.3 - 8.1 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
Mardl committed Mar 22, 2022
1 parent b3e8583 commit 71da29c
Show file tree
Hide file tree
Showing 5 changed files with 1,405 additions and 878 deletions.
2 changes: 1 addition & 1 deletion .valet-sh.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ services:
composer:
version: 2
php:
version: 7.4
version: 7.3
45 changes: 27 additions & 18 deletions RoboFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -327,30 +327,35 @@ public function runCpd()

// prepare the patterns for the files that has to be ignored
$ignore = array(
'Utils/MemberNames',
'Loaders/RawEntityLoader',
'Subjects/BunchSubject',
'Subjects/EeBunchSubject',
'Subjects/ConverterSubject',
'Subjects/OptionSubject',
'Loaders/CoreConfigDataLoader',
'Services/CategoryBunchProcessor',
'Plugins/MissingOptionValuesPlugin',
'Observers/EeBundleOptionObserver',
'Observers/EeMediaGalleryValueObserver',
'Observers/EeBundleSelectionUpdateObserver',
'Observers/CustomerAddressAttributeObserver',
'Observers/ProductToAttributeOptionValueConverterObserver',
'CategoryCsvSerializer'
$this->properties['vendor.dir'].'/techdivision/import/src/Plugins/MissingOptionValuesPlugin.php',
$this->properties['vendor.dir'].'/techdivision/import/src/Subjects/AbstractSubject.php',
$this->properties['vendor.dir'].'/techdivision/import-attribute/src/Utils/MemberNames.php',
$this->properties['vendor.dir'].'/techdivision/import-attribute/src/Subjects/OptionSubject.php',
$this->properties['vendor.dir'].'/techdivision/import-attribute/src/Loaders/RawEntityLoader.php',
$this->properties['vendor.dir'].'/techdivision/import-category/src/Loaders/RawEntityLoader.php',
$this->properties['vendor.dir'].'/techdivision/import-category/src/Services/CategoryBunchProcessor.php',
$this->properties['vendor.dir'].'/techdivision/import-product/src/Loaders/RawEntityLoader.php',
$this->properties['vendor.dir'].'/techdivision/import-product/src/Subjects/BunchSubject.php',
$this->properties['vendor.dir'].'/techdivision/import-product/src/Observers/UrlKeyObserver.php',
$this->properties['vendor.dir'].'/techdivision/import-product-bundle/src/Loaders/RawEntityLoader.php',
$this->properties['vendor.dir'].'/techdivision/import-product-bundle-ee/src/Observers/EeBundleOptionObserver.php',
$this->properties['vendor.dir'].'/techdivision/import-product-media/src/Loaders/RawEntityLoader.php',
$this->properties['vendor.dir'].'/techdivision/import-product-media/src/Observers/MediaGalleryValueObserver.php',
$this->properties['vendor.dir'].'/techdivision/import-product-variant/src/Loaders/RawEntityLoader.php',
$this->properties['vendor.dir'].'/techdivision/import-converter-customer-attribute/src/Subjects/ConverterSubject.php',
$this->properties['vendor.dir'].'/techdivision/import-converter-product-attribute/src/Subjects/ConverterSubject.php',
$this->properties['vendor.dir'].'/techdivision/import-converter-product-attribute/src/Observers/ProductToAttributeOptionValueConverterObserver.php',
$this->properties['vendor.dir'].'/techdivision/import-customer-address/src/Observers/CustomerAddressAttributeObserver.php',
$this->properties['vendor.dir'].'/techdivision/import-serializer-csv/src/CategoryCsvSerializer.php',
);

// run the copy past detector
return $this->_exec(
sprintf(
'%s/bin/phpcpd --regexps-exclude %s %s/techdivision/*/src --log-pmd %s/reports/pmd-cpd.xml',
'%s/bin/phpcpd %s/techdivision/*/src --exclude %s --log-pmd %s/reports/pmd-cpd.xml',
$this->properties['vendor.dir'],
implode(',', $ignore),
$this->properties['vendor.dir'],
implode(' --exclude ', $ignore),
$this->properties['target.dir']
)
);
Expand Down Expand Up @@ -450,7 +455,11 @@ public function build()
// process the build
$this->clean();
$this->prepare();
$this->runCpd();
try {
$this->runCpd();
} catch (\Exception $e) {

}
$this->runCs();
$this->runMd();
$this->runTestsUnit();
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
},
"require-dev": {
"doctrine/dbal": "2.5.*",
"pdepend/pdepend": "2.5.2",
"phpmd/phpmd": "@stable",
"pdepend/pdepend": "^2.5.2",
"phpmd/phpmd": "^2.11.0",
"phpunit/phpunit": "^6.5.0|^8.0.0|~9.5.0",
"sebastian/phpcpd": "~3.0|~4.0|~5.0|~6.0",
"squizlabs/php_codesniffer": "~3.4.0|~3.6.0",
Expand Down
Loading

0 comments on commit 71da29c

Please sign in to comment.