Skip to main content

Mock Connector

The Mock Connector is a connector that doesn't enqueue the message but instead it calls the callback function directly.

It is ideal for testing purposes and doesn't require any extra configuration or installation.

Usage

Instantiate the Connector

<?php
// Register the connector and associate with a scheme
ConnectorFactory::registerConnector(MockConnector::class);

// Create a connector
$connector = ConnectorFactory::create(new Uri("mock://local"));

Public & Consume

It is the same as the other connectors. See the README.md for more information.

Protocols:

ProtocolURI ExampleNotes
mockmock://localThis emulates a pub/sub consumer. It is for use on tests.

Open source ByJG