Beispiel #1
0
 protected function execute($command, $response, $method, array $arguments = [])
 {
     $this->socket->expects($this->once())->method('write')->with($this->stringContains($command));
     if (is_array($response)) {
         $thisReturn = call_user_func_array([$this, 'onConsecutiveCalls'], $response);
         $this->socket->expects($this->any())->method('read')->will($thisReturn);
     } else {
         $this->socket->expects($this->any())->method('read')->willReturn($response);
     }
     return call_user_func_array([$this->beanstalk, $method], $arguments);
 }