Skip to content

Commit 1d8bd52

Browse files
Merge branch '7.4' into 8.0
* 7.4: replace PHPUnit annotations with attributes
2 parents 586c44e + 13fdf12 commit 1d8bd52

File tree

2 files changed

+7
-15
lines changed

2 files changed

+7
-15
lines changed

Tests/Command/DebugCommandTest.php

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

1212
namespace Symfony\Component\Dotenv\Tests\Command;
1313

14+
use PHPUnit\Framework\Attributes\RunInSeparateProcess;
1415
use PHPUnit\Framework\TestCase;
1516
use Symfony\Component\Console\Application;
1617
use Symfony\Component\Console\Helper\FormatterHelper;
@@ -22,9 +23,7 @@
2223

2324
class DebugCommandTest extends TestCase
2425
{
25-
/**
26-
* @runInSeparateProcess
27-
*/
26+
#[RunInSeparateProcess]
2827
public function testErrorOnUninitializedDotenv()
2928
{
3029
unset($_SERVER['SYMFONY_DOTENV_VARS']);
@@ -38,9 +37,7 @@ public function testErrorOnUninitializedDotenv()
3837
$this->assertStringContainsString('[ERROR] Dotenv component is not initialized', $output);
3938
}
4039

41-
/**
42-
* @runInSeparateProcess
43-
*/
40+
#[RunInSeparateProcess]
4441
public function testEmptyDotEnvVarsList()
4542
{
4643
$_SERVER['SYMFONY_DOTENV_VARS'] = '';
@@ -275,9 +272,7 @@ public function testScenario2InProdEnvWithNameFilterPrefix()
275272
$this->assertStringContainsString('TEST 1234 1234 1234 0000', $output);
276273
}
277274

278-
/**
279-
* @runInSeparateProcess
280-
*/
275+
#[RunInSeparateProcess]
281276
public function testCompletion()
282277
{
283278
$env = 'prod';

Tests/DotenvTest.php

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

1212
namespace Symfony\Component\Dotenv\Tests;
1313

14+
use PHPUnit\Framework\Attributes\DataProvider;
1415
use PHPUnit\Framework\TestCase;
1516
use Symfony\Component\Dotenv\Dotenv;
1617
use Symfony\Component\Dotenv\Exception\FormatException;
1718
use Symfony\Component\Dotenv\Exception\PathException;
1819

1920
class DotenvTest extends TestCase
2021
{
21-
/**
22-
* @dataProvider getEnvDataWithFormatErrors
23-
*/
22+
#[DataProvider('getEnvDataWithFormatErrors')]
2423
public function testParseWithFormatError($data, $error)
2524
{
2625
$dotenv = new Dotenv();
@@ -63,9 +62,7 @@ public static function getEnvDataWithFormatErrors()
6362
return $tests;
6463
}
6564

66-
/**
67-
* @dataProvider getEnvData
68-
*/
65+
#[DataProvider('getEnvData')]
6966
public function testParse($data, $expected)
7067
{
7168
$dotenv = new Dotenv();

0 commit comments

Comments
 (0)