Skip to content

[5.x] AddonTestCase breaking due to calling addToAssertionCount with a negative parameter #14446

@BobWez98

Description

@BobWez98

Bug description

Title says it all really. The error thrown is:

1) <redacted>\ImportTranslationKeysTest::it_can_create_translation_keys
assert($count >= 0)

1) <redacted>/vendor/statamic/cms/src/Testing/AddonTestCase.php:36

This is because $this->addToAssertionCount(-1); is called with a negative integer.

How to reproduce

Run php please make:addon and run the tests in the addon.

When downgraded to:

"orchestra/testbench": "^9.10",
"phpunit/phpunit": "^10.5"

There's no problem at all.

Environment

Environment
Application Name: Statamic
Laravel Version: 12.56.0
PHP Version: 8.4.18
Composer Version: 2.8.12
Environment: local
Debug Mode: ENABLED
URL: statamic.test
Maintenance Mode: OFF
Timezone: UTC
Locale: en

Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: NOT CACHED

Drivers
Broadcasting: log
Cache: file
Database: mysql
Logs: stack / single
Mail: log
Queue: redis
Session: database

Storage
public/storage: NOT LINKED

Sentry
Enabled: MISSING DSN
Environment: local
Laravel SDK Version: 4.21.1
PHP SDK Version: 4.21.0
Release: NOT SET
Sample Rate Errors: 100%
Sample Rate Performance Monitoring: 100%
Sample Rate Profiling: NOT SET
Send Default PII: ENABLED

Statamic
Addons: 11
Sites: 12 (Trucks Nederland, Trucks België | Nederlands, Trucks International | English, and 9 more)
Stache Watcher: Enabled (auto)
Static Caching: Disabled
Version: 5.73.17 PRO

Statamic Addons
appswithlove/statamic-one-click-content-translation: 5.2.3
just-better/bard-suggestions: dev-1061
just-better/translations-overview: dev--1061
just-better/url-reference-updater: dev--1061
justbetter/lost-in-translation: dev--1061
justbetter/statamic-entry-translator: 0.0.1
justbetter/statamic-structured-data: 1.4.0
markkravchuk/statamic-activity-book: 1.0.1
statamic/eloquent-driver: 4.36.1
statamic/importer: 1.8.4
visuellverstehen/statamic-anchor-navigation: 1.0.0

Statamic Eloquent Driver
Asset Containers: file
Assets: eloquent
Blueprints: file
Collection Trees: eloquent
Collections: file
Entries: eloquent
Fieldsets: file
Form Submissions: file
Forms: file
Global Sets: file
Global Variables: eloquent
Navigation Trees: eloquent
Navigations: file
Revisions: eloquent
Sites: file
Taxonomies: file
Terms: eloquent
Tokens: file

Installation

Fresh statamic/statamic site via CLI

Additional details

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions