Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
cyrillkalita opened this issue Mar 23, 2024 · 1 comment
Open

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

cyrillkalita opened this issue Mar 23, 2024 · 1 comment
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@cyrillkalita
Copy link

@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..?

@Wulfheart Wulfheart added enhancement New feature or request good first issue Good for newcomers labels Oct 17, 2024
@Wulfheart
Copy link
Collaborator

I like it and I would merge a PR containing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants