trypost/tests/Unit
Paulo Castellano 0a9ca9a185 fix: serialize plan_slug as string and broaden PostHog enabled tests
Two follow-ups from the final pre-merge review:

1. SyncUser and TrackBilling shipped \$account->plan?->slug, which is a
   PlanSlug backed enum. json_encode renders it correctly on the wire,
   but the queue payload carries an enum instance — anyone introspecting
   the job (Bus::fake, future workers) and string-comparing the slug
   would fail silently. Cast to ->slug->value at the call sites.

2. PostHogServiceTest only covered the api_key=null negative case. The
   primary scenario the gate exists to defend (self-hosted with a stale
   POSTHOG_API_KEY but POSTHOG_ENABLED=false) was not asserted. Added
   four tests covering capture/identify/groupIdentify with enabled=false
   and an api key present, plus a direct truth-table check on
   isEnabled() requiring both flags.
2026-05-07 13:21:58 -03:00
..
Ai refactor: reorganize settings UI, migrate post templates to a file-based registry, and remove legacy video generation features 2026-05-03 13:44:13 -03:00
Broadcasting feat: introduce Account entity as billing owner and refactor architecture 2026-04-14 22:22:04 -03:00
Enums refactor: centralize media size limits in config + drop Document type 2026-05-04 14:54:47 -03:00
Events feat: complete AI assistant with custom services and brand config 2026-04-16 09:25:08 -03:00
Exceptions/Social fix: Facebook/Instagram/Threads OAuthException type incorrectly treated as token error — now only code 190 triggers TokenExpiredException 2026-04-01 14:33:26 -03:00
Features feat: transition AI usage from feature-based limits to a centralized monthly credit system with token tracking. 2026-05-03 19:36:26 -03:00
Mail feat: @mentions in comments, AI Action layer + MCP tools, settings tabs 2026-05-01 20:59:03 -03:00
Models refactor: replace hashtags functionality with reusable signatures feature 2026-05-03 15:23:30 -03:00
Policies feat: transition AI usage from feature-based limits to a centralized monthly credit system with token tracking. 2026-05-03 19:36:26 -03:00
PostTemplates refactor: reorganize settings UI, migrate post templates to a file-based registry, and remove legacy video generation features 2026-05-03 13:44:13 -03:00
Rules test: add coverage for validation rules across REST + MCP + custom rules 2026-05-04 13:31:44 -03:00
Services refactor: collapse media-attach helpers back into MediaAttacher 2026-05-04 14:02:50 -03:00
Socialite refactor: settings redesign, Spanish translations, language system, strict_types 2026-03-30 00:20:43 -03:00
Support feat: @mentions in comments, AI Action layer + MCP tools, settings tabs 2026-05-01 20:59:03 -03:00
Traits refactor: centralize media size limits in config + drop Document type 2026-05-04 14:54:47 -03:00
ExampleTest.php refactor: settings redesign, Spanish translations, language system, strict_types 2026-03-30 00:20:43 -03:00
HelpersTest.php refactor: settings redesign, Spanish translations, language system, strict_types 2026-03-30 00:20:43 -03:00
MediaPolymorphTest.php fix: persist morph map alias on AI-generated Media rows 2026-05-04 14:14:14 -03:00
PostHogServiceTest.php fix: serialize plan_slug as string and broaden PostHog enabled tests 2026-05-07 13:21:58 -03:00