lorisleiva / laravel-actions

⚡️ Laravel components that take care of one specific task
https://laravelactions.com
MIT License
2.49k stars 121 forks source link

Idea: add shouldExpect() to an action mock #278

Open cyrillkalita opened 6 months ago

cyrillkalita commented 6 months ago

@lorisleiva there is a static::shouldRun() method, which is a wrapper around static::mock()->shouldRecieve('handle')

Would you have any reservations to add shouldExpect().. something like:

    /**
     * @return Expectation|ExpectationInterface|ExpectsHigherOrderMessage
     */
    public static function shouldExpect()
    {
        return static::mock()->expects('handle');
    }

I like how expects allows you to both set expectations and evaluate it after..?