Skip to content

Commit 9223f28

Browse files
authored
Merge pull request #204 from lchrusciel/claude/add-phpunit-12-support-7Odio
Bump dependencies of PHPunit, PHP and Symfony
2 parents 420bfe7 + dfd95e9 commit 9223f28

File tree

6 files changed

+30
-36
lines changed

6 files changed

+30
-36
lines changed

.github/workflows/build.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,20 @@ jobs:
2020
strategy:
2121
fail-fast: false
2222
matrix:
23-
php: [8.1, 8.2, 8.3]
24-
symfony: [6.4.*, 7.0.*]
25-
phpunit: [^9.0, ^10.0, ^11.0]
23+
php: [8.1, 8.2, 8.3, 8.4, 8.5]
24+
symfony: [6.4.*, 7.4.*]
25+
phpunit: [^10.0, ^11.0, ^12.0]
2626
php-matcher: [^6.0]
2727
orm: [^2.5, ^3.0]
2828
exclude:
2929
- php: 8.1
30-
symfony: 7.0.*
30+
symfony: 7.4.*
3131
- php: 8.1
3232
phpunit: ^11.0
33+
- php: 8.1
34+
phpunit: ^12.0
35+
- php: 8.2
36+
phpunit: ^12.0
3337

3438
steps:
3539
- uses: "actions/checkout@v4"

composer.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,26 +24,26 @@
2424
}
2525
],
2626
"require": {
27-
"php": "^8.0",
27+
"php": "^8.1",
2828
"ext-json": "*",
2929

3030
"coduo/php-matcher": "^6.0",
3131
"openlss/lib-array2xml": "^1.0",
32-
"doctrine/data-fixtures": "^1.2",
33-
"doctrine/doctrine-bundle": "^2.0",
32+
"doctrine/data-fixtures": "^1.2 || ^2.0",
33+
"doctrine/doctrine-bundle": "^2.0 || ^3.0",
3434
"doctrine/orm": "^2.5 || ^3.0",
3535
"nelmio/alice": "^3.6",
3636
"phpspec/php-diff": "^1.1",
37-
"phpunit/phpunit": "^9.0 || ^10.0 || ^11.0",
38-
"symfony/browser-kit": "^6.4 || ^7.0",
39-
"symfony/finder": "^6.4 || ^7.0",
40-
"symfony/framework-bundle": "^6.4 || ^7.0",
37+
"phpunit/phpunit": "^10.0 || ^11.0 || ^12.0",
38+
"symfony/browser-kit": "^6.4 || ^7.4",
39+
"symfony/finder": "^6.4 || ^7.4",
40+
"symfony/framework-bundle": "^6.4 || ^7.4",
4141
"theofidry/alice-data-fixtures": "^1.0"
4242
},
4343
"require-dev": {
4444
"phpstan/phpstan-strict-rules": "^1.0",
4545
"phpstan/phpstan-webmozart-assert": "^1.0",
46-
"symfony/serializer": "^5.4 || ^6.0",
46+
"symfony/serializer": "^5.4 || ^6.0 || ^7.0",
4747
"phpstan/phpstan": "^1.8"
4848
},
4949
"scripts": {

src/ApiTestCase.php

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
use Symfony\Component\Finder\Finder;
2525
use Symfony\Component\HttpFoundation\Response;
2626
use Symfony\Component\HttpKernel\KernelInterface;
27+
use PHPUnit\Framework\Attributes\AfterClass;
28+
use PHPUnit\Framework\Attributes\Before;
29+
use PHPUnit\Framework\Attributes\BeforeClass;
2730
use Symfony\Contracts\Service\ResetInterface;
2831
use Webmozart\Assert\Assert;
2932

@@ -50,18 +53,14 @@ abstract class ApiTestCase extends WebTestCase
5053
/** @var EntityManager|null */
5154
private $entityManager;
5255

53-
/**
54-
* @beforeClass
55-
*/
56+
#[BeforeClass]
5657
public static function createSharedKernel(): void
5758
{
5859
static::$sharedKernel = static::createKernel(['debug' => false]);
5960
static::$sharedKernel->boot();
6061
}
6162

62-
/**
63-
* @afterClass
64-
*/
63+
#[AfterClass]
6564
public static function ensureSharedKernelShutdown(): void
6665
{
6766
if (null !== static::$sharedKernel) {
@@ -73,25 +72,19 @@ public static function ensureSharedKernelShutdown(): void
7372
}
7473
}
7574

76-
/**
77-
* @before
78-
*/
75+
#[Before]
7976
public function setUpClient(): void
8077
{
8178
$this->client = static::createClient(['debug' => false]);
8279
}
8380

84-
/**
85-
* @before
86-
*/
81+
#[Before]
8782
public function createMatcher(): void
8883
{
8984
$this->matcherFactory = new MatcherFactory();
9085
}
9186

92-
/**
93-
* @before
94-
*/
87+
#[Before]
9588
public function setUpDatabase(): void
9689
{
9790
if (isset($_SERVER['IS_DOCTRINE_ORM_SUPPORTED']) && $_SERVER['IS_DOCTRINE_ORM_SUPPORTED']) {

src/JsonApiTestCase.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,12 @@
1515

1616
use Coduo\PHPMatcher\Backtrace\VoidBacktrace;
1717
use Coduo\PHPMatcher\Matcher;
18+
use PHPUnit\Framework\Attributes\Before;
1819
use Symfony\Component\HttpFoundation\Response;
1920

2021
abstract class JsonApiTestCase extends ApiTestCase
2122
{
22-
/**
23-
* @before
24-
*/
23+
#[Before]
2524
public function setUpClient(): void
2625
{
2726
$this->client = static::createClient([], ['HTTP_ACCEPT' => 'application/json']);

src/XmlApiTestCase.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,12 @@
1515

1616
use Coduo\PHPMatcher\Backtrace\VoidBacktrace;
1717
use Coduo\PHPMatcher\Matcher;
18+
use PHPUnit\Framework\Attributes\Before;
1819
use Symfony\Component\HttpFoundation\Response;
1920

2021
abstract class XmlApiTestCase extends ApiTestCase
2122
{
22-
/**
23-
* @before
24-
*/
23+
#[Before]
2524
public function setUpClient(): void
2625
{
2726
$this->client = static::createClient([], ['HTTP_ACCEPT' => 'application/xml']);

test/src/Tests/Controller/SampleControllerJsonTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
use ApiTestCase\JsonApiTestCase;
1717
use PHPUnit\Framework\AssertionFailedError;
18+
use PHPUnit\Framework\Attributes\DataProvider;
1819
use Symfony\Component\HttpFoundation\Response;
1920

2021
class SampleControllerJsonTest extends JsonApiTestCase
@@ -28,9 +29,7 @@ public function testGetHelloWorldResponse(): void
2829
$this->assertResponse($response, 'hello_world');
2930
}
3031

31-
/**
32-
* @dataProvider provideTestData
33-
*/
32+
#[DataProvider('provideTestData')]
3433
public function testGetHelloWorldResponseWithDataProvider(string $method): void
3534
{
3635
$this->client->request($method, '/');

0 commit comments

Comments
 (0)