Fixed tests

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2024-05-31 02:24:39 +01:00
parent e054fc1ef1
commit 181bafd012

View file

@ -67,7 +67,7 @@ class StoreAssetTest extends TestCase
$this->assertEquals('random_string', $asset->asset_tag); $this->assertEquals('random_string', $asset->asset_tag);
$this->assertEquals($userAssigned->id, $asset->assigned_to); $this->assertEquals($userAssigned->id, $asset->assigned_to);
$this->assertTrue($asset->company->is($company)); $this->assertTrue($asset->company->is($company));
$this->assertEquals('2023-09-03 00:00:00', $asset->last_audit_date->format('Y-m-d H:i:s')); $this->assertEquals('2023-09-03 00:00:00', $asset->last_audit_date);
$this->assertTrue($asset->location->is($location)); $this->assertTrue($asset->location->is($location));
$this->assertTrue($asset->model->is($model)); $this->assertTrue($asset->model->is($model));
$this->assertEquals('A New Asset', $asset->name); $this->assertEquals('A New Asset', $asset->name);
@ -87,7 +87,7 @@ class StoreAssetTest extends TestCase
{ {
$response = $this->actingAsForApi(User::factory()->superuser()->create()) $response = $this->actingAsForApi(User::factory()->superuser()->create())
->postJson(route('api.assets.store'), [ ->postJson(route('api.assets.store'), [
'last_audit_date' => '2023-09-03 12:23:45', 'last_audit_date' => '2023-09-03',
'asset_tag' => '1234', 'asset_tag' => '1234',
'model_id' => AssetModel::factory()->create()->id, 'model_id' => AssetModel::factory()->create()->id,
'status_id' => Statuslabel::factory()->create()->id, 'status_id' => Statuslabel::factory()->create()->id,
@ -96,7 +96,7 @@ class StoreAssetTest extends TestCase
->assertStatusMessageIs('success'); ->assertStatusMessageIs('success');
$asset = Asset::find($response['payload']['id']); $asset = Asset::find($response['payload']['id']);
$this->assertEquals('00:00:00', $asset->last_audit_date->format('H:i:s')); $this->assertEquals('2023-09-03 00:00:00', $asset->last_audit_date);
} }
public function testLastAuditDateCanBeNull() public function testLastAuditDateCanBeNull()