Skip to content

Commit 76540ca

Browse files
authored
Merge pull request #340 from paulshryock/patch-1
Add toHaveSuspiciousCharacters documentation
2 parents ffce7f1 + a3d6b6b commit 76540ca

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

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`

pest-v4-is-here-now-with-browser-testing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ it('does not run on CI', function () {
193193
### Miscellaneous Improvements
194194

195195
- You may now use `skipLocally()` or `skipOnCi` to conditionally skip tests based on the environment.
196-
- The `not->toHaveSuspiciousCharacters()` arch expectation has been added to help you identify potential suspicious characters in your code. This arch expectation is now enabled by default on the `php` arch preset.
196+
- The `not->toHaveSuspiciousCharacters()` arch expectation has been added to help you identify potential suspicious characters in your code. This arch expectation is now enabled by default on the `php` arch preset. This expectation requires the `intl` PHP extension.
197197
- The expectation `toBeSlug` has been added to help you validate that a string is a valid slug.
198198

199199
### On Top of PHPUnit 12

0 commit comments

Comments
 (0)