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