コード例 #1
0
 public function testDispatchCommandSuccessful()
 {
     $connection = new \Pheanstalk\Connection(self::SERVER_HOST, self::SERVER_PORT);
     $command = new \Pheanstalk\Command\UseCommand('test');
     $response = $connection->dispatchCommand($command);
     $this->assertIsA($response, '\\Pheanstalk\\Response');
 }
コード例 #2
0
 /**
  * A connection with a mock socket, configured to return the given line.
  * @return Pheanstalk_Connection
  */
 private function _connection($line)
 {
     $socket = new MockSocket();
     $socket->setReturnValue('getLine', $line);
     $connection = new \Pheanstalk\Connection(null, null);
     $connection->setSocket($socket);
     return $connection;
 }