public function test_on_session_start_boots_providers() { $called = []; $bootMe = function ($client) use(&$called) { $called['bootMe'] = $client; }; $andMe = function ($client) use(&$called) { $called['andMe'] = $client; }; $providers = ['ClientTestProviderStub', $bootMe, $andMe]; $c = new Client('cirrus.minor', $providers); $c->onSessionStart('session', 'transport'); $this->assertArrayHasKey('bootMe', $called); $this->assertInstanceOf('Vinelab\\Minion\\Client', $called['bootMe']); $this->assertArrayHasKey('andMe', $called); $this->assertInstanceOf('Vinelab\\Minion\\Client', $called['andMe']); }
/** * Constructor. * * @param \Vinelab\Minion\Client $client */ public function __construct($client) { $client->setDelegateProvider($this); $client->setTopicPrefix($this->prefix); $this->setClient($client); }