Skip to main content

Overview

Most features are available via the Bluesky Facade, so you can use standard Laravel mocks when writing tests. For general Laravel package testing, see package-testing.

Facade mocks

Use Bluesky::expects() to mock entire method chains.

HTTP fake

laravel-bluesky uses Laravel’s HTTP client internally. Add Http::preventStrayRequests() to your test setUp() to catch unexpected external requests immediately.
Http::preventStrayRequests() throws an exception if a real HTTP request is made during the test. This makes it easy to detect unintended external calls and keeps your test suite fast and reliable.

Features that cannot be mocked

FeedGenerator

FeedGenerator is called by the Bluesky server, so there is no end-to-end mock. However, the algorithm part of FeedGenerator can be mocked.

Core

The “Core” functionality of Bluesky/AtProtocol does not involve external access, so mocking is not needed.
Last modified on April 25, 2026