Skip to content

Pest v4 architecture testing php preset throws Class "Spoofchecker" not found #1509

@paulshryock

Description

@paulshryock

Summary

After upgrading to Pest 4.x, arch()->preset()->php() throws the following error:

Class "Spoofchecker" not found

Versions

php --version
PHP 8.4.11 (cli) (built: Aug  4 2025 20:47:15) (NTS)
Copyright (c) The PHP Group
Built by https://github.com/docker-library/php
Zend Engine v4.4.11, Copyright (c) Zend Technologies
    with Zend OPcache v8.4.11, Copyright (c), by Zend Technologies

./vendor/bin/pest --version
Pest Testing Framework 4.0.4.

Test file

<?php

declare(strict_types=1);

describe('ensure we are not using side-effect or deprecated functions', fn() =>
  arch()->preset()->php());

Test output

FAILED  Tests\php\Architecture\ArchitectureTest > `ensure we are n…  Error   

Class "Spoofchecker" not found
at tests/php/Architecture/ArchitectureTest.php:6

  5▕ describe('ensure we are not using side-effect or deprecated functions', fn() =>
➜ 6▕  arch()->preset()->php());

1   tests/php/Architecture/ArchitectureTest.php:6

Tests:    1 failed, 0 passed (1 assertions)
Duration: 2.31s

Note

It "works on my machine", but the error is thrown when I run pest on the composer/composer:2.8 Docker image (which is based on the latest PHP 8 Alpine image, with Composer installed) in a continuous integration pipeline.

Before upgrading to Pest v4, this was never an issue.

What I've tried

composer require --dev ext-intl:^8.4
apk add icu-dev
docker-php-ext-configure intl
docker-php-ext-install intl
docker-php-ext-enable intl
composer install

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions