onSessionStart() public method

Called when the server session has started which will call all the providers so that they perform whatever they have to do.
public onSessionStart ( AbstractSession $session, Thruway\Transport\TransportInterface $transport )
$session Thruway\AbstractSession
$transport Thruway\Transport\TransportInterface
Example #1
0
 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']);
 }