Skip to content

Commit 1701a30

Browse files
authored
Merge pull request #1590 from pestphp/feature/intl-exception
feat: show more useful exception when `intl` extension not found
2 parents 064ab3f + b1c997a commit 1701a30

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Expectations/OppositeExpectation.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use Pest\Arch\SingleArchExpectation;
1616
use Pest\Arch\Support\FileLineFinder;
1717
use Pest\Exceptions\InvalidExpectation;
18+
use Pest\Exceptions\MissingDependency;
1819
use Pest\Expectation;
1920
use Pest\Support\Arr;
2021
use Pest\Support\Exporter;
@@ -284,6 +285,10 @@ public function toHaveMethod(array|string $method): ArchExpectation
284285
*/
285286
public function toHaveSuspiciousCharacters(): ArchExpectation
286287
{
288+
if (! class_exists(Spoofchecker::class)) {
289+
throw new MissingDependency(__FUNCTION__, 'ext-intl >= 2.0');
290+
}
291+
287292
$checker = new Spoofchecker;
288293

289294
/** @var Expectation<array<int, string>|string> $original */

0 commit comments

Comments
 (0)