mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 21:54:14 -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,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,
|
||||||
];
|
];
|
||||||
}],
|
}
|
||||||
|
],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue