Improve scenario naming

This commit is contained in:
Marcus Moore 2024-05-22 12:47:33 -07:00
parent 5567a1e9ac
commit 1935a4aca3
No known key found for this signature in database

View file

@ -13,7 +13,6 @@ use Tests\TestCase;
class AssetCheckoutTest extends TestCase class AssetCheckoutTest extends TestCase
{ {
protected function setUp(): void protected function setUp(): void
{ {
parent::setUp(); parent::setUp();
@ -86,7 +85,8 @@ class AssetCheckoutTest extends TestCase
public function checkoutTargets(): array public function checkoutTargets(): array
{ {
return [ return [
'User' => [function () { 'Checkout to User' => [
function () {
$userLocation = Location::factory()->create(); $userLocation = Location::factory()->create();
$user = User::factory()->for($userLocation)->create(); $user = User::factory()->for($userLocation)->create();
@ -95,8 +95,10 @@ class AssetCheckoutTest extends TestCase
'target' => $user, 'target' => $user,
'expected_location' => $userLocation, 'expected_location' => $userLocation,
]; ];
}], }
'Asset without location set' => [function () { ],
'Checkout to Asset without location set' => [
function () {
$rtdLocation = Location::factory()->create(); $rtdLocation = Location::factory()->create();
$asset = Asset::factory()->for($rtdLocation, 'defaultLoc')->create(['location_id' => null]); $asset = Asset::factory()->for($rtdLocation, 'defaultLoc')->create(['location_id' => null]);
@ -105,8 +107,10 @@ class AssetCheckoutTest extends TestCase
'target' => $asset, 'target' => $asset,
'expected_location' => $rtdLocation, 'expected_location' => $rtdLocation,
]; ];
}], }
'Asset with location set' => [function () { ],
'Checkout to Asset with location set' => [
function () {
$rtdLocation = Location::factory()->create(); $rtdLocation = Location::factory()->create();
$location = Location::factory()->create(); $location = Location::factory()->create();
$asset = Asset::factory()->for($location)->for($rtdLocation, 'defaultLoc')->create(); $asset = Asset::factory()->for($location)->for($rtdLocation, 'defaultLoc')->create();
@ -116,8 +120,10 @@ class AssetCheckoutTest extends TestCase
'target' => $asset, 'target' => $asset,
'expected_location' => $location, 'expected_location' => $location,
]; ];
}], }
'Location' => [function () { ],
'Checkout to Location' => [
function () {
$location = Location::factory()->create(); $location = Location::factory()->create();
return [ return [
@ -125,7 +131,8 @@ class AssetCheckoutTest extends TestCase
'target' => $location, 'target' => $location,
'expected_location' => $location, 'expected_location' => $location,
]; ];
}], }
],
]; ];
} }