'), strpos($html, 'post-top-ad')); } public function test_theme_vars_are_usable(): void { Setting::set('theme_vars_sablog', ['ad_header' => '
头部广告
']); // theme('var') 直接可用 $this->assertSame('
头部广告
', theme('var', 'ad_header', '')); } public function test_content_top_and_stylevars_render_on_home(): void { Setting::set('inject.blocks', [ ['point' => 'content_top', 'title' => '首页广告', 'html' => '
首页广告位
', 'sort' => 1, 'enabled' => true], ]); Setting::set('theme_vars_sablog', [ 'ad_header' => '
头部广告
', 'huangjinlian' => '', ]); $this->get('/') ->assertOk() ->assertSee('首页广告位', false) ->assertSee('头部广告', false) ->assertSee('页脚广告', false); } }