Feature spotlight: PHP Unit
PHPUnit is a popular programmer-oriented testing framework for PHP. You can use it to test your code before the deployment so that you know the copy on your server is free of errors.
Image loading...
Configuring tests and delivery with Buddy
There's still a wide range of developers who haven't heard or don't know how to introduce Continuous Integration to their process. Buddy lets you set up the whole workflow in 10-15 minutes (either through GUI or YAML) and easily scale and expand once your projects grow bigger.
- Create a new project, choose your Git provider, and select your PHP repository.
- Add a new pipeline and switch the trigger mode to On every push
- Add PHPUnit action. You can install any missing modules in the Packages & Setup tab
- Add FTP/SFTP file transfer action and configure your deployment
composer install
on your server.
This way every time you'll make a push to the selected branch, Buddy will automatically test and deploy the changes to the server + run the desired SSH commands:
Image loading...
If your tests require a database to run, eg. MySQL, you can easily activate them in the Services tab:
Image loading...
A good practice is to add a conditional notification in the end that will send you a message in case the tests or the deployment have failed, for example to your Slack channel:
Image loading...
Summary
If you'd like to learn more about using Buddy in PHP development, check out our guides on automating PHP dependencies and Wordpress themes with Buddy.
Happy coding!
Jarek Dylewski
Customer Support
A journalist and an SEO specialist trying to find himself in the unforgiving world of coders. Gamer, a non-fiction literature fan and obsessive carnivore. Jarek uses his talents to convert the programming lingo into a cohesive and approachable narration.