Skip to content

Commit 35262d7

Browse files
committed
chore: test with older Shopware versions
1 parent 6fabdb9 commit 35262d7

File tree

10 files changed

+57
-12
lines changed

10 files changed

+57
-12
lines changed

.github/workflows/_test.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,32 @@ jobs:
2121
- 3306:3306
2222
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
2323

24+
strategy:
25+
matrix:
26+
composer-command:
27+
- install
28+
- require shopware/core:~6.6.10.0
29+
- require shopware/core:~6.6.9.0
30+
- require shopware/core:~6.6.8.0
31+
- require shopware/core:~6.6.7.0
32+
#- require shopware/core:~6.6.6.0
33+
#- require shopware/core:~6.6.5.0
34+
#- require shopware/core:~6.6.4.0
35+
#- require shopware/core:~6.6.3.0
36+
#- require shopware/core:~6.6.2.0
37+
#- require shopware/core:~6.6.1.0
38+
#- require shopware/core:~6.6.0.0
39+
2440
steps:
2541
- name: Checkout repository
2642
uses: actions/checkout@v4
2743
- uses: ./.github/actions/composer
2844
with:
45+
composer-install: false
2946
additional-extensions: ',pcov'
3047

48+
- run: composer ${{ matrix.composer-command }}
49+
3150
- run: cp .env.ci .env.test.local
3251

3352
- name: Run tests

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
composer.lock
22
package-lock.json
3+
tests/StaticAnalyze/PHPStan/phpstan-shopware-extension.neon

.prettierrc

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
11
{
2-
"singleQuote": true
2+
"singleQuote": true,
3+
"overrides": [
4+
{
5+
"files": "*.neon",
6+
"options": {
7+
"parser": "yaml"
8+
}
9+
}
10+
]
311
}

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@
44
"license": "MIT",
55
"type": "shopware-platform-plugin",
66
"require": {
7-
"shopware/core": "~6.6.0"
7+
"shopware/core": "~6.6.7"
88
},
99
"require-dev": {
1010
"de-swebhosting/php-codestyle": "^5.4",
1111
"ergebnis/composer-normalize": "^2.45",
12-
"friendsofphp/php-cs-fixer": "^3.71",
12+
"friendsofphp/php-cs-fixer": "^3.66",
1313
"phpstan/extension-installer": "^1.4",
1414
"phpstan/phpstan": "^2.1",
1515
"phpstan/phpstan-phpunit": "^2.0",
1616
"phpstan/phpstan-symfony": "^2.0",
17-
"phpunit/phpunit": "^12.0",
17+
"phpunit/phpunit": "^11.0 || ^12.0",
1818
"rector/type-perfect": "^2.0",
1919
"shopware/dev-tools": "^1.5",
2020
"symplify/phpstan-rules": "^14.4"

phpstan.neon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ parameters:
3131

3232
services:
3333
- # register the class, so we can decorate it, but don't tag it as a rule, so only our decorator is used by PHPStan
34-
class: Symplify\PHPStanRules\Rules\NoReturnSetterMethodRule
34+
class: Symplify\PHPStanRules\Rules\NoReturnSetterMethodRule
3535

3636
rules:
3737
# rules from https://github.com/symplify/phpstan-rules
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Swh\SmartRelationSync\Tests\Compatibility;
6+
7+
if (class_exists('Shopware\\Core\\Test\\Stub\\Framework\\IdsCollection')) {
8+
class IdsCollection extends \Shopware\Core\Test\Stub\Framework\IdsCollection {}
9+
} else {
10+
class IdsCollection extends \Shopware\Core\Framework\Test\IdsCollection {}
11+
}

tests/Functional/DataAbstractionLayer/AbstractEntityWriteSubscriberTestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
use Shopware\Core\Framework\DataAbstractionLayer\EntityRepository;
1414
use Shopware\Core\Framework\DataAbstractionLayer\Search\Criteria;
1515
use Shopware\Core\Framework\Test\TestCaseBase\IntegrationTestBehaviour;
16-
use Shopware\Core\Test\Stub\Framework\IdsCollection;
16+
use Swh\SmartRelationSync\Tests\Compatibility\IdsCollection;
1717

1818
abstract class AbstractEntityWriteSubscriberTestCase extends TestCase
1919
{

tests/Functional/DataAbstractionLayer/EntityWriteSubscriberApiTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22

33
declare(strict_types=1);
44

5-
namespace Functional\DataAbstractionLayer;
5+
namespace Swh\SmartRelationSync\Tests\Functional\DataAbstractionLayer;
66

77
use Shopware\Core\Framework\Test\TestCaseBase\AdminApiTestBehaviour;
8-
use Swh\SmartRelationSync\Tests\Functional\DataAbstractionLayer\AbstractEntityWriteSubscriberTestCase;
98

109
class EntityWriteSubscriberApiTest extends AbstractEntityWriteSubscriberTestCase
1110
{

tests/Functional/DataAbstractionLayer/EntityWriteSubscriberDalTest.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace Functional\DataAbstractionLayer;
6-
7-
use Swh\SmartRelationSync\Tests\Functional\DataAbstractionLayer\AbstractEntityWriteSubscriberTestCase;
5+
namespace Swh\SmartRelationSync\Tests\Functional\DataAbstractionLayer;
86

97
class EntityWriteSubscriberDalTest extends AbstractEntityWriteSubscriberTestCase
108
{
Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,11 @@
11
parameters:
2-
ignoreErrors: []
2+
ignoreErrors:
3+
- message: '#^Class Swh\\SmartRelationSync\\Tests\\Compatibility\\IdsCollection extends @final class Shopware\\Core\\Test\\Stub\\Framework\\IdsCollection\.$#'
4+
identifier: class.extendsFinalByPhpDoc
5+
count: 1
6+
path: ../../Compatibility/IdsCollection.php
7+
8+
- message: '#^Multiple class/interface/trait is not allowed in single file$#'
9+
identifier: symplify.multipleClassLikeInFile
10+
count: 1
11+
path: ../../Compatibility/IdsCollection.php

0 commit comments

Comments
 (0)