mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-24 04:03:34 -08:00
Fix assertion
This commit is contained in:
parent
1935a4aca3
commit
5d368990dc
|
@ -105,7 +105,7 @@ class AssetCheckoutTest extends TestCase
|
||||||
return [
|
return [
|
||||||
'checkout_type' => 'asset',
|
'checkout_type' => 'asset',
|
||||||
'target' => $asset,
|
'target' => $asset,
|
||||||
'expected_location' => $rtdLocation,
|
'expected_location' => null,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
@ -158,12 +158,15 @@ class AssetCheckoutTest extends TestCase
|
||||||
|
|
||||||
$asset->refresh();
|
$asset->refresh();
|
||||||
$this->assertTrue($asset->assignedTo()->is($target));
|
$this->assertTrue($asset->assignedTo()->is($target));
|
||||||
$this->assertTrue($asset->location->is($expectedLocation));
|
|
||||||
$this->assertEquals('Changed Name', $asset->name);
|
$this->assertEquals('Changed Name', $asset->name);
|
||||||
$this->assertTrue($asset->assetstatus->is($newStatus));
|
$this->assertTrue($asset->assetstatus->is($newStatus));
|
||||||
$this->assertEquals('2024-04-01 00:00:00', $asset->last_checkout);
|
$this->assertEquals('2024-04-01 00:00:00', $asset->last_checkout);
|
||||||
$this->assertEquals('2024-04-08 00:00:00', (string)$asset->expected_checkin);
|
$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(CheckoutableCheckedOut::class, 1);
|
||||||
Event::assertDispatched(function (CheckoutableCheckedOut $event) use ($admin, $asset, $target) {
|
Event::assertDispatched(function (CheckoutableCheckedOut $event) use ($admin, $asset, $target) {
|
||||||
return $event->checkoutable->is($asset)
|
return $event->checkoutable->is($asset)
|
||||||
|
|
Loading…
Reference in a new issue