/** @test */ public function itShouldResolveConnectPromiseAfterHandshake() { $input = $this->createInputStreamMock(); $output = $this->getMock('React\\Stomp\\Io\\OutputStreamInterface'); $client = new Client($input, $output, array('vhost' => 'localhost')); $client->on('connect', $this->expectCallableOnce()); $client->connect()->then($this->expectCallableOnce()); $frame = new Frame('CONNECTED', array('session' => '1234', 'server' => 'React/alpha')); $input->emit('frame', array($frame)); }