diff --git a/arch-testing.md b/arch-testing.md index 6a75dea..a652afc 100644 --- a/arch-testing.md +++ b/arch-testing.md @@ -78,6 +78,7 @@ Granular expectations allow you to define specific architectural rules for your - [`toHavePublicMethods()`](#expect-toHavePublicMethods) - [`toHavePrefix()`](#expect-toHavePrefix) - [`toHaveSuffix()`](#expect-toHaveSuffix) +- [`toHaveSuspiciousCharacters()`](#expect-toHaveSuspiciousCharacters) - [`toHaveConstructor()`](#expect-toHaveConstructor) - [`toHaveDestructor()`](#expect-toHaveDestructor) - [`toOnlyImplement()`](#expect-toOnlyImplement) @@ -458,6 +459,19 @@ arch('app') ->toHaveSuffix('Controller'); ``` + +### `toHaveSuspiciousCharacters()` + +The `toHaveSuspiciousCharacters()` method may be used to help you identify potential suspicious characters in your code. + +```php +arch('app') + ->expect('App\Http\Controllers') + ->not->toHaveSuspiciousCharacters(); +``` + +This expectation requires the `intl` PHP extension. + ### `toHaveConstructor()` @@ -619,7 +633,9 @@ It avoids the usage of `die`, `var_dump`, and similar functions, and ensures you arch()->preset()->php(); ``` -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). +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). + +This preset requires the `intl` PHP extension. ### `security` diff --git a/pest-v4-is-here-now-with-browser-testing.md b/pest-v4-is-here-now-with-browser-testing.md index 83335b2..81579ae 100644 --- a/pest-v4-is-here-now-with-browser-testing.md +++ b/pest-v4-is-here-now-with-browser-testing.md @@ -193,7 +193,7 @@ it('does not run on CI', function () { ### Miscellaneous Improvements - You may now use `skipLocally()` or `skipOnCi` to conditionally skip tests based on the environment. -- 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. +- 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. - The expectation `toBeSlug` has been added to help you validate that a string is a valid slug. ### On Top of PHPUnit 12