Skip to content

fix: allow --init without a tests directory - #1939

Open
tiagoabsantos wants to merge 1 commit into
pestphp:5.xfrom
tiagoabsantos:fix/1934-init-missing-tests
Open

tiagoabsantos wants to merge 1 commit into
pestphp:5.xfrom
tiagoabsantos:fix/1934-init-missing-tests

Conversation

@tiagoabsantos

Copy link
Copy Markdown

Summary

  • vendor/bin/pest --init on a project with no tests/ directory aborted in BootFiles before TIA registered its State binding.
  • Shutdown still tried to construct the TIA plugin, so the install failed with A dependency with the name [Pest\Plugins\Tia\Contracts\State] cannot be resolved instead of creating the suite.
  • --init now skips that directory check, and plugin termination does not run when boot never finished.

Closes #1934

Test plan

  • tests/Features/Init.php on PHP 8.4: --init creates phpunit.xml and the example tests, and a missing tests/ directory no longer fatals while resolving TIA state
  • Empty project on PHP 8.5: composer require pestphp/pest --dev --with-all-dependencies, then vendor/bin/pest --init

Boot aborted before TIA state was registered, and shutdown then
tried to construct the plugin. That hid the real error behind
"State cannot be resolved" on a fresh install.

Closes pestphp#1934
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Error to install on PHP 8.5.11

1 participant