From 7bc087c3d6533c0ce4cc071aedcd9f6f52df82b3 Mon Sep 17 00:00:00 2001 From: Adam Kiss Date: Mon, 17 Nov 2025 13:17:59 +0100 Subject: [PATCH] Tests: Test fallthrough expressions / dynamic fallthrough expressions --- .../view/tests/FallthroughAttributesTest.php | 40 +++++++++++++++++++ .../view/tests/Fixtures/fallthrough.view.php | 7 ++++ .../x-fallthrough-dynamic-test.view.php | 1 + .../Fixtures/x-fallthrough-test.view.php | 1 + 4 files changed, 49 insertions(+) create mode 100644 packages/view/tests/FallthroughAttributesTest.php create mode 100644 packages/view/tests/Fixtures/fallthrough.view.php create mode 100644 packages/view/tests/Fixtures/x-fallthrough-dynamic-test.view.php create mode 100644 packages/view/tests/Fixtures/x-fallthrough-test.view.php diff --git a/packages/view/tests/FallthroughAttributesTest.php b/packages/view/tests/FallthroughAttributesTest.php new file mode 100644 index 000000000..546c47aa1 --- /dev/null +++ b/packages/view/tests/FallthroughAttributesTest.php @@ -0,0 +1,40 @@ +addViewComponents( + __DIR__ . '/Fixtures/x-fallthrough-test.view.php', + __DIR__ . '/Fixtures/x-fallthrough-dynamic-test.view.php', + ); + + $renderer = + TempestViewRenderer::make( + viewConfig: $viewConfig, + ); + + $html = $renderer->render( + view(__DIR__ . '/Fixtures/fallthrough.view.php'), + ); + + $this->assertEquals(<<<'HTML' +
+
+
+
+ HTML, $html); + } +} diff --git a/packages/view/tests/Fixtures/fallthrough.view.php b/packages/view/tests/Fixtures/fallthrough.view.php new file mode 100644 index 000000000..0eb074bcd --- /dev/null +++ b/packages/view/tests/Fixtures/fallthrough.view.php @@ -0,0 +1,7 @@ + + + + \ No newline at end of file diff --git a/packages/view/tests/Fixtures/x-fallthrough-dynamic-test.view.php b/packages/view/tests/Fixtures/x-fallthrough-dynamic-test.view.php new file mode 100644 index 000000000..d1a2d559a --- /dev/null +++ b/packages/view/tests/Fixtures/x-fallthrough-dynamic-test.view.php @@ -0,0 +1 @@ +
\ No newline at end of file diff --git a/packages/view/tests/Fixtures/x-fallthrough-test.view.php b/packages/view/tests/Fixtures/x-fallthrough-test.view.php new file mode 100644 index 000000000..85142b6f9 --- /dev/null +++ b/packages/view/tests/Fixtures/x-fallthrough-test.view.php @@ -0,0 +1 @@ +
\ No newline at end of file