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

1.3.16 throwing errors on arrays after assertCount #206

Open
acbramley opened this issue Feb 28, 2024 · 1 comment
Open

1.3.16 throwing errors on arrays after assertCount #206

acbramley opened this issue Feb 28, 2024 · 1 comment

Comments

@acbramley
Copy link

Our automated updates updated to 1.3.16 today and started failing phpstan. Based on the changes from 1.3.15 it's obvious what the issue is.

Our tests do something like this:

    $mails = $this->getMails();
    $this->assertCount(1, $mails);
    $mail = \reset($mails);
    $this->assertStringContainsString('foo', $mail['subject']);

Where getMails returns an array.

And this is throwing errors like Cannot access offset 'subject' on false.

@ondrejmirtes
Copy link
Member

Can you put it some dumptType calls to see what's happening with the types? See https://phpstan.org/user-guide/troubleshooting-types#debugging

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

No branches or pull requests

2 participants