create(); $user->refresh(); $activity = [ '@context' => 'https://www.w3.org/ns/activitystreams', 'id' => 'https://a.example.org/statuses/123', 'type' => 'Note', 'url' => 'https://b.example.org/statuses/123', 'published' => now()->toAtomString(), 'content' => 'hello', ]; try { Helpers::storeStatus($activity['url'], $user->profile, $activity); $this->fail('Expected storeStatus to throw for mismatched domains'); } catch (Exception $e) { $context = json_decode($e->getMessage(), true); expect($context)->toBeArray(); expect($context['message'])->toBe('Invalid status domains'); expect($context['checked']['id_host'])->toBe('a.example.org'); expect($context['checked']['url_host'])->toBe('b.example.org'); expect($context['expected'])->toContain('match'); expect($context['payload'])->toBe($activity); } });