Skip to content

Commit 64dd988

Browse files
authored
Add toHaveSuspiciousCharacters documentation
Notes that the `intl` PHP extension is required and updates the source code URL to point to the 4.x branch, which includes the new expectation.
1 parent ffce7f1 commit 64dd988

1 file changed

Lines changed: 17 additions & 1 deletion

File tree

arch-testing.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ Granular expectations allow you to define specific architectural rules for your
7878
- [`toHavePublicMethods()`](#expect-toHavePublicMethods)
7979
- [`toHavePrefix()`](#expect-toHavePrefix)
8080
- [`toHaveSuffix()`](#expect-toHaveSuffix)
81+
- [`toHaveSuspiciousCharacters()`](#expect-toHaveSuspiciousCharacters)
8182
- [`toHaveConstructor()`](#expect-toHaveConstructor)
8283
- [`toHaveDestructor()`](#expect-toHaveDestructor)
8384
- [`toOnlyImplement()`](#expect-toOnlyImplement)
@@ -458,6 +459,19 @@ arch('app')
458459
->toHaveSuffix('Controller');
459460
```
460461

462+
<a name="expect-toHaveSuspiciousCharacters"></a>
463+
### `toHaveSuspiciousCharacters()`
464+
465+
The `toHaveSuspiciousCharacters()` method may be used to help you identify potential suspicious characters in your code.
466+
467+
```php
468+
arch('app')
469+
->expect('App\Http\Controllers')
470+
->not->toHaveSuspiciousCharacters();
471+
```
472+
473+
This expectation requires the `intl` PHP extension.
474+
461475
<a name="expect-toHaveConstructor"></a>
462476
### `toHaveConstructor()`
463477

@@ -619,7 +633,9 @@ It avoids the usage of `die`, `var_dump`, and similar functions, and ensures you
619633
arch()->preset()->php();
620634
```
621635

622-
You may find all the expectations included in the `php` preset below in our [source code](https://github.com/pestphp/pest/blob/3.x/src/ArchPresets/Php.php).
636+
You may find all the expectations included in the `php` preset below in our [source code](https://github.com/pestphp/pest/blob/4.x/src/ArchPresets/Php.php).
637+
638+
This preset requires the `intl` PHP extension.
623639

624640
<a name="preset-security"></a>
625641
### `security`

0 commit comments

Comments
 (0)