[Bug]: Plugin setup fails

Open
#1,493 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
php
Domain
testing

Research direction

Start with Configuration.php at line 120 and reproduce the failure using the linked pest-plugin-filament-auth repository and the local Composer repository steps. Compare the plugin creation and arch preset documentation with the composer post-autoload-dump path. Done means installing the plugin no longer raises the undefined preset() method error during autoload generation.

Written by the indexing model from the issue text.

Description

bug
What Happened

I followed the plugin creation instructions and added an arch preset.

However, while testing out the plugin on my local, I got this error at the composer autoload dump script:

PHP Fatal error:  Uncaught Error: Call to undefined method Pest\PendingCalls\UsesCall::preset() in /Users/damms005/Herd/tims/vendor/pestphp/pest/src/Configuration.php:120
How to Reproduce
  • Clone the plugin repo to local
  • Install a fresh Laravel app, and setup a local composer repository for the plugin:
 "repositories": [
        {
            "type": "path",
            "url": "/your-local-path-to-the-cloned/pest-plugin-filament-auth",
            "options": {
                "symlink": true
            }
        }
    ]
  • Install the package from the local repository:
composer require --dev damms005/pest-plugin-filament-auth

See error:

// some lines skippe dfor brevity
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
Script Illuminate\Foundation\ComposerScripts::postAutoloadDump handling the post-autoload-dump event terminated with an exception

                                           
  Please run [./vendor/bin/pest] instead.  
                                           

In Configuration.php line 120:
                                                                 
  Call to undefined method Pest\PendingCalls\UsesCall::preset(
Sample Repository

https://github.com/damms005/pest-plugin-filament-auth

Pest Version

latest

PHP Version

8.4.7

Operation System

macOS

Notes

No response

Dominant language
PHP
Stars
11.7k
Forks
538
Avg merge
4d 11h
Merged PRs (30d)
8

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from pestphp/pest

All issues in pestphp/pest

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.