Skip to content

A free open source IT asset/license management system

Fix assertion

Marcus Moore5d368990dc3e
diff --git a/tests/Feature/Api/Assets/AssetCheckoutTest.php b/tests/Feature/Api/Assets/AssetCheckoutTest.php
index a73bbc708c..22afb966b4 100644
--- a/tests/Feature/Api/Assets/AssetCheckoutTest.php
+++ b/tests/Feature/Api/Assets/AssetCheckoutTest.php
@@ -105,7 +105,7 @@ class AssetCheckoutTest extends TestCase
return [
'checkout_type' => 'asset',
'target' => $asset,
- 'expected_location' => $rtdLocation,
+ 'expected_location' => null,
];
}
],
@@ -158,12 +158,15 @@ class AssetCheckoutTest extends TestCase
$asset->refresh();
$this->assertTrue($asset->assignedTo()->is($target));
- $this->assertTrue($asset->location->is($expectedLocation));
$this->assertEquals('Changed Name', $asset->name);
$this->assertTrue($asset->assetstatus->is($newStatus));
$this->assertEquals('2024-04-01 00:00:00', $asset->last_checkout);
$this->assertEquals('2024-04-08 00:00:00', (string)$asset->expected_checkin);
+ $expectedLocation
+ ? $this->assertTrue($asset->location->is($expectedLocation))
+ : $this->assertNull($asset->location);
+
Event::assertDispatched(CheckoutableCheckedOut::class, 1);
Event::assertDispatched(function (CheckoutableCheckedOut $event) use ($admin, $asset, $target) {
return $event->checkoutable->is($asset)