Skip to content

Commit a616300

Browse files
committed
run tests using PHPUnit 11.5
1 parent a0189d0 commit a616300

File tree

4 files changed

+17
-13
lines changed

4 files changed

+17
-13
lines changed

Tests/Loader/CsvFileLoaderTest.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,16 @@
1111

1212
namespace Symfony\Component\Translation\Tests\Loader;
1313

14+
use PHPUnit\Framework\Attributes\Group;
15+
use PHPUnit\Framework\Attributes\IgnoreDeprecations;
1416
use PHPUnit\Framework\TestCase;
15-
use Symfony\Bridge\PhpUnit\ExpectUserDeprecationMessageTrait;
1617
use Symfony\Component\Config\Resource\FileResource;
1718
use Symfony\Component\Translation\Exception\InvalidResourceException;
1819
use Symfony\Component\Translation\Exception\NotFoundResourceException;
1920
use Symfony\Component\Translation\Loader\CsvFileLoader;
2021

2122
class CsvFileLoaderTest extends TestCase
2223
{
23-
use ExpectUserDeprecationMessageTrait;
24-
2524
public function testLoad()
2625
{
2726
$loader = new CsvFileLoader();
@@ -58,9 +57,8 @@ public function testLoadNonLocalResource()
5857
(new CsvFileLoader())->load('http://example.com/resources.csv', 'en', 'domain1');
5958
}
6059

61-
/**
62-
* @group legacy
63-
*/
60+
#[IgnoreDeprecations]
61+
#[Group('legacy')]
6462
public function testEscapeCharInCsvControlIsDeprecated()
6563
{
6664
$loader = new CsvFileLoader();

Tests/TranslatableTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
namespace Symfony\Component\Translation\Tests;
1313

14+
use PHPUnit\Framework\Attributes\Group;
15+
use PHPUnit\Framework\Attributes\IgnoreDeprecations;
1416
use PHPUnit\Framework\TestCase;
1517
use Symfony\Component\Translation\Loader\ArrayLoader;
1618
use Symfony\Component\Translation\TranslatableMessage;
@@ -42,9 +44,8 @@ public function testFlattenedTrans($expected, $messages, $translatable)
4244
$this->assertSame($expected, $translatable->trans($translator, 'fr'));
4345
}
4446

45-
/**
46-
* @group legacy
47-
*/
47+
#[IgnoreDeprecations]
48+
#[Group('legacy')]
4849
public function testToString()
4950
{
5051
$this->assertSame('Symfony is great!', (string) new TranslatableMessage('Symfony is great!'));

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"require": {
1919
"php": ">=8.2",
2020
"symfony/polyfill-mbstring": "~1.0",
21-
"symfony/translation-contracts": "^2.5|^3.0",
21+
"symfony/translation-contracts": "^2.5.3|^3.3",
2222
"symfony/deprecation-contracts": "^2.5|^3"
2323
},
2424
"require-dev": {

phpunit.xml.dist

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22

33
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/9.3/phpunit.xsd"
4+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.3/phpunit.xsd"
55
backupGlobals="false"
66
colors="true"
77
bootstrap="vendor/autoload.php"
8+
failOnDeprecation="true"
89
failOnRisky="true"
910
failOnWarning="true"
1011
>
@@ -18,13 +19,17 @@
1819
</testsuite>
1920
</testsuites>
2021

21-
<coverage>
22+
<source ignoreSuppressionOfDeprecations="true">
2223
<include>
2324
<directory>./</directory>
2425
</include>
2526
<exclude>
2627
<directory>./Tests</directory>
2728
<directory>./vendor</directory>
2829
</exclude>
29-
</coverage>
30+
</source>
31+
32+
<extensions>
33+
<bootstrap class="Symfony\Bridge\PhpUnit\SymfonyExtension" />
34+
</extensions>
3035
</phpunit>

0 commit comments

Comments
 (0)