We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ab1f0a7 commit 82e4776Copy full SHA for 82e4776
tests/MiddlewareTest.php
@@ -41,6 +41,24 @@ public function test_the_version_can_be_a_string()
41
]);
42
}
43
44
+ public function test_the_version_can_be_a_closure()
45
+ {
46
+ Inertia::version(function () {
47
+ return md5('Inertia');
48
+ });
49
+
50
+ $request = Request::create('/user/edit', 'GET');
51
+ $request->headers->add(['X-Inertia' => 'true']);
52
+ $request->headers->add(['X-Inertia-Version' => 'b19a24ee5c287f42ee1d465dab77ab37']);
53
54
+ $response = $this->makeMockResponse($request);
55
56
+ $response->assertSuccessful();
57
+ $response->assertJson([
58
+ 'component' => 'User/Edit',
59
+ ]);
60
+ }
61
62
public function test_it_will_instruct_inertia_to_reload_on_a_version_mismatch()
63
{
64
Inertia::version(1234);
0 commit comments