Skip to content

Commit aa17940

Browse files
committed
Drop annotation support
1 parent db46362 commit aa17940

8 files changed

+4
-326
lines changed

README.md

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,8 @@ Supported attributes:
99
* `#[Server]` for `$_SERVER`
1010
* `#[Putenv]` for [`putenv()`](http://php.net/putenv)
1111

12-
Supported annotations:
13-
14-
* `@env` and `@unset-env` for `$_ENV`
15-
* `@server` and `@unset-server` for `$_SERVER`
16-
* `@putenv` and `@unset-getenv` for [`putenv()`](http://php.net/putenv)
17-
18-
> Annotations are deprecated since v3.1.0 and will be removed in v3.5.0.
19-
> The latest annotation support is planned to be removed is when PHPUnit 12 is released.
20-
> Annotation support is complete, so if you plan on using them keep using v3.4 of this package.
12+
> Annotations were previously supported up until v3.5.0 (inclusive).
13+
> Annotation support is complete, so if you plan on using them keep using v3.5 of this package.
2114
2215
Global variables are set before each test case is executed,
2316
and brought to the original state after each test case has finished.
@@ -62,8 +55,6 @@ Enable the globals attribute extension in your PHPUnit configuration:
6255
</phpunit>
6356
```
6457

65-
> If you are using a version before PHP 8.1 you can use the `AnnotationExtension` instead.
66-
6758
Make sure the `AttributeExtension` is **registered before** any other extensions that might depend on global variables.
6859

6960
Global variables can now be defined in attributes:

phpunit.xml.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
<env name="USER" value="test" force="true"/>
99
</php>
1010
<extensions>
11-
<bootstrap class="Zalas\PHPUnit\Globals\Tests\Stub\CombinedExtension" />
11+
<bootstrap class="Zalas\PHPUnit\Globals\AttributeExtension" />
1212
</extensions>
1313
</phpunit>

src/AnnotationExtension.php

Lines changed: 0 additions & 23 deletions
This file was deleted.

src/GlobalsAnnotationReader.php

Lines changed: 0 additions & 116 deletions
This file was deleted.

tests/AnnotationExtensionTest.php

Lines changed: 0 additions & 134 deletions
This file was deleted.

tests/Stub/CombinedExtension.php

Lines changed: 0 additions & 30 deletions
This file was deleted.

tests/phar/phpunit.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@
1111
</testsuites>
1212

1313
<extensions>
14-
<bootstrap class="Zalas\PHPUnit\Globals\Tests\Stub\CombinedExtension" />
14+
<bootstrap class="Zalas\PHPUnit\Globals\AttributeExtension" />
1515
</extensions>
1616
</phpunit>

tests/phar/tests/PharTest.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,6 @@
77

88
class PharTest extends TestCase
99
{
10-
/**
11-
* @env APP_ENV=test_foo
12-
* @server APP_DEBUG=1
13-
*/
14-
public function test_it_reads_global_variables_from_method_annotations()
15-
{
16-
$this->assertArraySubset(['APP_ENV' => 'test_foo'], $_ENV);
17-
$this->assertArraySubset(['APP_DEBUG' => '1'], $_SERVER);
18-
}
19-
2010
#[Env("APP_ENV", "test_foo")]
2111
#[Server("APP_DEBUG", "1")]
2212
public function test_it_reads_global_variables_from_method_attributes()

0 commit comments

Comments
 (0)