Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion arch-testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -458,6 +459,19 @@ arch('app')
->toHaveSuffix('Controller');
```

<a name="expect-toHaveSuspiciousCharacters"></a>
### `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.

<a name="expect-toHaveConstructor"></a>
### `toHaveConstructor()`

Expand Down Expand Up @@ -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.

<a name="preset-security"></a>
### `security`
Expand Down
2 changes: 1 addition & 1 deletion pest-v4-is-here-now-with-browser-testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down