Skip to content

Add the ability to extend TestCall#1693

Open
JHWelch wants to merge 1 commit into
pestphp:4.xfrom
JHWelch:extend-testcase
Open

Add the ability to extend TestCall#1693
JHWelch wants to merge 1 commit into
pestphp:4.xfrom
JHWelch:extend-testcase

Conversation

@JHWelch
Copy link
Copy Markdown
Contributor

@JHWelch JHWelch commented May 6, 2026

What:

  • Bug Fix
  • New Feature

Description:

This is another go at the change in #126. I know you closed that getting ready for V4.

This feels like the missing piece of enabling making really powerful Pest extensions that can just be chained off of existing tests.

Adds the ability to ->extend(...) TestCall in the same fashion that expectations are extendable.

test()->extend('fooBar', function () {
    return $this->with([
        'foo',
        'bar',
    ]);
});

If this is something you want to add, I can PR the docs repo wherever makes sense.

If you don't think you'll ever have an appetite for this let me know and I won't PR again.

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.

1 participant