From 64dd988d29402aea3673c4a2001284f029260ca3 Mon Sep 17 00:00:00 2001 From: Paul Shryock Date: Thu, 11 Sep 2025 20:54:38 +0000 Subject: [PATCH 1/2] 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. --- arch-testing.md | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) 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` From a3d6b6be91a3071a594229cc6b82b2c2fa001949 Mon Sep 17 00:00:00 2001 From: Paul Shryock Date: Thu, 11 Sep 2025 20:58:36 +0000 Subject: [PATCH 2/2] Add intl extension requirement to v4 announcement --- pest-v4-is-here-now-with-browser-testing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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