Testing a HL7 application can be quite a challenge. While writing a HL7 client I wasn't able to use a server to test my application against. There are some solutions, for example to write your own testing application. The problem with this is that you easily make the same mistakes twice, so the test isn't quite as reliable as it should be.
The Perl HL7 Toolkit will help you with this. This open source project (while quite for some time) provides you with a HL7 server (hl7d) that parses messages to a plug-in (to a database or filesystem) and a HL7 queue daemon (hl7qd) to act as a client and send messages from a database or filesystem.
Both these applications are based on the Net::HL7 Perl component that will help you to parse HL7 messages with Perl or PHP.