.*?)\n \}/s', $componentSource, $matches); expect($matches['body'] ?? '') ->toContain('$this->sentinelUpdatedAt = $this->server->sentinel_updated_at;') ->not->toContain('$this->syncData();'); }); it('dispatches a server navbar refresh after toggling sentinel', function () { $componentSource = file_get_contents(app_path('Livewire/Server/Sentinel.php')); preg_match('/public function toggleSentinel\([^)]*\).*?\{(?.*?) \}/s', $componentSource, $matches); expect($matches['body'] ?? '') ->toContain("\$this->dispatch('refreshServerShow');"); });