Thruway\Procedure::getRegistrations PHP Method

getRegistrations() public method

public getRegistrations ( ) : array
return array
    public function getRegistrations()
    {
        return $this->registrations;
    }

Usage Example

 public function testLeave()
 {
     $session = $this->getMockBuilder('\\Thruway\\Session')->disableOriginalConstructor()->getMock();
     $session->expects($this->once())->method("sendMessage")->with($this->isInstanceOf('\\Thruway\\Message\\RegisteredMessage'));
     $registerMsg = new \Thruway\Message\RegisterMessage(\Thruway\Common\Utils::getUniqueId(), [], 'test_procedure');
     $this->_proc->processRegister($session, $registerMsg);
     $this->assertEquals(1, count($this->_proc->getRegistrations()));
     $this->_proc->leave($session);
     $this->assertEquals(0, count($this->_proc->getRegistrations()));
 }