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:
@ -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',
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user