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

Include method name in toHaveMethod error message #1194

Merged
merged 1 commit into from
Jul 20, 2024
Merged

Include method name in toHaveMethod error message #1194

merged 1 commit into from
Jul 20, 2024

Conversation

dmason30
Copy link
Contributor

What:

  • Bug Fix
  • New Feature

Description:

Currently when using toHaveMethod the method name is not included in the assertion error message. Take for example the test below:

arch('all policies have required methods')
    ->expect('App\Policies')
    ->toHaveMethod('viewAny')
    ->toHaveMethod('view')
    ->toHaveMethod('create')
    ->toHaveMethod('update')
    ->toHaveMethod('delete')
    ->toHaveMethod('forceDelete')
    ->toHaveMethod('restore');

Before

Expecting 'app/Policies/UserPolicy.php' to have method.

After

Expecting 'app/Policies/UserPolicy.php' to have method 'viewAny'.

@dmason30
Copy link
Contributor Author

The CI failures are unrelated to my changes.

@nunomaduro nunomaduro merged commit 6a8a4f3 into pestphp:2.x Jul 20, 2024
2 of 32 checks passed
@dmason30 dmason30 deleted the patch-1 branch July 21, 2024 01:42
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.

2 participants