dillingham / nova-assertions

Laravel Nova assertions for your tests
MIT License
79 stars 16 forks source link

AssertFields has an Error #19

Open asivaneswaran opened 3 years ago

asivaneswaran commented 3 years ago

The method fieldCheck has an error: PHP Fatal error: During class fetch: Uncaught ErrorException: Required parameter $method follows optional parameter $value in /Users/arasivaneswaran/Documents/repos/ccp-kin-ball-v5/vendor/dillingham/nova-assertions/src/Assert/AssertFields.php:47

protected function fieldCheck($attribute, $value = null, $method)

dillingham commented 3 years ago

@asivaneswaran can you add your test code that you're writing.. thanks 🙏

asivaneswaran commented 3 years ago

Just a classic $response->assertFieldsInclude(['email', 'telephone', 'extension']);

But it's because in AssertFields you have protected function fieldCheck($attribute, $value = null, $method)

Which in PHP 8 is not allowed anymore. $method needs to be nullable or $value needs to be the last parameter.

asivaneswaran commented 3 years ago

I made a PR for the fix: https://github.com/dillingham/nova-assertions/pull/20

martin-ro commented 3 years ago

This PR also fixes the error for me, any chance this will be merged anytime soon?