Skip to content

Commit 60ed828

Browse files
authored
Merge pull request #40 from icanhazstring/fix/readme
Update README
2 parents 204a3be + e321e77 commit 60ed828

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

README.md

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ The extension is also distributed as a PHAR, which can be downloaded from the mo
3737
[Github Release](https://github.com/jakzal/phpunit-globals/releases).
3838

3939
Put the extension in your PHPUnit extensions directory.
40-
Remember to instruct PHPUnit to load extensions in your `phpunit.xml`:
40+
Remember to instruct PHPUnit to load extensions in your `phpunit.xml` using the `extensionsDirectory` attribute:
4141

4242
```xml
4343
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="file://./vendor/phpunit/phpunit/phpunit.xsd"
@@ -52,10 +52,7 @@ Enable the globals attribute extension in your PHPUnit configuration:
5252

5353
```xml
5454
<?xml version="1.0" encoding="UTF-8"?>
55-
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
56-
xsi:noNamespaceSchemaLocation="file://./vendor/phpunit/phpunit/phpunit.xsd"
57-
bootstrap="vendor/autoload.php"
58-
colors="true">
55+
<phpunit ...>
5956

6057
<!-- ... -->
6158

@@ -67,7 +64,7 @@ Enable the globals attribute extension in your PHPUnit configuration:
6764

6865
> If you are using a version before PHP 8.1 you can use the `AnnotationExtension` instead.
6966
70-
Make sure the `AttributeExtension` is registered before any other extensions that might depend on global variables.
67+
Make sure the `AttributeExtension` is **registered before** any other extensions that might depend on global variables.
7168

7269
Global variables can now be defined in attributes:
7370

@@ -77,9 +74,7 @@ use Zalas\PHPUnit\Globals\Attribute\Env;
7774
use Zalas\PHPUnit\Globals\Attribute\Server;
7875
use Zalas\PHPUnit\Globals\Attribute\Putenv;
7976

80-
/**
81-
* @env FOO=bar
82-
*/
77+
#[Env('FOO', 'bar')]
8378
class ExampleTest extends TestCase
8479
{
8580
#[Env('APP_ENV', 'foo')]
@@ -99,7 +94,7 @@ class ExampleTest extends TestCase
9994
}
10095
```
10196

102-
It's also possible to mark a variable as _unset_ so it will not be present in any of the global variables:
97+
It's also possible to mark an attribute with _unset_ so it will not be present in any of the global variables:
10398

10499
```php
105100
use PHPUnit\Framework\TestCase;

0 commit comments

Comments
 (0)