FakeBroadcastManager class
A fake BroadcastManager for testing.
Routes all broadcasting operations through an in-memory fake driver instead of a real WebSocket connection. Provides assertion helpers for verifying expected broadcasting activity.
final fake = Echo.fake();
Echo.channel('orders');
fake.assertSubscribed('orders');
fake.assertConnected();
- Inheritance
-
- Object
- BroadcastManager
- FakeBroadcastManager
Constructors
Properties
- driver → FakeBroadcastDriver
-
The underlying fake driver, exposed for direct inspection in tests.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
assertConnected(
) → void - Assert that the fake driver is currently connected.
-
assertDisconnected(
) → void - Assert that the fake driver is currently disconnected.
-
assertInterceptorAdded(
) → void - Assert that at least one interceptor has been added to the driver.
-
assertListening(
String channel, String event) → void -
Assert that a handler for
eventis registered onchannel. -
assertNotListening(
String channel, String event) → void -
Assert that NO handler for
eventis registered onchannel. -
assertNotSubscribed(
String channel) → void -
Assert that
channelis NOT in the subscribed channels list. -
assertSubscribed(
String channel) → void -
Assert that
channelis currently in the subscribed channels list. -
connection(
[String? name]) → BroadcastDriver -
Get the broadcast driver for the given
name, or the default connection.override -
dispatch(
String channel, String event, Map< String, dynamic> data) → void -
Deliver
datato the handler registered foreventonchannel, exactly as the driver would on an incoming frame. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
reset(
) → void - Clear all recorded state on the fake driver.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited