Ejemplo n.º 1
0
 public function setUp()
 {
     $this->driver = $this->getMockBuilder('\\Thruster\\Components\\InterProcessCommunication\\Driver\\DriverInterface')->getMockForAbstractClass();
     $this->signalHandler = $this->getMockBuilder('\\Thruster\\Components\\PosixSignalHandler\\SignalHandler')->getMock();
     $this->posix = $this->getMockBuilder('\\Thruster\\Wrappers\\Posix\\Posix')->getMock();
     $this->connection = new Connection();
     $this->connection->setSignalHandler($this->signalHandler);
     $this->connection->setPosix($this->posix);
     $this->connection->getDriver();
     $this->connection->setDriver($this->driver);
 }
Ejemplo n.º 2
0
 /**
  * Initiates a new connection with set signalHandler
  *
  * @return Connection
  */
 public function newConnection() : Connection
 {
     // If driver class was set for connectionManager when all new Connections will use the same driver class
     // otherwise we use default one
     $driverClass = $this->getDriverClass();
     if (null !== $driverClass) {
         $connection = new Connection($driverClass);
     } else {
         $connection = new Connection();
     }
     $connection->setSignalHandler($this->getSignalHandler());
     return $connection;
 }