News Feed
Jobs Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Alvaro Videla:
Using RabbitMQ in Unit Tests
May 01, 2013 @ 09:10:11

Alvaro Videla has a new post today showing how he used RabbitMQ in his unit testing runs with a small, quickly installed version of the server that can be removed once the tests are complete.

In this blog post I want to show you a very simple technique for using RabbitMQ in our Unit or Functional Tests. Let's say you wrote a bunch of tests for your RabbitMQ consumers and then it's time to run them. To do that you probably need to setup a RabbitMQ server just for tests with their own users and passwords, or you need to set up a whole new virtual host for your tests. [...] With a future release of RabbitMQ that we can already test on the nightlies website, we can run RabbitMQ without the need to install Erlang. We created a package that ships a stripped down version of Erlang together with the broker bits, so running RabbitMQ now is as easy as downloading a tarball, uncompressing it and starting the server.

With a combination of this more self-contained package and some listener handling through PHPUnit, they uncompress the tarball with a PHP script and start the server with the defined configuration. Then, once the tests are done, it cleans itself up and removes the entire server directory to make for a clean run the next time.

0 comments voice your opinion now!
rabbitmq standalone server erlang unittest phpunit

Link: http://videlalvaro.github.io/2013/04/using-rabbitmq-in-unit-tests.html

blog comments powered by Disqus

Similar Posts

Warren Tang's Blog: PHP Unit Testing & Mock Objects with SimpleTest plugin for Eclipse

Lars Tesmer's Blog: PHPUnit: Better Syntax for Expecting Exceptions

Gonzalo Ayuso: Building a simple API proxy server with PHP

Alexander Netkachev's Blog: Automatic testing of MVC applications created with Zend Framework

Sebastian Bergmann's Blog: RC2 Is The New RC1 (PHPUnit)


Community Events











Don't see your event here?
Let us know!


language introduction security application database hack composer framework podcast install component performance hhvm package release overview unittest opinion symfony2 facebook

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework