FakeChatTransport class
In-memory fake implementation of ChatTransport for unit / widget tests.
Ships as part of package:chataptor/testing.dart. Never leaks into the
production dependency graph of host apps (only merchants testing against
the SDK pull it in).
- Implemented types
Constructors
- FakeChatTransport()
- Creates a disconnected FakeChatTransport.
Properties
-
connectionState
→ Stream<
TransportConnectionState> -
Transport-level connection lifecycle.
no setteroverride
-
events
→ Stream<
TransportEvent> -
All incoming events across every joined channel.
no setteroverride
- hashCode → int
-
The hash code for this object.
no setterinherited
- inject ↔ FakeChatTransportInject
-
Event injection API.
latefinal
- recorded → FakeChatTransportRecorded
-
Recorded calls.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
connect(
TransportConfig config) → Future< void> -
Opens the socket and transitions through TransportConnectionStates.
override
-
disconnect(
) → Future< void> -
Leaves all channels and closes the socket. Idempotent.
override
-
dispose(
) → Future< void> -
Tears down controllers and releases resources. After dispose the
transport is unusable.
override
-
joinChannel(
String topic, Map< String, dynamic> params) → Future<Map< String, dynamic> > -
Joins (or re-joins) a Phoenix channel with the given
params. The transport routes subsequent pushes ontopicvia push and emits incoming events through events.override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
push(
String topic, String event, Map< String, dynamic> payload) → Future<PushResult> -
Pushes
eventwithpayloadtotopic. Returns a PushResult reflecting the server's reply (or a timeout/disconnect marker).override -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited