Skip to content

A free open source IT asset/license management system

Cleanups

Marcus Mooree7e48c8f03dc
diff --git a/tests/Feature/Notifications/Email/BulkCheckoutEmailTest.php b/tests/Feature/Notifications/Email/BulkCheckoutEmailTest.php
index e2b6016535..5c8b7d832d 100644
--- a/tests/Feature/Notifications/Email/BulkCheckoutEmailTest.php
+++ b/tests/Feature/Notifications/Email/BulkCheckoutEmailTest.php
@@ -8,6 +8,8 @@ use App\Models\Asset;
use App\Models\Category;
use App\Models\Location;
use App\Models\User;
+use Illuminate\Database\Eloquent\Model;
+use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Mail;
use PHPUnit\Framework\Attributes\Group;
use RuntimeException;
@@ -16,9 +18,8 @@ use Tests\TestCase;
#[Group('notifications')]
class BulkCheckoutEmailTest extends TestCase
{
- private $assets;
- private $target;
- private $admin;
+ private Collection $assets;
+ private Model $target;
protected function setUp(): void
{
@@ -31,7 +32,6 @@ class BulkCheckoutEmailTest extends TestCase
$this->assets = Asset::factory()->requiresAcceptance()->count(2)->create();
$this->target = User::factory()->create(['email' => '[email protected]']);
- $this->admin = User::factory()->checkoutAssets()->viewAssets()->create();
}
public function test_email_is_sent_to_user()
@@ -247,7 +247,7 @@ class BulkCheckoutEmailTest extends TestCase
default => [],
};
- $this->actingAs($this->admin)
+ $this->actingAs(User::factory()->checkoutAssets()->viewAssets()->create())
->followingRedirects()
->post(route('hardware.bulkcheckout.store'), [
'selected_assets' => $this->assets->pluck('id')->toArray(),