Skip to content

Commit 57ba414

Browse files
authored
Merge pull request #7 from lmc-eu/feature/update-dependencies
Drop support for php 8.1 and uUpdate dependencies
2 parents 6b133b7 + de66ad7 commit 57ba414

26 files changed

+106
-145
lines changed

.github/workflows/tests.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ jobs:
1212

1313
strategy:
1414
matrix:
15-
php-version: ['8.1']
15+
php-version: ['8.2', '8.3']
1616
dependencies: ['']
1717
include:
18-
- { php-version: '8.1', dependencies: '--prefer-lowest --prefer-stable' }
18+
- { php-version: '8.2', dependencies: '--prefer-lowest --prefer-stable' }
1919

2020
name: Unit tests - PHP ${{ matrix.dependencies }}
2121

@@ -65,7 +65,7 @@ jobs:
6565
- name: Setup PHP
6666
uses: shivammathur/setup-php@v2
6767
with:
68-
php-version: '8.1'
68+
php-version: '8.2'
6969
extensions: json, mbstring
7070

7171
- name: Install dependencies

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
<!-- There should always be "Unreleased" section at the beginning. -->
44

55
## Unreleased
6+
- Drop support for php 8.1
7+
- Update dependencies
68

79
## 3.0.0 - 2022-04-27
810
- Require php 8.1

composer.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
"license": "MIT",
55
"type": "library",
66
"require": {
7-
"php": "^8.1",
7+
"php": "^8.2",
88
"ext-json": "*",
99
"ext-mbstring": "*",
10-
"lmc/cqrs-types": "^3.0",
10+
"lmc/cqrs-types": "^3.2",
1111
"nelmio/solarium-bundle": "^5.0",
1212
"solarium/solarium": "^6.2.3"
1313
},
@@ -18,7 +18,7 @@
1818
"phpstan/extension-installer": "^1.1",
1919
"phpstan/phpstan": "^1.4",
2020
"phpstan/phpstan-phpunit": "^1.0",
21-
"phpunit/phpunit": "^9.5.20"
21+
"phpunit/phpunit": "^11.0.4"
2222
},
2323
"autoload": {
2424
"psr-4": {
@@ -32,9 +32,9 @@
3232
},
3333
"config": {
3434
"allow-plugins": {
35+
"dealerdirect/phpcodesniffer-composer-installer": true,
3536
"ergebnis/composer-normalize": true,
36-
"phpstan/extension-installer": true,
37-
"dealerdirect/phpcodesniffer-composer-installer": true
37+
"phpstan/extension-installer": true
3838
},
3939
"sort-packages": true
4040
},

phpunit.xml.dist

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,29 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
32
<!-- https://phpunit.de/manual/current/en/appendixes.configuration.html -->
43
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5-
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
6-
colors="true"
7-
bootstrap="vendor/autoload.php"
8-
>
9-
4+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.0/phpunit.xsd" colors="true"
5+
bootstrap="vendor/autoload.php">
106
<coverage>
11-
<include>
12-
<directory suffix=".php">src</directory>
13-
</include>
147
<report>
158
<clover outputFile="./reports/clover.xml"/>
169
<html outputDirectory="./reports" highLowerBound="90"/>
1710
</report>
1811
</coverage>
19-
2012
<php>
2113
<!-- E_ALL = 30719 -->
2214
<ini name="error_reporting" value="30719"/>
2315
</php>
24-
2516
<testsuites>
2617
<testsuite name="unit">
2718
<directory>tests/</directory>
2819
</testsuite>
2920
</testsuites>
30-
3121
<logging>
3222
<junit outputFile="./reports/junit.xml"/>
3323
</logging>
24+
<source>
25+
<include>
26+
<directory suffix=".php">src</directory>
27+
</include>
28+
</source>
3429
</phpunit>

tests/AbstractSolrTestCase.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Lmc\Cqrs\Solr;
44

5+
use PHPUnit\Framework\Attributes\Before;
56
use PHPUnit\Framework\MockObject\MockObject;
67
use PHPUnit\Framework\TestCase;
78
use Psr\EventDispatcher\EventDispatcherInterface;
@@ -15,7 +16,7 @@ abstract class AbstractSolrTestCase extends TestCase
1516
/** @var Client|MockObject */
1617
protected Client $client;
1718

18-
/** @before */
19+
#[Before]
1920
protected function setUpClient(): void
2021
{
2122
$this->client = $this->createMock(Client::class);

tests/Fixture/FulltextApplicatorTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
trait FulltextApplicatorTrait
88
{
9-
public function provideGlobalEdismax(): array
9+
public static function provideGlobalEdismax(): array
1010
{
1111
return [
1212
// isGlobal

tests/QueryBuilder/Applicator/ApplicatorTestCase.php renamed to tests/QueryBuilder/Applicator/AbstractApplicatorTestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
use Lmc\Cqrs\Solr\QueryBuilder\EntityInterface\EntityInterface;
77
use Lmc\Cqrs\Solr\QueryBuilder\Query\BuilderPrototypeQuery;
88

9-
class ApplicatorTestCase extends AbstractSolrTestCase
9+
abstract class AbstractApplicatorTestCase extends AbstractSolrTestCase
1010
{
1111
protected function getApplicator(string $applicatorClass, EntityInterface $entity): ApplicatorInterface
1212
{

tests/QueryBuilder/Applicator/ApplicatorFactoryTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
use Lmc\Cqrs\Solr\QueryBuilder\Fixture\ParameterizedDummyEntity;
1717
use Lmc\Cqrs\Solr\QueryBuilder\Fixture\SortDummyEntity;
1818
use Lmc\Cqrs\Solr\QueryBuilder\Fixture\StatsDummyEntity;
19+
use PHPUnit\Framework\Attributes\DataProvider;
20+
use PHPUnit\Framework\Attributes\Test;
1921
use PHPUnit\Framework\TestCase;
2022

2123
class ApplicatorFactoryTest extends TestCase
@@ -67,11 +69,9 @@ protected function setUp(): void
6769

6870
/**
6971
* @param string[] $expected
70-
*
71-
* @dataProvider provideEntities
72-
*
73-
* @test
7472
*/
73+
#[Test]
74+
#[DataProvider('provideEntities')]
7575
public function shouldGetFixturesForEntity(EntityInterface $entity, array $expected): void
7676
{
7777
$applicators = $this->applicatorFactory->getApplicators($entity);
@@ -85,7 +85,7 @@ public function shouldGetFixturesForEntity(EntityInterface $entity, array $expec
8585
}
8686
}
8787

88-
public function provideEntities(): array
88+
public static function provideEntities(): array
8989
{
9090
return [
9191
[

tests/QueryBuilder/Applicator/EntityApplicatorTest.php

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
namespace Lmc\Cqrs\Solr\QueryBuilder\Applicator;
44

55
use Lmc\Cqrs\Solr\QueryBuilder\Fixture\BaseDummyEntity;
6+
use PHPUnit\Framework\Attributes\Test;
67

7-
class EntityApplicatorTest extends ApplicatorTestCase
8+
class EntityApplicatorTest extends AbstractApplicatorTestCase
89
{
910
private EntityApplicator $entityApplicator;
1011

@@ -13,9 +14,7 @@ protected function setUp(): void
1314
$this->entityApplicator = new EntityApplicator();
1415
}
1516

16-
/**
17-
* @test
18-
*/
17+
#[Test]
1918
public function shouldApplyEntityInterface(): void
2019
{
2120
$baseEntity = new BaseDummyEntity();
@@ -28,9 +27,7 @@ public function shouldApplyEntityInterface(): void
2827
$this->assertStringContainsString('fl=' . implode(',', $baseEntity->getFields()), $queryUri);
2928
}
3029

31-
/**
32-
* @test
33-
*/
30+
#[Test]
3431
public function shouldUsePlaceholderForAllFields(): void
3532
{
3633
$baseEntity = new BaseDummyEntity('', []);

tests/QueryBuilder/Applicator/FacetsApplicatorTest.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
namespace Lmc\Cqrs\Solr\QueryBuilder\Applicator;
44

55
use Lmc\Cqrs\Solr\QueryBuilder\Fixture\FacetsDummyEntity;
6+
use PHPUnit\Framework\Attributes\Test;
67

7-
class FacetsApplicatorTest extends ApplicatorTestCase
8+
class FacetsApplicatorTest extends AbstractApplicatorTestCase
89
{
910
private FacetsApplicator $facetsApplicator;
1011

@@ -13,9 +14,7 @@ protected function setUp(): void
1314
$this->facetsApplicator = new FacetsApplicator();
1415
}
1516

16-
/**
17-
* @test
18-
*/
17+
#[Test]
1918
public function shouldApplyFacetsOnQuery(): void
2019
{
2120
$entity = new FacetsDummyEntity();

0 commit comments

Comments
 (0)