jasonmccreary / laravel-test-assertions

A set of helpful assertions when testing Laravel applications.
321 stars 34 forks source link

Naming conflict with Laravel's `assertNotSoftDeleted` #33

Closed MrMage closed 3 years ago

MrMage commented 3 years ago

https://github.com/laravel/framework/commit/cb72e7b03ce793fa2fbdfc191eea4c680215fe5d has added an implementation of assertNotSoftDeleted to Laravel's InteractsWithDatabase itself. This leads to the following error message when using both traits:

Fatal error: Declaration of JMac\Testing\Traits\AdditionalAssertions::assertNotSoftDeleted(Illuminate\Database\Eloquent\Model $model) must be compatible with Illuminate\Foundation\Testing\TestCase::assertNotSoftDeleted($table, array $data = [], $connection = null, $deletedAtColumn = 'deleted_at') in xxx.php on line yyy

To restore compatibility, I'd suggest to rename or remove the assertNotSoftDeleted method present in this package.

MrMage commented 3 years ago

/cc @mikkoaf

jasonmccreary commented 3 years ago

This was already reported in #30 and #32 and resolved 3 hours after last week's release in #31. Please bump your dependency to ^2.0.

MrMage commented 3 years ago

Thanks for the heads-up! I had only looked at the commit messages and didn't see a mention of this being fixed there.

jasonmccreary commented 3 years ago

Best to check for a newer version first. Or search issues. Commit messages rarely provide a 1:1 relationship with changes.

MrMage commented 3 years ago

I had also checked the release notes of the new version, which don't mention this, either: https://github.com/jasonmccreary/laravel-test-assertions/releases/tag/v2.0.0

Next time I'll search the issues and/or just try the latest version even if it doesn't mention a particular issue, but I would still suggest editing the release notes of v2.0 to at least mention this.

jasonmccreary commented 3 years ago

Good call. I'll tweak the release notes.