mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-12 22:37:28 -08:00
Re-add asset factory states
This commit is contained in:
parent
d214bd0b06
commit
751abe1438
|
@ -275,6 +275,37 @@ class AssetFactory extends Factory
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function assignedToUser()
|
||||||
|
{
|
||||||
|
return $this->state(function () {
|
||||||
|
return [
|
||||||
|
'assigned_to' => User::factory(),
|
||||||
|
'assigned_type' => User::class,
|
||||||
|
];
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public function assignedToLocation()
|
||||||
|
{
|
||||||
|
return $this->state(function () {
|
||||||
|
return [
|
||||||
|
'assigned_to' => Location::factory(),
|
||||||
|
'assigned_type' => Location::class,
|
||||||
|
];
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public function assignedToAsset()
|
||||||
|
{
|
||||||
|
return $this->state(function () {
|
||||||
|
return [
|
||||||
|
'model_id' => 1,
|
||||||
|
'assigned_to' => Asset::factory(),
|
||||||
|
'assigned_type' => Asset::class,
|
||||||
|
];
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
public function requiresAcceptance()
|
public function requiresAcceptance()
|
||||||
{
|
{
|
||||||
return $this->state(function () {
|
return $this->state(function () {
|
||||||
|
|
Loading…
Reference in a new issue