How can I test that a Laravel request parameter (from the mount method) is passed successfully to the Livewire component?
Example:
public function mount()
{
$this->parameters = request()->input();
}
Test:
public function test_mounts_request_parameters()
{
(new Request([], ['foo' => 'bar']));
Livewire::test(LivewireComponent::class)
->assertSet('parameters', ['foo' => 'bar']);
}
Result:
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
Array (
- 'foo' => 'bar'
)