Skip to content

Commit ba691ca

Browse files
authored
Merge pull request #47 from aaajeetee/main
Support for PHPUnit 11
2 parents 18d599f + 966854f commit ba691ca

File tree

5 files changed

+9
-13
lines changed

5 files changed

+9
-13
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
],
1212
"require": {
1313
"php": "~8.1.0 || ~8.2.0 || ~8.3.0",
14-
"phpunit/phpunit": "^10.0"
14+
"phpunit/phpunit": "^10.0 || ^11.0"
1515
},
1616
"autoload": {
1717
"psr-4": {

tests/AnnotationExtensionTest.php

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

44
namespace Zalas\PHPUnit\Globals\Tests;
55

6+
use PHPUnit\Framework\Attributes\Depends;
67
use PHPUnit\Framework\TestCase;
78

89
/**
@@ -111,9 +112,7 @@ public function test_it_backups_the_state(): void
111112
$this->assertSame('foobar', \getenv('USER'));
112113
}
113114

114-
/**
115-
* @depends test_it_backups_the_state
116-
*/
115+
#[Depends('test_it_backups_the_state')]
117116
public function test_it_cleans_up_after_itself(): void
118117
{
119118
$this->assertArrayNotHasKey('FOO', $_ENV);

tests/AttributeExtensionNoAttributesTest.php

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

44
namespace Zalas\PHPUnit\Globals\Tests;
55

6+
use PHPUnit\Framework\Attributes\Depends;
67
use PHPUnit\Framework\TestCase;
78

89
/**
@@ -21,9 +22,7 @@ public function test_it_backups_the_state()
2122
$this->assertArrayHasKey('BAR', $_SERVER);
2223
}
2324

24-
/**
25-
* @depends test_it_backups_the_state
26-
*/
25+
#[Depends('test_it_backups_the_state')]
2726
public function test_it_cleans_up_after_itself()
2827
{
2928
$this->assertArrayNotHasKey('FOO', $_ENV);

tests/AttributeExtensionTest.php

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

44
namespace Zalas\PHPUnit\Globals\Tests;
55

6+
use PHPUnit\Framework\Attributes\Depends;
67
use PHPUnit\Framework\TestCase;
78
use Zalas\PHPUnit\Globals\Attribute\Env;
89
use Zalas\PHPUnit\Globals\Attribute\Putenv;
@@ -102,9 +103,7 @@ public function test_it_backups_the_state(): void
102103
$this->assertSame('foobar', \getenv('USER'));
103104
}
104105

105-
/**
106-
* @depends test_it_backups_the_state
107-
*/
106+
#[Depends('test_it_backups_the_state')]
108107
public function test_it_cleans_up_after_itself(): void
109108
{
110109
$this->assertArrayNotHasKey('FOO', $_ENV);

tests/AttributeExtensionWithDataProviderTest.php

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

44
namespace Zalas\PHPUnit\Globals\Tests;
55

6+
use PHPUnit\Framework\Attributes\DataProvider;
67
use PHPUnit\Framework\TestCase;
78

89
class AttributeExtensionWithDataProviderTest extends TestCase
910
{
10-
/**
11-
* @dataProvider provider
12-
*/
11+
#[DataProvider('provider')]
1312
public function test_it_handles_dataproviders()
1413
{
1514
$this->assertTrue(true, 'It lets the test cases run normally');

0 commit comments

Comments
 (0)