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); }
/** * 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; }