viewData('page')['props'], $key) ), true); $bindings = is_array($bindings) ? $bindings : [$bindings]; $viewData = is_array($viewData) ? $viewData : [$viewData]; $this->assertInertiaDeepNest($bindings, $viewData); } public function assertComponent(string $component, TestResponse $response) { PHPUnit::assertEquals($component, $response->viewData('page')['component']); } public function assertInertiaDeepNest($should, $is) { foreach ($should as $key => $value) { PHPUnit::assertArrayHasKey($key, $is); if (is_array($value)) { $this->assertInertiaDeepNest($value, $is[$key]); continue; } PHPUnit::assertSame($value, $is[$key]); } } public function inertia(TestResponse $response, string $key) { return data_get($response->viewData('page')['props'], $key); } }