pest icon indicating copy to clipboard operation
pest copied to clipboard

feat: Add ability to extend `TestCall` to create custom chained helpers

Open JHWelch opened this issue 1 year ago • 0 comments

What:

  • [ ] Bug Fix
  • [X] New Feature

Description:

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

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

I had this idea after discussing on Pinkary and realize this was not currently a way Pest could be extended.

This opens up the framework for a whole new area of extensibility.

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

JHWelch avatar Sep 19 '24 21:09 JHWelch