3
0
mirror of https://github.com/snipe/snipe-it.git synced 2026-08-18 03:06:23 +00:00

One more attempt at tests

This was failing on GH but not locally

- Locally + SQLite + LazilyRefreshDatabase: Asset::factory()->create() typically gets id=1 (SQLite handles auto-increment inside the rollback-per-test transaction differently). My assoc array [$target->id => '1'] happens to have value '1' which matches the id. Loop runs. Test passes.

- MySQL CI full-suite: AUTO_INCREMENT doesn't reset on transaction rollback. After ~2900 tests, my Asset lands at id=2953 (or similar high number). WHERE id IN ('1') matches nothing. Loop skips my asset. Notes never gets updated. Test fails.
This commit is contained in:
snipe
2026-07-22 13:58:06 +01:00
parent a05bbcc2a7
commit 3e00096255

View File

@ -34,7 +34,7 @@ class FmcsStrictBulkAssetEditTest extends TestCase
$this->actingAs($actor)
->post(route('hardware/bulksave'), [
'ids' => [$target->id => '1'],
'ids' => [$target->id],
'company_id' => 'clear',
'bulk_actions' => 'edit',
]);
@ -56,7 +56,7 @@ class FmcsStrictBulkAssetEditTest extends TestCase
$this->actingAs($actor)
->post(route('hardware/bulksave'), [
'ids' => [$target->id => '1'],
'ids' => [$target->id],
'company_id' => 'clear',
'bulk_actions' => 'edit',
]);
@ -92,7 +92,7 @@ class FmcsStrictBulkAssetEditTest extends TestCase
$response = $this->actingAs($actor)
->post(route('hardware/bulksave'), [
'ids' => [$target->id => '1'],
'ids' => [$target->id],
'notes' => 'after',
'bulk_actions' => 'edit',
]);