Let RabbitMQ do the work in your Symfony2 application

Many of the high-performance websites we create nowadays sometimes need to perform tasks that take a relatively large amount of time, such as sending an user an email after registration, creating a thumbnail from an avatar, or processing a large XML or CSV import file.

Some of these tasks require a lot of memory, others just take time to complete. It would be great to avoid a delay for the user who just registered and needs us to send him an email or to have a nice, scalable architecture to parse big files efficiently.

PHP test doubles patterns with prophecy

Test doubles are a way of replacing all classes in our tests other than the one we are testing. They give us control on direct and indirect outputs that would have been generated by those classes. Understanding the role of the test double helps us to write better tests, and thus better code. If we manage to isolate the "collaborators" (the other objects involved in our test) using doubles and test our objects in isolation, then we have achieved modularity: our code is decoupled and the communication between objects is documented by our tests. When writing unit tests we are focusing on describing one unit of behaviour at a time, and how objects communicate in order to achieve that behaviour. We instantiate the object under test, call a method of the object and observe if the outcome is as expected.

Functionally testing your application using MINK

Automated testing is big news these days. There's hardly a PHP conference happening without a talk on testing automation or derivative methodologies. TDD (Test-Driven Development) and BDD (Behaviour Driven Design) are all around us. So why should you care about all this? Well, there are many excellent reasons to do automated testing, including assuring application quality and inspiring developer confidence in a system. If you are a business person, you're most likely to care about the quality; if you're a developer then the confidence aspect is more important.

Pages