Closed erikn69 closed 1 year ago
I think I found another different bug, on PHP <=8.0
gettype($audit->auditable_id) is always a string, I don't know if it's a sqlite problem, I did make a PR showing this behaivor https://github.com/owen-it/laravel-auditing/pull/776
1) OwenIt\Auditing\Tests\AuditableTest::itFailsToTransitionWhenTheAuditAuditableIdDoesNotMatchTheModelId
Failed asserting that exception message
'Expected Auditable id (integer)2, got (string)1 instead'
contains
'Expected Auditable id (integer)2, got (integer)1 instead'.
So, i add a fix to test this
$audit = $model->audits->last();
$audit->auditable_id = $model->id;
UPDATE: It was a memory sqlite issue on PHP <=8, i rebased this PR, https://github.com/owen-it/laravel-auditing/issues/709#issuecomment-1463975547
Right! - This patches the problem. I'm in favour
Closes #709 UPDATE: Test added, rebased