mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 05:34:06 -08:00
Improve scenario naming
This commit is contained in:
parent
5567a1e9ac
commit
1935a4aca3
|
@ -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,46 +85,54 @@ class AssetCheckoutTest extends TestCase
|
||||||
public function checkoutTargets(): array
|
public function checkoutTargets(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'User' => [function () {
|
'Checkout to User' => [
|
||||||
$userLocation = Location::factory()->create();
|
function () {
|
||||||
$user = User::factory()->for($userLocation)->create();
|
$userLocation = Location::factory()->create();
|
||||||
|
$user = User::factory()->for($userLocation)->create();
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'checkout_type' => 'user',
|
'checkout_type' => 'user',
|
||||||
'target' => $user,
|
'target' => $user,
|
||||||
'expected_location' => $userLocation,
|
'expected_location' => $userLocation,
|
||||||
];
|
];
|
||||||
}],
|
}
|
||||||
'Asset without location set' => [function () {
|
],
|
||||||
$rtdLocation = Location::factory()->create();
|
'Checkout to Asset without location set' => [
|
||||||
$asset = Asset::factory()->for($rtdLocation, 'defaultLoc')->create(['location_id' => null]);
|
function () {
|
||||||
|
$rtdLocation = Location::factory()->create();
|
||||||
|
$asset = Asset::factory()->for($rtdLocation, 'defaultLoc')->create(['location_id' => null]);
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'checkout_type' => 'asset',
|
'checkout_type' => 'asset',
|
||||||
'target' => $asset,
|
'target' => $asset,
|
||||||
'expected_location' => $rtdLocation,
|
'expected_location' => $rtdLocation,
|
||||||
];
|
];
|
||||||
}],
|
}
|
||||||
'Asset with location set' => [function () {
|
],
|
||||||
$rtdLocation = Location::factory()->create();
|
'Checkout to Asset with location set' => [
|
||||||
$location = Location::factory()->create();
|
function () {
|
||||||
$asset = Asset::factory()->for($location)->for($rtdLocation, 'defaultLoc')->create();
|
$rtdLocation = Location::factory()->create();
|
||||||
|
$location = Location::factory()->create();
|
||||||
|
$asset = Asset::factory()->for($location)->for($rtdLocation, 'defaultLoc')->create();
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'checkout_type' => 'asset',
|
'checkout_type' => 'asset',
|
||||||
'target' => $asset,
|
'target' => $asset,
|
||||||
'expected_location' => $location,
|
'expected_location' => $location,
|
||||||
];
|
];
|
||||||
}],
|
}
|
||||||
'Location' => [function () {
|
],
|
||||||
$location = Location::factory()->create();
|
'Checkout to Location' => [
|
||||||
|
function () {
|
||||||
|
$location = Location::factory()->create();
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'checkout_type' => 'location',
|
'checkout_type' => 'location',
|
||||||
'target' => $location,
|
'target' => $location,
|
||||||
'expected_location' => $location,
|
'expected_location' => $location,
|
||||||
];
|
];
|
||||||
}],
|
}
|
||||||
|
],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue