Beispiel #1
0
 public function testDisconnectWithNoConnection()
 {
     $fsockopen = $this->getFunctionMock('\\Phlib\\Beanstalk\\Connection', 'fsockopen');
     $fsockopen->expects($this->any())->willReturn(true);
     $stream_set_timeout = $this->getFunctionMock('\\Phlib\\Beanstalk\\Connection', 'stream_set_timeout');
     $stream_set_timeout->expects($this->any())->willReturn(true);
     $fsockopen = $this->getFunctionMock('\\Phlib\\Beanstalk\\Connection', 'fclose');
     $fsockopen->expects($this->never());
     // <- test here
     $socket = new Socket('host');
     $socket->connect();
     $socket->disconnect();
 }