'portal-dark']) === '/web-app-starter/?theme=portal-dark', 'root theme link omits the empty route segment'); test_assert(URL::Link('themes', ['theme' => 'portal-dark']) === '/web-app-starter/?themes&theme=portal-dark', 'named route links keep the route segment and query parameters'); test_assert(component_exists('components/example/theme-switcher'), 'component existence works for explicit component paths'); test_assert(component_exists('example/theme-switcher'), 'component existence works for shorthand component paths'); test_assert(component_exists('callable-fixture'), 'component existence works for caller-relative components directory'); test_assert(component_exists('basic/action-button'), 'action-button component exists'); test_assert(component_exists('basic/info-pill'), 'info-pill component exists'); test_assert(component_exists('navigation/tile-grid'), 'tile-grid component exists'); $callable_fixture_html = component('callable-fixture'); test_assert(str_contains($callable_fixture_html, 'callable fixture'), 'ERP-style callable component files render through the default render method'); $multi_fixture_html = component_call('multi-fixture', 'custom'); test_assert(str_contains($multi_fixture_html, 'custom fixture'), 'component_call preserves caller-relative lookup for named render methods'); $action_button_html = component('basic/action-button', ['label' => 'Load', 'route' => 'toolbox', 'htmx' => true, 'target' => '#target']); test_assert(str_contains($action_button_html, 'hx-get=') && str_contains($action_button_html, '#target'), 'action-button renders htmx-shaped route actions'); $info_pill_html = component('basic/info-pill', ['label' => 'Details', 'content' => 'Escaped hover detail']); test_assert(str_contains($info_pill_html, 'info-pill__trigger') && str_contains($info_pill_html, 'Escaped hover detail'), 'info-pill renders accessible hover detail'); $tile_grid_html = component('navigation/tile-grid', ['items' => [['caption' => 'Themes', 'url' => 'themes']]]); test_assert(str_contains($tile_grid_html, 'tile-grid__tile') && str_contains($tile_grid_html, 'Themes'), 'tile-grid renders reusable navigation tiles'); $theme_switcher_html = component('example/theme-switcher'); test_assert(str_contains($theme_switcher_html, 'theme-switcher'), 'component rendering returns buffered output through the shorthand component API'); ob_start(); $wrapped_theme_switcher_html = component('example/theme-switcher', [':before' => '', ':after' => '']); $component_hook_output = ob_get_clean(); test_assert($wrapped_theme_switcher_html !== '' && $component_hook_output === '', 'component before/after hooks remain compatible with buffered components'); test_assert(short_id('0x1234567890abcdef', 4, 4) === '0x12…cdef', 'short_id compacts long identifiers'); test_assert(str_contains(id_token('0x1234567890abcdef'), 'data-copy='), 'id_token renders a copy-friendly identifier token'); test_assert(str_starts_with(Realtime::live_url('/live/'), 'ws'), 'Realtime::live_url derives a websocket URL'); $missing_broker_result = Realtime::command([['type' => 'list']]); test_assert($missing_broker_result['result'] === false || isset($missing_broker_result['status']), 'Realtime::command returns structured status when broker is unavailable or reachable'); test_assert(Filebase::read_file(__DIR__.'/../tmp/missing-filebase-read-check') === '', 'Filebase::read_file handles missing files as empty content'); $portal_dark = cfg('theme/options/portal-dark'); test_assert(!empty($portal_dark['description']) && !empty($portal_dark['footer_text']), 'theme metadata is centralized in config'); echo "All smoke tests passed.\n";