From 76d6c4ef9084b2bf14c05773cd5f5fa2d606ed88 Mon Sep 17 00:00:00 2001
From: philipp lang <philipp@aweos.de>
Date: Sun, 20 Oct 2024 18:25:17 +0200
Subject: [PATCH] Add testable macro for setArray

---
 tests/TestCase.php | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/tests/TestCase.php b/tests/TestCase.php
index 555f2c4a..c5ea0be2 100644
--- a/tests/TestCase.php
+++ b/tests/TestCase.php
@@ -12,6 +12,7 @@ use Illuminate\Support\Arr;
 use Illuminate\Support\Facades\Http;
 use Illuminate\Testing\AssertableJsonString;
 use Illuminate\Testing\TestResponse;
+use Livewire\Features\SupportTesting\Testable;
 use Phake;
 use PHPUnit\Framework\Assert;
 use Tests\Lib\MakesHttpCalls;
@@ -171,5 +172,14 @@ class TestCase extends BaseTestCase
 
             return $this;
         });
+
+        Testable::macro('setArray', function ($attributes) {
+            $self = $this;
+            foreach ($attributes as $key => $value) {
+                $self = $this->set($key, $value);
+            }
+
+            return $self;
+        });
     }
 }