Skip to content

Commit 8928f38

Browse files
committed
Upgrade phpunit 10 > 11
1 parent 6e94a24 commit 8928f38

12 files changed

Lines changed: 416 additions & 279 deletions

File tree

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
"mockery/mockery": "^1.6.12",
7070
"phake/phake": "^4.6.1",
7171
"phpmd/phpmd": "^2.15",
72-
"phpunit/phpunit": "^10.5.58",
72+
"phpunit/phpunit": "^11",
7373
"rector/rector": "^2.2.7",
7474
"squizlabs/php_codesniffer": "^4.0",
7575
"symfony/debug-bundle": "6.4.*",

composer.lock

Lines changed: 335 additions & 223 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/functional/OpenConext/EngineBlockBundle/Controller/Api/AttributeReleasePolicyControllerApiTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,14 @@
2222
use OpenConext\EngineBlock\Metadata\AttributeReleasePolicy;
2323
use OpenConext\EngineBlock\Metadata\Entity\ServiceProvider;
2424
use Symfony\Bundle\FrameworkBundle\KernelBrowser;
25-
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
2625
use Symfony\Component\HttpFoundation\Response;
2726

28-
class AttributeReleasePolicyControllerApiTest extends WebTestCase
27+
class AttributeReleasePolicyControllerApiTest extends FunctionalWebTestCase
2928
{
3029
public function tearDown(): void
3130
{
3231
$this->clearMetadataFixtures();
33-
parent::tearDown(); // Ensure the kernel is properly shutdown to avoid state pollution between tests.
32+
parent::tearDown();
3433
}
3534

3635
#[\PHPUnit\Framework\Attributes\Group('Api')]

tests/functional/OpenConext/EngineBlockBundle/Controller/Api/ConnectionsControllerTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,9 @@
2626
use OpenConext\EngineBlockBundle\Configuration\FeatureConfiguration;
2727
use Symfony\Bundle\FrameworkBundle\Client;
2828
use Symfony\Bundle\FrameworkBundle\KernelBrowser;
29-
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
3029
use Symfony\Component\HttpFoundation\Response;
3130

32-
class ConnectionsControllerTest extends WebTestCase
31+
class ConnectionsControllerTest extends FunctionalWebTestCase
3332
{
3433
protected function tearDown(): void
3534
{

tests/functional/OpenConext/EngineBlockBundle/Controller/Api/ConsentControllerTest.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,9 @@
2828
use OpenConext\Value\Saml\NameIdFormat;
2929
use PDOStatement;
3030
use Symfony\Bundle\FrameworkBundle\KernelBrowser;
31-
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
3231
use Symfony\Component\HttpFoundation\Response;
33-
use function json_decode;
34-
use function json_encode;
3532

36-
final class ConsentControllerTest extends WebTestCase
33+
final class ConsentControllerTest extends FunctionalWebTestCase
3734
{
3835
public function tearDown(): void
3936
{

tests/functional/OpenConext/EngineBlockBundle/Controller/Api/DeprovisionControllerTest.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,9 @@
2222
use Doctrine\DBAL\Query\QueryBuilder;
2323
use OpenConext\EngineBlockBundle\Configuration\FeatureConfiguration;
2424
use Symfony\Bundle\FrameworkBundle\KernelBrowser;
25-
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
2625
use Symfony\Component\HttpFoundation\Response;
27-
use function json_decode;
28-
use function trim;
2926

30-
final class DeprovisionControllerTest extends WebTestCase
27+
final class DeprovisionControllerTest extends FunctionalWebTestCase
3128
{
3229
public function tearDown(): void
3330
{

tests/functional/OpenConext/EngineBlockBundle/Controller/Api/HeartbeatControllerTest.php

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

2121
use Symfony\Bundle\FrameworkBundle\Client;
2222
use Symfony\Bundle\FrameworkBundle\KernelBrowser;
23-
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
2423
use Symfony\Component\HttpFoundation\Response;
2524

26-
final class HeartbeatControllerTest extends WebTestCase
25+
final class HeartbeatControllerTest extends FunctionalWebTestCase
2726
{
2827
#[\PHPUnit\Framework\Attributes\Group('Api')]
2928
#[\PHPUnit\Framework\Attributes\Test]

tests/functional/OpenConext/EngineBlockBundle/Controller/Api/MetadataControllerTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,9 @@
2222
use OpenConext\EngineBlock\Metadata\Entity\ServiceProvider;
2323
use OpenConext\EngineBlockBundle\Configuration\FeatureConfiguration;
2424
use Symfony\Bundle\FrameworkBundle\KernelBrowser;
25-
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
2625
use Symfony\Component\HttpFoundation\Response;
2726

28-
final class MetadataControllerTest extends WebTestCase
27+
final class MetadataControllerTest extends FunctionalWebTestCase
2928
{
3029
public function tearDown(): void
3130
{

tests/functional/OpenConext/EngineBlockBundle/Controller/MonitorControllerTest.php

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

2121
use PHPUnit\Framework\Attributes\Group;
2222
use PHPUnit\Framework\Attributes\Test;
23-
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
2423
use Symfony\Component\HttpFoundation\Response;
2524

26-
final class MonitorControllerTest extends WebTestCase
25+
final class MonitorControllerTest extends FunctionalWebTestCase
2726
{
2827
#[Test]
2928
#[Group('Monitor')]
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<?php
2+
3+
/**
4+
* Copyright 2026 SURFnet B.V.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
namespace OpenConext\EngineBlockBundle\Tests;
20+
21+
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
22+
23+
/**
24+
* Base class for functional tests.
25+
*
26+
* Symfony's ErrorHandler::register() installs a set_exception_handler() during
27+
* kernel boot (debug mode) that is intentionally never restored. PHPUnit 11
28+
* tracks exception handler stack depth before and after each test and marks the
29+
* test as risky when the count differs. Restoring after kernel shutdown brings
30+
* the stack back to the state PHPUnit observed before the test ran.
31+
*/
32+
abstract class FunctionalWebTestCase extends WebTestCase
33+
{
34+
protected function tearDown(): void
35+
{
36+
parent::tearDown();
37+
restore_exception_handler();
38+
}
39+
}

0 commit comments

Comments
 (0)